diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2019-11-25 00:23:07 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2019-11-25 00:23:07 +0000 |
commit | 6bc456c91c6a556e905852d9a13034ed1932ea3d (patch) | |
tree | 69df19159e5e7df77ae939041f8f6e941c5ef056 /pkgs/build-support/bintools-wrapper | |
parent | ea9a2c5ec21bf088bbdef036238fa67cdc85b073 (diff) | |
parent | 4273a6adcc9327b9dc0e09e9fe205b4861c15679 (diff) | |
download | nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.tar nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.tar.gz nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.tar.bz2 nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.tar.lz nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.tar.xz nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.tar.zst nixlib-6bc456c91c6a556e905852d9a13034ed1932ea3d.zip |
Merge remote-tracking branch 'upstream/master' into ghcjs-cross-without-cc
Diffstat (limited to 'pkgs/build-support/bintools-wrapper')
-rw-r--r-- | pkgs/build-support/bintools-wrapper/default.nix | 14 | ||||
-rw-r--r-- | pkgs/build-support/bintools-wrapper/setup-hook.sh | 11 |
2 files changed, 6 insertions, 19 deletions
diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 648b8b4ffa96..fd95da6c6cdd 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -111,17 +111,13 @@ stdenv.mkDerivation { installPhase = '' - set -u - mkdir -p $out/bin $out/nix-support wrap() { local dst="$1" local wrapper="$2" export prog="$3" - set +u substituteAll "$wrapper" "$out/bin/$dst" - set -u chmod +x "$out/bin/$dst" } '' @@ -163,8 +159,6 @@ stdenv.mkDerivation { [[ -e "$underlying" ]] || continue wrap ${targetPrefix}$variant ${./ld-wrapper.sh} $underlying done - - set +u ''; emulation = let @@ -190,6 +184,7 @@ stdenv.mkDerivation { else if targetPlatform.isMsp430 then "msp430" else if targetPlatform.isAvr then "avr" else if targetPlatform.isAlpha then "alpha" + else if targetPlatform.isVc4 then "vc4" else throw "unknown emulation for platform: ${targetPlatform.config}"; in if targetPlatform.useLLVM or false then "" else targetPlatform.platform.bfdEmulation or (fmt + sep + arch); @@ -205,11 +200,7 @@ stdenv.mkDerivation { ]; postFixup = - '' - set -u - '' - - + optionalString (libc != null) ('' + optionalString (libc != null) ('' ## ## General libc support ## @@ -307,7 +298,6 @@ stdenv.mkDerivation { '' + '' - set +u substituteAll ${./add-flags.sh} $out/nix-support/add-flags.sh substituteAll ${./add-hardening.sh} $out/nix-support/add-hardening.sh substituteAll ${../wrapper-common/utils.bash} $out/nix-support/utils.bash diff --git a/pkgs/build-support/bintools-wrapper/setup-hook.sh b/pkgs/build-support/bintools-wrapper/setup-hook.sh index f65b792485a0..a714bd151c90 100644 --- a/pkgs/build-support/bintools-wrapper/setup-hook.sh +++ b/pkgs/build-support/bintools-wrapper/setup-hook.sh @@ -2,8 +2,6 @@ # # See comments in cc-wrapper's setup hook. This works exactly the same way. -set -u - # Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a # native compile. # @@ -24,7 +22,8 @@ bintoolsWrapper_addLDVars () { # Python and Haskell packages often only have directories like $out/lib/ghc-8.4.3/ or # $out/lib/python3.6/, so having them in LDFLAGS just makes the linker search unnecessary # directories and bloats the size of the environment variable space. - if [[ -n "$(echo $1/lib/lib*)" ]]; then + local -a glob=( $1/lib/lib* ) + if [ "${#glob[*]}" -gt 0 ]; then export NIX_${role_pre}LDFLAGS+=" -L$1/lib" fi fi @@ -61,9 +60,8 @@ do if PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null then - upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")" - export "${role_pre}${upper_case}=@targetPrefix@${cmd}"; - export "${upper_case}${role_post}=@targetPrefix@${cmd}"; + export "${role_pre}${cmd^^}=@targetPrefix@${cmd}"; + export "${cmd^^}${role_post}=@targetPrefix@${cmd}"; fi done @@ -73,4 +71,3 @@ export NIX_HARDENING_ENABLE # No local scope in sourced file unset -v role_pre role_post cmd upper_case -set +u |