Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

threadsCross: factor out copy-and-pasted code #243394

Merged
1 commit merged into from Jul 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 18 additions & 24 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15404,7 +15404,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "4.8" else { };

isl = if !stdenv.isDarwin then isl_0_14 else null;
cloog = if !stdenv.isDarwin then cloog else null;
Expand All @@ -15418,7 +15418,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "4.9" else { };

isl = if !stdenv.isDarwin then isl_0_11 else null;

Expand All @@ -15435,7 +15435,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "6" else { };

# gcc 10 is too strict to cross compile gcc <= 8
stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv;
Expand All @@ -15454,7 +15454,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "7" else { };

# gcc 10 is too strict to cross compile gcc <= 8
stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv;
Expand All @@ -15469,7 +15469,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "8" else { };

# gcc 10 is too strict to cross compile gcc <= 8
stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv;
Expand All @@ -15484,7 +15484,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "9" else { };

isl = if !stdenv.isDarwin then isl_0_20 else null;
}));
Expand All @@ -15496,7 +15496,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "10" else { };

isl = if !stdenv.isDarwin then isl_0_20 else null;
}));
Expand All @@ -15508,7 +15508,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "11" else { };

isl = if !stdenv.isDarwin then isl_0_20 else null;
}));
Expand All @@ -15520,7 +15520,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "12" else { };

isl = if !stdenv.isDarwin then isl_0_20 else null;
}));
Expand All @@ -15532,7 +15532,7 @@ with pkgs;
profiledCompiler = false;

libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { };
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCrossFor "13" else { };

isl = if !stdenv.isDarwin then isl_0_20 else null;
}));
Expand Down Expand Up @@ -17140,10 +17140,7 @@ with pkgs;
# want the C++ library to be explicitly chosen by the caller, and null by
# default.
libcxx ? null
, extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW)
(if lib.versionAtLeast cc.version "13"
then threadsCross.package
else threadsCross_pre_gcc_13.package)
, extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) ((threadsCrossFor cc.version).package)
, nixSupport ? {}
, ...
} @ extraArgs:
Expand Down Expand Up @@ -21173,20 +21170,17 @@ with pkgs;

libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc;

threadsCross_pre_gcc_13 = if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false)
threadsCross = threadsCrossFor null;
threadsCrossFor = cc_version:
if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false)
then {
# other possible values: win32 or posix
model = "mcf";
# For win32 or posix set this to null
package = targetPackages.windows.mcfgthreads_pre_gcc_13 or windows.mcfgthreads_pre_gcc_13;
} else { };

threadsCross = if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false)
then {
# other possible values: win32 or posix
model = "mcf";
# For win32 or posix set this to null
package = targetPackages.windows.mcfgthreads or windows.mcfgthreads;
package =
if cc_version == null || lib.versionAtLeast cc_version "13"
then targetPackages.windows.mcfgthreads or windows.mcfgthreads
else targetPackages.windows.mcfgthreads_pre_gcc_13 or windows.mcfgthreads_pre_gcc_13;
} else { };

wasilibc = callPackage ../development/libraries/wasilibc {
Expand Down