stdenv-linux: Ensure binutils comes before bootstrapTools in $PATH

Otherwise, when building glibc and other packages, the "strip" from
bootstrapTools is used, which doesn't recognise some tags produced by
the newer "ld" from binutils.

+10 -18
+6 -6
pkgs/build-support/cc-wrapper/setup-hook.sh
··· 22 22 23 23 # Note: these come *after* $out in the PATH (see setup.sh). 24 24 25 - if [ -n "@cc@" ]; then 26 - addToSearchPath PATH @cc@/bin 25 + if [ -n "@binutils@" ]; then 26 + addToSearchPath _PATH @binutils@/bin 27 27 fi 28 28 29 - if [ -n "@binutils@" ]; then 30 - addToSearchPath PATH @binutils@/bin 29 + if [ -n "@cc@" ]; then 30 + addToSearchPath _PATH @cc@/bin 31 31 fi 32 32 33 33 if [ -n "@libc@" ]; then 34 - addToSearchPath PATH @libc@/bin 34 + addToSearchPath _PATH @libc@/bin 35 35 fi 36 36 37 37 if [ -n "@coreutils@" ]; then 38 - addToSearchPath PATH @coreutils@/bin 38 + addToSearchPath _PATH @coreutils@/bin 39 39 fi 40 40 41 41 if [ -z "$crossConfig" ]; then
+4 -12
pkgs/stdenv/generic/setup.sh
··· 214 214 for i in $initialPath; do 215 215 if [ "$i" = / ]; then i=; fi 216 216 addToSearchPath PATH $i/bin 217 - addToSearchPath PATH $i/sbin 218 217 done 219 218 220 219 if [ "$NIX_DEBUG" = 1 ]; then ··· 262 261 source "$pkg" 263 262 fi 264 263 264 + if [ -d $1/bin ]; then 265 + addToSearchPath _PATH $1/bin 266 + fi 267 + 265 268 if [ -f "$pkg/nix-support/setup-hook" ]; then 266 269 source "$pkg/nix-support/setup-hook" 267 270 fi ··· 289 292 _addToNativeEnv() { 290 293 local pkg=$1 291 294 292 - if [ -d $1/bin ]; then 293 - addToSearchPath _PATH $1/bin 294 - fi 295 - 296 295 # Run the package-specific hooks set by the setup-hook scripts. 297 296 runHook envHook "$pkg" 298 297 } ··· 303 302 304 303 _addToCrossEnv() { 305 304 local pkg=$1 306 - 307 - # Some programs put important build scripts (freetype-config and similar) 308 - # into their crossDrv bin path. Intentionally these should go after 309 - # the nativePkgs in PATH. 310 - if [ -d $1/bin ]; then 311 - addToSearchPath _PATH $1/bin 312 - fi 313 305 314 306 # Run the package-specific hooks set by the setup-hook scripts. 315 307 runHook crossEnvHook "$pkg"