Skip to content

Disable compiler/linker hardening features for the nix devShell environment

Maximilian Nitsch requested to merge fix/nix-develop-build into master

With enabled hardening, nix adds -D_FORTIFY_SOURCE=2 to the compiler options, which only works in combination with the optimization level -O2.1 For debug builds, optimization is disabled in the Makefile, which leads to the following warning:

warning _fortify_source requires compiling with optimization (-o)

To remove this warning, hardening is deactivated for the devShell environment.

  1. https://nixos.org/manual/nixpkgs/stable/#sec-hardening-in-nixpkgs

Merge request reports