mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
Revert "Merge pull request #44767 from obsidiansystems/wrapper-env-var-path"
This reverts commit89efc27f57
, reversing changes made tod0f11020ca
.
This commit is contained in:
parent
8e4d051c62
commit
13c8acc3db
@ -59,11 +59,11 @@ for cmd in \
|
|||||||
ar as ld nm objcopy objdump readelf ranlib strip strings size windres
|
ar as ld nm objcopy objdump readelf ranlib strip strings size windres
|
||||||
do
|
do
|
||||||
if
|
if
|
||||||
cmd_path=$(PATH=$_PATH command -v "@targetPrefix@${cmd}")
|
PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null
|
||||||
then
|
then
|
||||||
upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")"
|
upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")"
|
||||||
export "${role_pre}${upper_case}=${cmd_path}";
|
export "${role_pre}${upper_case}=@targetPrefix@${cmd}";
|
||||||
export "${upper_case}${role_post}=${cmd_path}";
|
export "${upper_case}${role_post}=@targetPrefix@${cmd}";
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -72,5 +72,5 @@ done
|
|||||||
export NIX_HARDENING_ENABLE
|
export NIX_HARDENING_ENABLE
|
||||||
|
|
||||||
# No local scope in sourced file
|
# No local scope in sourced file
|
||||||
unset -v role_pre role_post cmd cmd_path upper_case
|
unset -v role_pre role_post cmd upper_case
|
||||||
set +u
|
set +u
|
||||||
|
@ -109,10 +109,10 @@ fi
|
|||||||
|
|
||||||
export NIX_${role_pre}CC=@out@
|
export NIX_${role_pre}CC=@out@
|
||||||
|
|
||||||
export ${role_pre}CC=@out@/bin/@named_cc@
|
export ${role_pre}CC=@named_cc@
|
||||||
export ${role_pre}CXX=@out@/bin/@named_cxx@
|
export ${role_pre}CXX=@named_cxx@
|
||||||
export CC${role_post}=@out@/bin/@named_cc@
|
export CC${role_post}=@named_cc@
|
||||||
export CXX${role_post}=@out@/bin/@named_cxx@
|
export CXX${role_post}=@named_cxx@
|
||||||
|
|
||||||
# If unset, assume the default hardening flags.
|
# If unset, assume the default hardening flags.
|
||||||
: ${NIX_HARDENING_ENABLE="fortify stackprotector pic strictoverflow format relro bindnow"}
|
: ${NIX_HARDENING_ENABLE="fortify stackprotector pic strictoverflow format relro bindnow"}
|
||||||
|
@ -102,16 +102,15 @@ stdenv.mkDerivation rec {
|
|||||||
done
|
done
|
||||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
# the *host* tools.
|
# the *host* tools.
|
||||||
export CC="$CC_FOR_TARGET"
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
export CXX="$CXX_FOR_TARGET"
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
|
||||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
export AS="$AS_FOR_TARGET"
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
export AR="$AR_FOR_TARGET"
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
export NM="$NM_FOR_TARGET"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export RANLIB="$RANLIB_FOR_TARGET"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export READELF="$READELF_FOR_TARGET"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
export STRIP="$STRIP_FOR_TARGET"
|
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
|
@ -134,16 +134,16 @@ stdenv.mkDerivation rec {
|
|||||||
done
|
done
|
||||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
# the *host* tools.
|
# the *host* tools.
|
||||||
export CC="$CC_FOR_TARGET"
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
export CXX="$CXX_FOR_TARGET"
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
||||||
export AS="$AS_FOR_TARGET"
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
export AR="$AR_FOR_TARGET"
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
export NM="$NM_FOR_TARGET"
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
export RANLIB="$RANLIB_FOR_TARGET"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export READELF="$READELF_FOR_TARGET"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export STRIP="$STRIP_FOR_TARGET"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
|
@ -115,16 +115,16 @@ stdenv.mkDerivation (rec {
|
|||||||
done
|
done
|
||||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
# the *host* tools.
|
# the *host* tools.
|
||||||
export CC="$CC_FOR_TARGET"
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
export CXX="$CXX_FOR_TARGET"
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
||||||
export AS="$AS_FOR_TARGET"
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
export AR="$AR_FOR_TARGET"
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
export NM="$NM_FOR_TARGET"
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
export RANLIB="$RANLIB_FOR_TARGET"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export READELF="$READELF_FOR_TARGET"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export STRIP="$STRIP_FOR_TARGET"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
|
@ -98,16 +98,16 @@ stdenv.mkDerivation (rec {
|
|||||||
done
|
done
|
||||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
# the *host* tools.
|
# the *host* tools.
|
||||||
export CC="$CC_FOR_TARGET"
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
export CXX="$CXX_FOR_TARGET"
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
||||||
export AS="$AS_FOR_TARGET"
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
export AR="$AR_FOR_TARGET"
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
export NM="$NM_FOR_TARGET"
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
export RANLIB="$RANLIB_FOR_TARGET"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export READELF="$READELF_FOR_TARGET"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export STRIP="$STRIP_FOR_TARGET"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
|
@ -100,16 +100,16 @@ stdenv.mkDerivation rec {
|
|||||||
done
|
done
|
||||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
# the *host* tools.
|
# the *host* tools.
|
||||||
export CC="$CC_FOR_TARGET"
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
export CXX="$CXX_FOR_TARGET"
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
||||||
export AS="$AS_FOR_TARGET"
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
export AR="$AR_FOR_TARGET"
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
export NM="$NM_FOR_TARGET"
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
export RANLIB="$RANLIB_FOR_TARGET"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export READELF="$READELF_FOR_TARGET"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export STRIP="$STRIP_FOR_TARGET"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
echo ${version} >VERSION
|
echo ${version} >VERSION
|
||||||
|
@ -46,16 +46,22 @@ stdenvNoLibs.mkDerivation rec {
|
|||||||
mkdir -p "$buildRoot/gcc"
|
mkdir -p "$buildRoot/gcc"
|
||||||
cd "$buildRoot/gcc"
|
cd "$buildRoot/gcc"
|
||||||
(
|
(
|
||||||
|
export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD
|
||||||
|
export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD
|
||||||
|
export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD
|
||||||
|
export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD
|
||||||
|
export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD
|
||||||
|
|
||||||
export AS=$AS_FOR_BUILD
|
export AS=$AS_FOR_BUILD
|
||||||
export CC=$CC_FOR_BUILD
|
export CC=$CC_FOR_BUILD
|
||||||
export CPP=$CPP_FOR_BUILD
|
export CPP=$CPP_FOR_BUILD
|
||||||
export CXX=$CXX_FOR_BUILD
|
export CXX=$CXX_FOR_BUILD
|
||||||
export LD=$LD_FOR_BUILD
|
export LD=$LD_FOR_BUILD
|
||||||
|
|
||||||
export AS_FOR_TARGET=$AS
|
export AS_FOR_TARGET=${stdenvNoLibs.cc}/bin/$AS
|
||||||
export CC_FOR_TARGET=$CC
|
export CC_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CC
|
||||||
export CPP_FOR_TARGET=$CPP
|
export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP
|
||||||
export LD_FOR_TARGET=$LD
|
export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD
|
||||||
|
|
||||||
export NIX_BUILD_CFLAGS_COMPILE+=' -DGENERATOR_FILE=1'
|
export NIX_BUILD_CFLAGS_COMPILE+=' -DGENERATOR_FILE=1'
|
||||||
|
|
||||||
@ -81,6 +87,23 @@ stdenvNoLibs.mkDerivation rec {
|
|||||||
cd "$buildRoot/gcc/${hostPlatform.config}/libgcc"
|
cd "$buildRoot/gcc/${hostPlatform.config}/libgcc"
|
||||||
configureScript=$sourceRoot/configure
|
configureScript=$sourceRoot/configure
|
||||||
chmod +x "$configureScript"
|
chmod +x "$configureScript"
|
||||||
|
|
||||||
|
export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD
|
||||||
|
export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD
|
||||||
|
export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD
|
||||||
|
export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD
|
||||||
|
export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD
|
||||||
|
|
||||||
|
export AS=${stdenvNoLibs.cc}/bin/$AS
|
||||||
|
export CC=${stdenvNoLibs.cc}/bin/$CC
|
||||||
|
export CPP=${stdenvNoLibs.cc}/bin/$CPP
|
||||||
|
export CXX=${stdenvNoLibs.cc}/bin/$CXX
|
||||||
|
export LD=${stdenvNoLibs.cc.bintools}/bin/$LD
|
||||||
|
|
||||||
|
export AS_FOR_TARGET=${stdenvNoLibs.cc}/bin/$AS_FOR_TARGET
|
||||||
|
export CC_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CC_FOR_TARGET
|
||||||
|
export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP_FOR_TARGET
|
||||||
|
export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD_FOR_TARGET
|
||||||
'';
|
'';
|
||||||
|
|
||||||
gccConfigureFlags = [
|
gccConfigureFlags = [
|
||||||
|
Loading…
Reference in New Issue
Block a user