Skip to content

Commit

Permalink
Merge pull request #225220 from amjoseph-nixpkgs/pr/gfortran/do-not-d…
Browse files Browse the repository at this point in the history
…isable-bootstrap
  • Loading branch information
Artturin authored Apr 11, 2023

Unverified

The committer email address is not verified.
2 parents 6bd147a + de8ce81 commit a2da3d6
Showing 6 changed files with 10 additions and 24 deletions.
3 changes: 1 addition & 2 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
, buildPackages ? {}
, libcxx ? null
, grossHackForStagingNext ? false

# Whether or not to add `-B` and `-L` to `nix-support/cc-{c,ld}flags`
, useCcForLibs ?
@@ -412,7 +411,7 @@ stdenv.mkDerivation {
# already knows how to find its own libstdc++, and adding
# additional -isystem flags will confuse gfortran (see
# https://github.com/NixOS/nixpkgs/pull/209870#issuecomment-1500550903)
+ optionalString (libcxx == null && (if grossHackForStagingNext then isClang else true) && (useGccForLibs && gccForLibs.langCC or false)) ''
+ optionalString (libcxx == null && isClang && (useGccForLibs && gccForLibs.langCC or false)) ''
for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/12/default.nix
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@
, buildPackages
, libxcrypt
, disableGdbPlugin ? !enablePlugin
, disableBootstrap ? !stdenv.hostPlatform.isDarwin
, nukeReferences
, callPackage
}:
@@ -57,6 +56,7 @@ with builtins;

let majorVersion = "12";
version = "${majorVersion}.2.0";
disableBootstrap = !stdenv.hostPlatform.isDarwin;

inherit (stdenv) buildPlatform hostPlatform targetPlatform;

5 changes: 4 additions & 1 deletion pkgs/development/compilers/gcc/common/configure-flags.nix
Original file line number Diff line number Diff line change
@@ -44,6 +44,9 @@ let
inherit (stdenv)
buildPlatform hostPlatform targetPlatform;

# See https://github.com/NixOS/nixpkgs/pull/209870#issuecomment-1500550903
disableBootstrap' = disableBootstrap && !langFortran;

crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";

@@ -217,7 +220,7 @@ let
# TODO: aarch64-darwin has clang stdenv and its arch and cpu flag values are incompatible with gcc
++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) (import ../common/platform-flags.nix { inherit (stdenv) targetPlatform; inherit lib; })
++ lib.optionals (targetPlatform != hostPlatform) crossConfigureFlags
++ lib.optional disableBootstrap "--disable-bootstrap"
++ lib.optional disableBootstrap' "--disable-bootstrap"

# Platform-specific flags
++ lib.optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/kaldi-active-grammar/fork.nix
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
, python3
, openblas
, zlib
, gfortran-tmp-noisystem
, gfortran
}:

let
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
pkg-config
python3
gfortran-tmp-noisystem
gfortran
];

buildFlags = [
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/scikit-learn/default.nix
Original file line number Diff line number Diff line change
@@ -55,9 +55,6 @@ buildPythonPackage rec {
export SKLEARN_BUILD_PARALLEL=$NIX_BUILD_CORES
'';

# TODO: a proper fix? See around PR #225220
NIX_LDFLAGS = if stdenv.cc.isGNU then "-L${stdenv.cc.cc.lib}/lib" else null;

doCheck = !stdenv.isAarch64;

disabledTests = [
17 changes: 2 additions & 15 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -14855,15 +14855,6 @@ with pkgs;
profiledCompiler = false;
});

gfortran-tmp-noisystem = wrapCCWith { grossHackForStagingNext = true; cc = (gcc.cc.override {
name = "gfortran";
langFortran = true;
langCC = false;
langC = false;
profiledCompiler = false;
disableBootstrap = false;
}); };

gfortran48 = wrapCC (gcc48.cc.override {
name = "gfortran";
langFortran = true;
@@ -15345,12 +15336,8 @@ with pkgs;
julia_16-bin = callPackage ../development/compilers/julia/1.6-bin.nix { };
julia_18-bin = callPackage ../development/compilers/julia/1.8-bin.nix { };

julia_18 = callPackage ../development/compilers/julia/1.8.nix {
gfortran = gfortran-tmp-noisystem;
};
julia_19 = callPackage ../development/compilers/julia/1.9.nix {
gfortran = gfortran-tmp-noisystem;
};
julia_18 = callPackage ../development/compilers/julia/1.8.nix { };
julia_19 = callPackage ../development/compilers/julia/1.9.nix { };

julia-lts-bin = julia_16-bin;
julia-stable-bin = julia_18-bin;

0 comments on commit a2da3d6

Please sign in to comment.