cc-wrapper: Use `set -u` for better maintainability

This commit is contained in:
John Ericson 2017-08-23 17:30:56 -04:00 committed by John Ericson
parent a470be5a16
commit dc47e763c1
1 changed files with 3 additions and 1 deletions

View File

@ -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