Merge pull request #28998 from LnL7/libstdcxx-hook
libstdc++: add setup-hook
This commit is contained in:
commit
0adb83e2a2
2
pkgs/development/compilers/gcc/libstdc++-hook.sh
Normal file
2
pkgs/development/compilers/gcc/libstdc++-hook.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export NIX_CXXSTDLIB_COMPILE+="-isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/$(@gcc@/bin/gcc -dumpmachine)"
|
||||||
|
export NIX_CXXSTDLIB_LINK=" -stdlib=libstdc++"
|
@ -1,4 +1,8 @@
|
|||||||
{ lowPrio, newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
|
{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
|
||||||
|
, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
|
||||||
|
, darwin
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
|
callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
|
||||||
|
|
||||||
@ -46,7 +50,12 @@ let
|
|||||||
extraPackages = [ self.libcxx self.libcxxabi ];
|
extraPackages = [ self.libcxx self.libcxxabi ];
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenv = overrideCC stdenv self.clang;
|
stdenv = stdenv.override (drv: {
|
||||||
|
allowedRequisites = null;
|
||||||
|
cc = self.clang;
|
||||||
|
# Use the gcc libstdc++ when targeting linux.
|
||||||
|
extraBuildInputs = if stdenv.cc.isGNU then [ libstdcxxHook ] else drv.extraBuildInputs;
|
||||||
|
});
|
||||||
|
|
||||||
libcxxStdenv = overrideCC stdenv self.libcxxClang;
|
libcxxStdenv = overrideCC stdenv self.libcxxClang;
|
||||||
|
|
||||||
@ -58,4 +67,5 @@ let
|
|||||||
|
|
||||||
libcxxabi = callPackage ./libc++abi.nix {};
|
libcxxabi = callPackage ./libc++abi.nix {};
|
||||||
};
|
};
|
||||||
|
|
||||||
in self
|
in self
|
||||||
|
@ -5360,6 +5360,10 @@ with pkgs;
|
|||||||
|
|
||||||
gccApple = throw "gccApple is no longer supported";
|
gccApple = throw "gccApple is no longer supported";
|
||||||
|
|
||||||
|
libstdcxxHook = makeSetupHook
|
||||||
|
{ substitutions = { gcc = gcc-unwrapped; }; }
|
||||||
|
../development/compilers/gcc/libstdc++-hook.sh;
|
||||||
|
|
||||||
# Can't just overrideCC, because then the stdenv-cross mkDerivation will be
|
# Can't just overrideCC, because then the stdenv-cross mkDerivation will be
|
||||||
# thrown away. TODO: find a better solution for this.
|
# thrown away. TODO: find a better solution for this.
|
||||||
crossLibcStdenv = buildPackages.makeStdenvCross {
|
crossLibcStdenv = buildPackages.makeStdenvCross {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user