Revert "Merge pull request #44767 from obsidiansystems/wrapper-env-var-path"

This reverts commit 89efc27f571368b475ce87e71445be10a9d1121a, reversing
changes made to d0f11020ca55dfe20ecad05005343e3a3e3cbd90.

authored by Matthew Bauer and committed by Robin Gloster 13c8acc3 8e4d051c

+76 -54
+4 -4
pkgs/build-support/bintools-wrapper/setup-hook.sh
··· 59 59 ar as ld nm objcopy objdump readelf ranlib strip strings size windres 60 60 do 61 61 if 62 - cmd_path=$(PATH=$_PATH command -v "@targetPrefix@${cmd}") 62 + PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null 63 63 then 64 64 upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")" 65 - export "${role_pre}${upper_case}=${cmd_path}"; 66 - export "${upper_case}${role_post}=${cmd_path}"; 65 + export "${role_pre}${upper_case}=@targetPrefix@${cmd}"; 66 + export "${upper_case}${role_post}=@targetPrefix@${cmd}"; 67 67 fi 68 68 done 69 69 ··· 72 72 export NIX_HARDENING_ENABLE 73 73 74 74 # No local scope in sourced file 75 - unset -v role_pre role_post cmd cmd_path upper_case 75 + unset -v role_pre role_post cmd upper_case 76 76 set +u
+4 -4
pkgs/build-support/cc-wrapper/setup-hook.sh
··· 109 109 110 110 export NIX_${role_pre}CC=@out@ 111 111 112 - export ${role_pre}CC=@out@/bin/@named_cc@ 113 - export ${role_pre}CXX=@out@/bin/@named_cxx@ 114 - export CC${role_post}=@out@/bin/@named_cc@ 115 - export CXX${role_post}=@out@/bin/@named_cxx@ 112 + export ${role_pre}CC=@named_cc@ 113 + export ${role_pre}CXX=@named_cxx@ 114 + export CC${role_post}=@named_cc@ 115 + export CXX${role_post}=@named_cxx@ 116 116 117 117 # If unset, assume the default hardening flags. 118 118 : ${NIX_HARDENING_ENABLE="fortify stackprotector pic strictoverflow format relro bindnow"}
+9 -10
pkgs/development/compilers/ghc/8.0.2.nix
··· 102 102 done 103 103 # GHC is a bit confused on its cross terminology, as these would normally be 104 104 # the *host* tools. 105 - export CC="$CC_FOR_TARGET" 106 - export CXX="$CXX_FOR_TARGET" 107 - # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 108 - export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}" 109 - export AS="$AS_FOR_TARGET" 110 - export AR="$AR_FOR_TARGET" 111 - export NM="$NM_FOR_TARGET" 112 - export RANLIB="$RANLIB_FOR_TARGET" 113 - export READELF="$READELF_FOR_TARGET" 114 - export STRIP="$STRIP_FOR_TARGET" 105 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 106 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 107 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld" 108 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 109 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 110 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 111 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 112 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 113 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 115 114 116 115 echo -n "${buildMK}" > mk/build.mk 117 116 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
+8 -8
pkgs/development/compilers/ghc/8.2.2.nix
··· 134 134 done 135 135 # GHC is a bit confused on its cross terminology, as these would normally be 136 136 # the *host* tools. 137 - export CC="$CC_FOR_TARGET" 138 - export CXX="$CXX_FOR_TARGET" 137 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 138 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 139 139 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 140 140 export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}" 141 - export AS="$AS_FOR_TARGET" 142 - export AR="$AR_FOR_TARGET" 143 - export NM="$NM_FOR_TARGET" 144 - export RANLIB="$RANLIB_FOR_TARGET" 145 - export READELF="$READELF_FOR_TARGET" 146 - export STRIP="$STRIP_FOR_TARGET" 141 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 142 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 143 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 144 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 145 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 146 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 147 147 148 148 echo -n "${buildMK}" > mk/build.mk 149 149 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
+8 -8
pkgs/development/compilers/ghc/8.4.3.nix
··· 115 115 done 116 116 # GHC is a bit confused on its cross terminology, as these would normally be 117 117 # the *host* tools. 118 - export CC="$CC_FOR_TARGET" 119 - export CXX="$CXX_FOR_TARGET" 118 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 119 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 120 120 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 121 121 export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}" 122 - export AS="$AS_FOR_TARGET" 123 - export AR="$AR_FOR_TARGET" 124 - export NM="$NM_FOR_TARGET" 125 - export RANLIB="$RANLIB_FOR_TARGET" 126 - export READELF="$READELF_FOR_TARGET" 127 - export STRIP="$STRIP_FOR_TARGET" 122 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 123 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 124 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 125 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 126 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 127 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 128 128 129 129 echo -n "${buildMK}" > mk/build.mk 130 130 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
+8 -8
pkgs/development/compilers/ghc/8.6.1.nix
··· 98 98 done 99 99 # GHC is a bit confused on its cross terminology, as these would normally be 100 100 # the *host* tools. 101 - export CC="$CC_FOR_TARGET" 102 - export CXX="$CXX_FOR_TARGET" 101 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 102 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 103 103 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 104 104 export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}" 105 - export AS="$AS_FOR_TARGET" 106 - export AR="$AR_FOR_TARGET" 107 - export NM="$NM_FOR_TARGET" 108 - export RANLIB="$RANLIB_FOR_TARGET" 109 - export READELF="$READELF_FOR_TARGET" 110 - export STRIP="$STRIP_FOR_TARGET" 105 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 106 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 107 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 108 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 109 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 110 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 111 111 112 112 echo -n "${buildMK}" > mk/build.mk 113 113 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
+8 -8
pkgs/development/compilers/ghc/head.nix
··· 100 100 done 101 101 # GHC is a bit confused on its cross terminology, as these would normally be 102 102 # the *host* tools. 103 - export CC="$CC_FOR_TARGET" 104 - export CXX="$CXX_FOR_TARGET" 103 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 104 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 105 105 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 106 106 export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}" 107 - export AS="$AS_FOR_TARGET" 108 - export AR="$AR_FOR_TARGET" 109 - export NM="$NM_FOR_TARGET" 110 - export RANLIB="$RANLIB_FOR_TARGET" 111 - export READELF="$READELF_FOR_TARGET" 112 - export STRIP="$STRIP_FOR_TARGET" 107 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 108 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 109 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 110 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 111 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 112 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 113 113 114 114 echo -n "${buildMK}" > mk/build.mk 115 115 echo ${version} >VERSION
+27 -4
pkgs/development/libraries/gcc/libgcc/default.nix
··· 46 46 mkdir -p "$buildRoot/gcc" 47 47 cd "$buildRoot/gcc" 48 48 ( 49 + export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD 50 + export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD 51 + export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD 52 + export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD 53 + export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD 54 + 49 55 export AS=$AS_FOR_BUILD 50 56 export CC=$CC_FOR_BUILD 51 57 export CPP=$CPP_FOR_BUILD 52 58 export CXX=$CXX_FOR_BUILD 53 59 export LD=$LD_FOR_BUILD 54 60 55 - export AS_FOR_TARGET=$AS 56 - export CC_FOR_TARGET=$CC 57 - export CPP_FOR_TARGET=$CPP 58 - export LD_FOR_TARGET=$LD 61 + export AS_FOR_TARGET=${stdenvNoLibs.cc}/bin/$AS 62 + export CC_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CC 63 + export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP 64 + export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD 59 65 60 66 export NIX_BUILD_CFLAGS_COMPILE+=' -DGENERATOR_FILE=1' 61 67 ··· 81 87 cd "$buildRoot/gcc/${hostPlatform.config}/libgcc" 82 88 configureScript=$sourceRoot/configure 83 89 chmod +x "$configureScript" 90 + 91 + export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD 92 + export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD 93 + export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD 94 + export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD 95 + export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD 96 + 97 + export AS=${stdenvNoLibs.cc}/bin/$AS 98 + export CC=${stdenvNoLibs.cc}/bin/$CC 99 + export CPP=${stdenvNoLibs.cc}/bin/$CPP 100 + export CXX=${stdenvNoLibs.cc}/bin/$CXX 101 + export LD=${stdenvNoLibs.cc.bintools}/bin/$LD 102 + 103 + export AS_FOR_TARGET=${stdenvNoLibs.cc}/bin/$AS_FOR_TARGET 104 + export CC_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CC_FOR_TARGET 105 + export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP_FOR_TARGET 106 + export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD_FOR_TARGET 84 107 ''; 85 108 86 109 gccConfigureFlags = [