mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nginx, nginxUnstable: hardening: only use when the compiler is gcc
This commit is contained in:
parent
7b9684a5b5
commit
708c6094c5
2 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
|
|||
NIX_CFLAGS_COMPILE = [ "-I${libxml2}/include/libxml2" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations -Wno-error=conditional-uninitialized";
|
||||
|
||||
preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules)
|
||||
+ optionalString hardening ''
|
||||
+ optionalString (hardening && (stdenv.cc.cc.isGNU or false)) ''
|
||||
configureFlagsArray=(
|
||||
--with-cc-opt="-fPIE -fstack-protector-all --param ssp-buffer-size=4 -O2 -D_FORTIFY_SOURCE=2"
|
||||
--with-ld-opt="-pie -Wl,-z,relro,-z,now"
|
||||
|
|
|
@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
|
|||
NIX_CFLAGS_COMPILE = [ "-I${libxml2}/include/libxml2" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations";
|
||||
|
||||
preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules)
|
||||
+ optionalString hardening ''
|
||||
+ optionalString (hardening && (stdenv.cc.cc.isGNU or false)) ''
|
||||
configureFlagsArray=(
|
||||
--with-cc-opt="-fPIE -fstack-protector-all --param ssp-buffer-size=4 -O2 -D_FORTIFY_SOURCE=2"
|
||||
--with-ld-opt="-pie -Wl,-z,relro,-z,now"
|
||||
|
|
Loading…
Reference in a new issue