gcc/binutils: disable pie hardening
These don’t like having -fPIE set for them. We should disable
hardening all the time, but in the interest of not changing hashes,
this only disables it for Musl (where it is now the default).
(cherry picked from commit a3a6884649354a660326acd68c1bd08ffd2dcfa2)
commit2e2afa1943a69cef6abb96a8552ddafd06f9bbd4
authorMatthew Bauer <mjbauer95@gmail.com>
dateThu 8 Nov 2018, 15:34 (8 years ago)
parent2f97911
pkgs/development/compilers/gcc/4.8/default.nix+1−1
@@ -180,7 +180,7 @@ stdenv.mkDerivation ({
180180
181181 inherit patches;
182182
183− hardeningDisable = [ "format" ];
183+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
184184
185185 outputs = [ "out" "lib" "man" "info" ];
186186 setOutputFlags = false;
pkgs/development/compilers/gcc/4.9/default.nix+1−1
@@ -188,7 +188,7 @@ stdenv.mkDerivation ({
188188
189189 inherit patches;
190190
191− hardeningDisable = [ "format" ];
191+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
192192
193193 outputs = if langJava || langGo then ["out" "man" "info"]
194194 else [ "out" "lib" "man" "info" ];
pkgs/development/compilers/gcc/5/default.nix+1−1
@@ -181,7 +181,7 @@ stdenv.mkDerivation ({
181181
182182 libc_dev = stdenv.cc.libc_dev;
183183
184− hardeningDisable = [ "format" ];
184+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
185185
186186 # This should kill all the stdinc frameworks that gcc and friends like to
187187 # insert into default search paths.
pkgs/development/compilers/gcc/6/default.nix+1−1
@@ -182,7 +182,7 @@ stdenv.mkDerivation ({
182182
183183 libc_dev = stdenv.cc.libc_dev;
184184
185− hardeningDisable = [ "format" ];
185+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
186186
187187 # This should kill all the stdinc frameworks that gcc and friends like to
188188 # insert into default search paths.
pkgs/development/compilers/gcc/7/default.nix+1−1
@@ -151,7 +151,7 @@ stdenv.mkDerivation ({
151151
152152 libc_dev = stdenv.cc.libc_dev;
153153
154− hardeningDisable = [ "format" ];
154+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
155155
156156 # This should kill all the stdinc frameworks that gcc and friends like to
157157 # insert into default search paths.
pkgs/development/compilers/gcc/8/default.nix+1−1
@@ -145,7 +145,7 @@ stdenv.mkDerivation ({
145145
146146 libc_dev = stdenv.cc.libc_dev;
147147
148− hardeningDisable = [ "format" ];
148+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
149149
150150 # This should kill all the stdinc frameworks that gcc and friends like to
151151 # insert into default search paths.
pkgs/development/tools/misc/binutils/default.nix+1−1
@@ -97,7 +97,7 @@ stdenv.mkDerivation rec {
9797 then "-Wno-string-plus-int -Wno-deprecated-declarations"
9898 else "-static-libgcc";
9999
100− hardeningDisable = [ "format" ];
100+ hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
101101
102102 # TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
103103 configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";