gcc: s_crossStageStatic_withoutTargetLibc_

This commit renames the `crossStageStatic` argument to the `gcc`
expression to `withoutTargetLibc`.  See previous commit for details.
This commit is contained in:
Adam Joseph 2023-06-16 14:45:50 -07:00
parent 2affd455a4
commit 443dfc4b05
17 changed files with 73 additions and 75 deletions

View File

@ -22,7 +22,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -69,7 +69,7 @@ let majorVersion = "10";
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (buildPlatform.system == "aarch64-darwin" && targetPlatform != buildPlatform) (fetchpatch {
url = "https://raw.githubusercontent.com/richard-vd/musl-cross-make/5e9e87f06fc3220e102c29d3413fbbffa456fcd6/patches/gcc-${version}/0008-darwin-aarch64-self-host-driver.patch";
@ -78,7 +78,7 @@ let majorVersion = "10";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -99,7 +99,7 @@ let majorVersion = "10";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -214,7 +214,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -295,5 +295,5 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -22,7 +22,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -82,14 +82,14 @@ let majorVersion = "11";
++ optional (stdenv.isDarwin && targetPlatform.isAvr) ./avr-gcc-11.3-darwin.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
# openjdk build fails without this on -march=opteron; is upstream in gcc12
++ [ ./gcc-issue-103910.patch ];
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -110,7 +110,7 @@ let majorVersion = "11";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -227,7 +227,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -307,6 +307,6 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
(callPackage ../common/checksum.nix { inherit langC langCC; })
]

View File

@ -23,7 +23,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -127,11 +127,11 @@ let majorVersion = "12";
++ optional (stdenv.isDarwin && langAda) ../gnat-darwin-dylib-install-name.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch;
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch;
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -152,7 +152,7 @@ let majorVersion = "12";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
disableBootstrap
disableGdbPlugin
enableLTO
@ -271,7 +271,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;
@ -353,7 +353,7 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
(callPackage ../common/checksum.nix { inherit langC langCC; })
]

View File

@ -23,7 +23,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -125,7 +125,7 @@ let majorVersion = "13";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -146,7 +146,7 @@ let majorVersion = "13";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
disableBootstrap
disableGdbPlugin
enableLTO
@ -265,7 +265,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;
@ -347,7 +347,7 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
(callPackage ../common/checksum.nix { inherit langC langCC; })
]

View File

@ -26,7 +26,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, buildPackages
, callPackage
@ -109,7 +109,7 @@ let majorVersion = "4";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -135,7 +135,7 @@ let majorVersion = "4";
boehmgc
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -232,7 +232,7 @@ lib.pipe (stdenv.mkDerivation ({
''
else null;
inherit noSysDirs staticCompiler langJava crossStageStatic
inherit noSysDirs staticCompiler langJava withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -323,5 +323,5 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -26,7 +26,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, buildPackages
, callPackage
@ -126,7 +126,7 @@ let majorVersion = "4";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -152,7 +152,7 @@ let majorVersion = "4";
boehmgc
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -253,7 +253,7 @@ lib.pipe (stdenv.mkDerivation ({
''
else null;
inherit noSysDirs staticCompiler langJava crossStageStatic
inherit noSysDirs staticCompiler langJava withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -350,5 +350,5 @@ lib.pipe (stdenv.mkDerivation ({
'';}
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -29,7 +29,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -78,7 +78,7 @@ let majorVersion = "6";
++ optional langGo ./gogcc-workaround-glibc-2.36.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (targetPlatform.libc == "musl" && targetPlatform.isx86_32) (fetchpatch {
url = "https://git.alpinelinux.org/aports/plain/main/gcc/gcc-6.1-musl-libssp.patch?id=5e4b96e23871ee28ef593b439f8c07ca7c7eb5bb";
sha256 = "1jf1ciz4gr49lwyh8knfhw6l5gvfkwzjy90m7qiwkcbsf4a3fqn2";
@ -111,7 +111,7 @@ let majorVersion = "6";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -137,7 +137,7 @@ let majorVersion = "6";
boehmgc
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -269,7 +269,7 @@ lib.pipe (stdenv.mkDerivation ({
))
);
inherit noSysDirs staticCompiler langJava crossStageStatic
inherit noSysDirs staticCompiler langJava withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -368,5 +368,5 @@ lib.pipe (stdenv.mkDerivation ({
'';}
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -19,7 +19,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -81,13 +81,13 @@ let majorVersion = "7";
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ [ ../libsanitizer-no-cyclades-9.patch ];
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -108,7 +108,7 @@ let majorVersion = "7";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -218,7 +218,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -302,5 +302,5 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -19,7 +19,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -63,12 +63,12 @@ let majorVersion = "8";
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ [ ../libsanitizer-no-cyclades-9.patch ];
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -89,7 +89,7 @@ let majorVersion = "8";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -199,7 +199,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -277,5 +277,5 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
))
[
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -22,7 +22,7 @@
, name ? "gcc"
, libcCross ? null
, threadsCross ? null # for MinGW
, crossStageStatic ? false
, withoutTargetLibc ? false
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
@ -74,12 +74,12 @@ let majorVersion = "9";
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
++ optional (!withoutTargetLibc && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch
;
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final";
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
callFile = lib.callPackageWith {
@ -100,7 +100,7 @@ let majorVersion = "9";
binutils
buildPackages
cloog
crossStageStatic
withoutTargetLibc
enableLTO
enableMultilib
enablePlugin
@ -213,7 +213,7 @@ lib.pipe (stdenv.mkDerivation ({
)
'';
inherit noSysDirs staticCompiler crossStageStatic
inherit noSysDirs staticCompiler withoutTargetLibc
libcCross crossMingw;
inherit (callFile ../common/dependencies.nix { })
@ -292,5 +292,5 @@ lib.pipe (stdenv.mkDerivation ({
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)
) [
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform enableShared crossStageStatic; })
(callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
]

View File

@ -135,7 +135,7 @@ if test "$noSysDirs" = "1"; then
)
fi
if test "$crossStageStatic" == 1; then
if test "$withoutTargetLibc" == 1; then
# We don't want the gcc build to assume there will be a libc providing
# limits.h in this stage
makeFlagsArray+=(
@ -167,7 +167,7 @@ preConfigure() {
rm -Rf zlib
fi
if test -n "$crossMingw" -a -n "$crossStageStatic"; then
if test -n "$crossMingw" -a -n "$withoutTargetLibc"; then
mkdir -p ../mingw
# --with-build-sysroot expects that:
cp -R $libcCross/include ../mingw

View File

@ -1,7 +1,7 @@
{ lib, stdenv
, targetPackages
, crossStageStatic, libcCross
, withoutTargetLibc, libcCross
, threadsCross
, version
@ -59,7 +59,7 @@ let
"--with-as=${if targetPackages.stdenv.cc.bintools.isLLVM then binutils else targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld"
]
++ (if crossStageStatic then [
++ (if withoutTargetLibc then [
"--disable-libssp"
"--disable-nls"
"--without-headers"
@ -111,7 +111,7 @@ let
"--with-mpfr-lib=${mpfr.out}/lib"
"--with-mpc=${libmpc}"
]
++ lib.optionals (!crossStageStatic) [
++ lib.optionals (!withoutTargetLibc) [
(if libcCross == null
then "--with-native-system-header-dir=${lib.getDev stdenv.cc.libc}/include"
else "--with-native-system-header-dir=${lib.getDev libcCross}${libcCross.incdir or "/include"}")

View File

@ -30,7 +30,7 @@
, javaAwtGtk ? false
, langAda ? false
, langGo ? false
, crossStageStatic ? null
, withoutTargetLibc ? null
, threadsCross ? null
}:
@ -88,5 +88,5 @@ in
;
# threadsCross.package after gcc6 so i assume its okay for 4.8 and 4.9 too
depsTargetTarget = optionals (!crossStageStatic && threadsCross != { } && threadsCross.package != null) [ threadsCross.package ];
depsTargetTarget = optionals (!withoutTargetLibc && threadsCross != { } && threadsCross.package != null) [ threadsCross.package ];
}

View File

@ -1,4 +1,4 @@
{ lib, stdenv, crossStageStatic, langD ? false, libcCross, threadsCross }:
{ lib, stdenv, withoutTargetLibc, langD ? false, libcCross, threadsCross }:
let
inherit (stdenv) hostPlatform targetPlatform;
@ -11,23 +11,23 @@ in
EXTRA_FLAGS_FOR_TARGET = let
mkFlags = dep: langD: lib.optionals (targetPlatform != hostPlatform && dep != null && !langD) ([
"-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
] ++ lib.optionals (! crossStageStatic) [
] ++ lib.optionals (! withoutTargetLibc) [
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
]);
in mkFlags libcCross langD
++ lib.optionals (!crossStageStatic) (mkFlags (threadsCross.package or null) langD)
++ lib.optionals (!withoutTargetLibc) (mkFlags (threadsCross.package or null) langD)
;
EXTRA_LDFLAGS_FOR_TARGET = let
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
"-Wl,-L${lib.getLib dep}${dep.libdir or "/lib"}"
] ++ (if crossStageStatic then [
] ++ (if withoutTargetLibc then [
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
] else [
"-Wl,-rpath,${lib.getLib dep}${dep.libdir or "/lib"}"
"-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}"
]));
in mkFlags libcCross
++ lib.optionals (!crossStageStatic) (mkFlags (threadsCross.package or null))
++ lib.optionals (!withoutTargetLibc) (mkFlags (threadsCross.package or null))
;
}

View File

@ -6,8 +6,7 @@
, langJit
, targetPlatform
, hostPlatform
, crossStageStatic
, enableShared
, withoutTargetLibc
}:
assert !stdenv.targetPlatform.hasSharedLibraries -> !enableShared;
@ -20,7 +19,7 @@ drv: lib.pipe drv
lib.optionalAttrs (
targetPlatform != hostPlatform &&
targetPlatform.libc == "msvcrt" &&
crossStageStatic
withoutTargetLibc
) {
makeFlags = [ "all-gcc" "all-target-libgcc" ];
installTargets = "install-gcc install-target-libgcc";

View File

@ -108,7 +108,7 @@ in lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
# gcc->clang "cross"-compilation manages to evade it: there
# hostPlatform != targetPlatform, hostPlatform.config == targetPlatform.config.
# We explicitly inhibit libc headers use in this case as well.
+ lib.optionalString (targetPlatform != hostPlatform && crossStageStatic) ''
+ lib.optionalString (targetPlatform != hostPlatform && withoutTargetLibc) ''
export inhibit_libc=true
''

View File

@ -15287,8 +15287,7 @@ with pkgs;
isl = if !stdenv.isDarwin then isl_0_20 else null;
# just for stage static
crossStageStatic = true;
withoutTargetLibc = true;
langCC = false;
libcCross = libcCross1;
targetPackages.stdenv.cc.bintools = binutilsNoLibc;