Skip to content

Commit

Permalink
stdenv: Enable PIE by default
Browse files Browse the repository at this point in the history
  • Loading branch information
chivay committed Mar 30, 2024
1 parent d7ece48 commit 35e7a1b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkgs/build-support/bintools-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@
"stackprotector"
"strictoverflow"
] ++ lib.optional (with stdenvNoCC;
# Musl-based platforms will keep "pie", other platforms will not.
# If you change this, make sure to update section `{#sec-hardening-in-nixpkgs}`
# in the nixpkgs manual to inform users about the defaults.
targetPlatform.libc == "musl"
# Except when:
# Always enable PIE except when using musl for:
# - static aarch64, where compilation works, but produces segfaulting dynamically linked binaries.
# - static armv7l, where compilation fails.
&& !(targetPlatform.isAarch && targetPlatform.isStatic)
!(targetPlatform.libc == "musl" && targetPlatform.isAarch && targetPlatform.isStatic)
) "pie"

# Darwin code signing support utilities
Expand Down

0 comments on commit 35e7a1b

Please sign in to comment.