mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 15:22:59 +01:00
bintools: disable -pie when -r or -Ur are used (#128674)
* bintools: disable -pie when -r or -Ur are used ld’s -r allows you to partially link object files. When -pie is passed with -r, though, we get: ld: -r and -pie may not be used together Most build systems are intelligent enough to pass -no-pie before -r, but we might as well support those that don’t. Note: -pie is not enabled by default in Nixpkgs, but it is when you are using musl. So this solution is really only useful for musl toolchains. * bintools-wrapper: Add incremental -i check for pie
This commit is contained in:
parent
ed4094a728
commit
f5074933b7
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ fi
|
|||
for flag in "${!hardeningEnableMap[@]}"; do
|
||||
case $flag in
|
||||
pie)
|
||||
if [[ ! ("$*" =~ " -shared " || "$*" =~ " -static ") ]]; then
|
||||
if [[ ! ("$*" =~ " -shared " || "$*" =~ " -static " || "$*" =~ " -r " || "$*" =~ " -Ur " || "$*" =~ " -i ") ]]; then
|
||||
if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling LDFlags -pie >&2; fi
|
||||
hardeningLDFlags+=('-pie')
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue