cc-wrapper: Use `set -u` for better maintainability
This commit is contained in:
parent
a470be5a16
commit
dc47e763c1
|
@ -114,6 +114,8 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
buildCommand =
|
buildCommand =
|
||||||
''
|
''
|
||||||
|
set -u
|
||||||
|
|
||||||
mkdir -p $out/bin $out/nix-support $man/nix-support
|
mkdir -p $out/bin $out/nix-support $man/nix-support
|
||||||
|
|
||||||
wrap() {
|
wrap() {
|
||||||
|
@ -320,7 +322,7 @@ stdenv.mkDerivation {
|
||||||
rm $out/nix-support/setup-hook.tmp
|
rm $out/nix-support/setup-hook.tmp
|
||||||
|
|
||||||
# some linkers on some platforms don't support specific -z flags
|
# some linkers on some platforms don't support specific -z flags
|
||||||
hardening_unsupported_flags=""
|
export hardening_unsupported_flags=""
|
||||||
if [[ "$($ldPath/${prefix}ld -z now 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
|
if [[ "$($ldPath/${prefix}ld -z now 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
|
||||||
hardening_unsupported_flags+=" bindnow"
|
hardening_unsupported_flags+=" bindnow"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue