Skip to content

Commit

Permalink
julia{18,19,}: fix build by a temporary hack
Browse files Browse the repository at this point in the history
This is a low-rebuild version of PR #225273
/cc the proper and hopefully complete fix in PR #225220
  • Loading branch information
vcunat committed Apr 10, 2023
1 parent 995e750 commit e269122
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
7 changes: 6 additions & 1 deletion pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
, 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 ?
Expand Down Expand Up @@ -407,7 +408,11 @@ stdenv.mkDerivation {
touch "$out/nix-support/libcxx-cxxflags"
touch "$out/nix-support/libcxx-ldflags"
''
+ optionalString (libcxx == null && (useGccForLibs && gccForLibs.langCC or false)) ''
# Adding -isystem flags should be done only for clang; gcc
# 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)) ''
for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
, buildPackages
, libxcrypt
, disableGdbPlugin ? !enablePlugin
, disableBootstrap ? !stdenv.hostPlatform.isDarwin
, nukeReferences
, callPackage
}:
Expand Down Expand Up @@ -56,7 +57,6 @@ with builtins;

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

inherit (stdenv) buildPlatform hostPlatform targetPlatform;

Expand Down
17 changes: 15 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14846,6 +14846,15 @@ 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;
Expand Down Expand Up @@ -15327,8 +15336,12 @@ 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 { };
julia_19 = callPackage ../development/compilers/julia/1.9.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-lts-bin = julia_16-bin;
julia-stable-bin = julia_18-bin;
Expand Down

0 comments on commit e269122

Please sign in to comment.