From dc47e763c15b54ece609e08d0496462a11862cd6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 23 Aug 2017 17:30:56 -0400 Subject: [PATCH] cc-wrapper: Use `set -u` for better maintainability --- pkgs/build-support/cc-wrapper/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index bb95c1807ab9..696e43369a7a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -114,6 +114,8 @@ stdenv.mkDerivation { buildCommand = '' + set -u + mkdir -p $out/bin $out/nix-support $man/nix-support wrap() { @@ -320,7 +322,7 @@ stdenv.mkDerivation { rm $out/nix-support/setup-hook.tmp # 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 hardening_unsupported_flags+=" bindnow" fi