Skip to content

Commit

Permalink
gcc/binutils: disable pie hardening
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
matthewbauer committed Nov 9, 2018
1 parent 2f97911 commit 2e2afa1
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/4.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ stdenv.mkDerivation ({

inherit patches;

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

outputs = [ "out" "lib" "man" "info" ];
setOutputFlags = false;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/4.9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ stdenv.mkDerivation ({

inherit patches;

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

outputs = if langJava || langGo then ["out" "man" "info"]
else [ "out" "lib" "man" "info" ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/misc/binutils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ stdenv.mkDerivation rec {
then "-Wno-string-plus-int -Wno-deprecated-declarations"
else "-static-libgcc";

hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";

# TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
Expand Down

1 comment on commit 2e2afa1

@grahamc
Copy link
Member

@grahamc grahamc commented on 2e2afa1 Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @fpletz

Please sign in to comment.