wrapCC, wrapBintools: don't alias stdenvNoCC to stdenv
In delicate code like this, it seems unwise to pass something of as something it isn't for convenience's (?) sake. It causes a slight possibility for confusion with `buildPackages.stdenv`. However, it should be possible to eliminate the need for this in a separate change.
This commit is contained in:
parent
0198f43efb
commit
4aa9e4ecc6
@ -83,8 +83,7 @@ let
|
||||
replaceStrings
|
||||
;
|
||||
|
||||
stdenv = stdenvNoCC;
|
||||
inherit (stdenv) hostPlatform targetPlatform;
|
||||
inherit (stdenvNoCC) hostPlatform targetPlatform;
|
||||
|
||||
# Prefix for binaries. Customarily ends with a dash separator.
|
||||
#
|
||||
@ -138,7 +137,7 @@ let
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = targetPrefix
|
||||
+ (if name != "" then name else "${bintoolsName}-wrapper");
|
||||
version = optionalString (bintools != null) bintoolsVersion;
|
||||
@ -346,7 +345,7 @@ stdenv.mkDerivation {
|
||||
done
|
||||
''
|
||||
|
||||
+ optionalString stdenv.targetPlatform.isDarwin ''
|
||||
+ optionalString stdenvNoCC.targetPlatform.isDarwin ''
|
||||
echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/libc-ldflags
|
||||
''
|
||||
|
||||
@ -363,7 +362,7 @@ stdenv.mkDerivation {
|
||||
###
|
||||
### Remove certain timestamps from final binaries
|
||||
###
|
||||
+ optionalString (stdenv.targetPlatform.isDarwin && !(bintools.isGNU or false)) ''
|
||||
+ optionalString (stdenvNoCC.targetPlatform.isDarwin && !(bintools.isGNU or false)) ''
|
||||
echo "export ZERO_AR_DATE=1" >> $out/nix-support/setup-hook
|
||||
''
|
||||
|
||||
@ -380,9 +379,9 @@ stdenv.mkDerivation {
|
||||
###
|
||||
### Ensure consistent LC_VERSION_MIN_MACOSX
|
||||
###
|
||||
+ optionalString stdenv.targetPlatform.isDarwin (
|
||||
+ optionalString stdenvNoCC.targetPlatform.isDarwin (
|
||||
let
|
||||
inherit (stdenv.targetPlatform)
|
||||
inherit (stdenvNoCC.targetPlatform)
|
||||
darwinPlatform darwinSdkVersion
|
||||
darwinMinVersion darwinMinVersionVariable;
|
||||
in ''
|
||||
|
@ -82,9 +82,7 @@ let
|
||||
versionAtLeast
|
||||
;
|
||||
|
||||
inherit (stdenv) hostPlatform targetPlatform;
|
||||
|
||||
stdenv = stdenvNoCC;
|
||||
inherit (stdenvNoCC) hostPlatform targetPlatform;
|
||||
|
||||
includeFortifyHeaders' = if includeFortifyHeaders != null
|
||||
then includeFortifyHeaders
|
||||
@ -119,10 +117,10 @@ let
|
||||
|
||||
useGccForLibs = useCcForLibs
|
||||
&& libcxx == null
|
||||
&& !stdenv.targetPlatform.isDarwin
|
||||
&& !(stdenv.targetPlatform.useLLVM or false)
|
||||
&& !(stdenv.targetPlatform.useAndroidPrebuilt or false)
|
||||
&& !(stdenv.targetPlatform.isiOS or false)
|
||||
&& !stdenvNoCC.targetPlatform.isDarwin
|
||||
&& !(stdenvNoCC.targetPlatform.useLLVM or false)
|
||||
&& !(stdenvNoCC.targetPlatform.useAndroidPrebuilt or false)
|
||||
&& !(stdenvNoCC.targetPlatform.isiOS or false)
|
||||
&& gccForLibs != null;
|
||||
gccForLibs_solib = getLib gccForLibs
|
||||
+ optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}";
|
||||
@ -249,17 +247,17 @@ let
|
||||
then cc.hardeningUnsupportedFlagsByTargetPlatform targetPlatform
|
||||
else (cc.hardeningUnsupportedFlags or []);
|
||||
|
||||
darwinPlatformForCC = optionalString stdenv.targetPlatform.isDarwin (
|
||||
darwinPlatformForCC = optionalString stdenvNoCC.targetPlatform.isDarwin (
|
||||
if (targetPlatform.darwinPlatform == "macos" && isGNU) then "macosx"
|
||||
else targetPlatform.darwinPlatform
|
||||
);
|
||||
|
||||
darwinMinVersion = optionalString stdenv.targetPlatform.isDarwin (
|
||||
stdenv.targetPlatform.darwinMinVersion
|
||||
darwinMinVersion = optionalString stdenvNoCC.targetPlatform.isDarwin (
|
||||
stdenvNoCC.targetPlatform.darwinMinVersion
|
||||
);
|
||||
|
||||
darwinMinVersionVariable = optionalString stdenv.targetPlatform.isDarwin
|
||||
stdenv.targetPlatform.darwinMinVersionVariable;
|
||||
darwinMinVersionVariable = optionalString stdenvNoCC.targetPlatform.isDarwin
|
||||
stdenvNoCC.targetPlatform.darwinMinVersionVariable;
|
||||
in
|
||||
|
||||
assert includeFortifyHeaders' -> fortify-headers != null;
|
||||
@ -272,7 +270,7 @@ assert nativeTools == bintools.nativeTools;
|
||||
assert nativeLibc == bintools.nativeLibc;
|
||||
assert nativePrefix == bintools.nativePrefix;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = targetPrefix
|
||||
+ (if name != "" then name else "${ccName}-wrapper");
|
||||
version = optionalString (cc != null) ccVersion;
|
||||
@ -426,7 +424,7 @@ stdenv.mkDerivation {
|
||||
../setup-hooks/role.bash
|
||||
] ++ optional (cc.langC or true) ./setup-hook.sh
|
||||
++ optional (cc.langFortran or false) ./fortran-hook.sh
|
||||
++ optional (targetPlatform.isWindows) (stdenv.mkDerivation {
|
||||
++ optional (targetPlatform.isWindows) (stdenvNoCC.mkDerivation {
|
||||
name = "win-dll-hook.sh";
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
@ -479,8 +477,8 @@ stdenv.mkDerivation {
|
||||
# break `useLLVM` into.)
|
||||
+ optionalString (isClang
|
||||
&& targetPlatform.isLinux
|
||||
&& !(stdenv.targetPlatform.useAndroidPrebuilt or false)
|
||||
&& !(stdenv.targetPlatform.useLLVM or false)
|
||||
&& !(stdenvNoCC.targetPlatform.useAndroidPrebuilt or false)
|
||||
&& !(stdenvNoCC.targetPlatform.useLLVM or false)
|
||||
&& gccForLibs != null) (''
|
||||
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||
|
||||
@ -689,7 +687,7 @@ stdenv.mkDerivation {
|
||||
done
|
||||
''
|
||||
|
||||
+ optionalString stdenv.targetPlatform.isDarwin ''
|
||||
+ optionalString stdenvNoCC.targetPlatform.isDarwin ''
|
||||
echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/cc-cflags
|
||||
''
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user