Merge pull request #91293 from Ericson2314/cxx-wrapper-debt-part-2
treewide: Get rid of `cc.gcc`
This commit is contained in:
commit
b5f7ed6846
@ -8,6 +8,7 @@
|
|||||||
{ name ? ""
|
{ name ? ""
|
||||||
, stdenvNoCC
|
, stdenvNoCC
|
||||||
, cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell
|
, cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell
|
||||||
|
, gccForLibs ? null
|
||||||
, zlib ? null
|
, zlib ? null
|
||||||
, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
|
, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
|
||||||
, propagateDoc ? cc != null && cc ? man
|
, propagateDoc ? cc != null && cc ? man
|
||||||
@ -262,11 +263,11 @@ stdenv.mkDerivation {
|
|||||||
##
|
##
|
||||||
## GCC libs for non-GCC support
|
## GCC libs for non-GCC support
|
||||||
##
|
##
|
||||||
+ optionalString (isClang && libcxx == null && cc ? gcc) ''
|
+ optionalString (isClang && libcxx == null && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs != null) ''
|
||||||
|
|
||||||
echo "-B${cc.gcc}/lib/gcc/${targetPlatform.config}/${cc.gcc.version}" >> $out/nix-support/cc-cflags
|
echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags
|
||||||
echo "-L${cc.gcc}/lib/gcc/${targetPlatform.config}/${cc.gcc.version}" >> $out/nix-support/cc-ldflags
|
echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags
|
||||||
echo "-L${cc.gcc.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags
|
echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags
|
||||||
''
|
''
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -306,14 +307,15 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
# We have a libc++ directly, we have one via "smuggled" GCC, or we have one
|
# We have a libc++ directly, we have one via "smuggled" GCC, or we have one
|
||||||
# bundled with the C compiler because it is GCC
|
# bundled with the C compiler because it is GCC
|
||||||
+ optionalString (libcxx != null || cc.gcc.langCC or false || (isGNU && cc.langCC or false)) ''
|
+ optionalString (libcxx != null || (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false) || (isGNU && cc.langCC or false)) ''
|
||||||
touch "$out/nix-support/libcxx-cxxflags"
|
touch "$out/nix-support/libcxx-cxxflags"
|
||||||
touch "$out/nix-support/libcxx-ldflags"
|
touch "$out/nix-support/libcxx-ldflags"
|
||||||
'' + optionalString (libcxx == null && cc ? gcc) ''
|
''
|
||||||
for dir in ${cc.gcc}/include/c++/*; do
|
+ optionalString (libcxx == null && (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false)) ''
|
||||||
|
for dir in ${gccForLibs}/include/c++/*; do
|
||||||
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
||||||
done
|
done
|
||||||
for dir in ${cc.gcc}/include/c++/*/${targetPlatform.config}; do
|
for dir in ${gccForLibs}/include/c++/*/${targetPlatform.config}; do
|
||||||
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
|
@ -37,8 +37,6 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
|
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
|
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, gccForLibs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
rev = emscriptenVersion;
|
rev = emscriptenVersion;
|
||||||
haveGcc = stdenv.cc.isGNU || stdenv.cc.cc ? gcc;
|
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "emscripten-fastcomp-${rev}";
|
name = "emscripten-fastcomp-${rev}";
|
||||||
@ -35,16 +33,14 @@ stdenv.mkDerivation rec {
|
|||||||
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
|
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
|
||||||
"-DLLVM_BUILD_TESTS=ON"
|
"-DLLVM_BUILD_TESTS=ON"
|
||||||
"-DCLANG_INCLUDE_TESTS=ON"
|
"-DCLANG_INCLUDE_TESTS=ON"
|
||||||
] ++ (stdenv.lib.optional (stdenv.isLinux && haveGcc)
|
] ++ (stdenv.lib.optional stdenv.isLinux
|
||||||
# necessary for clang to find crtend.o
|
# necessary for clang to find crtend.o
|
||||||
"-DGCC_INSTALL_PREFIX=${gcc}"
|
"-DGCC_INSTALL_PREFIX=${gccForLibs}"
|
||||||
);
|
);
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
} // stdenv.lib.optionalAttrs haveGcc {
|
|
||||||
inherit gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -87,8 +87,6 @@ let
|
|||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
inherit llvm;
|
inherit llvm;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
|
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ lowPrio, newScope, pkgs, stdenv, cmake
|
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
|
||||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
||||||
|
, buildPackages
|
||||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||||
}:
|
}:
|
||||||
@ -24,8 +25,8 @@ let
|
|||||||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
||||||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ let
|
|||||||
|
|
||||||
libstdcxxClang = wrapCCWith rec {
|
libstdcxxClang = wrapCCWith rec {
|
||||||
cc = tools.clang-unwrapped;
|
cc = tools.clang-unwrapped;
|
||||||
libcxx = null; # libstdcxx is smuggled in with clang.gcc
|
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
|
||||||
|
libcxx = null;
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
targetLlvmLibraries.compiler-rt
|
targetLlvmLibraries.compiler-rt
|
||||||
];
|
];
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
self = stdenv.mkDerivation ({
|
self = stdenv.mkDerivation ({
|
||||||
pname = "clang";
|
pname = "clang";
|
||||||
inherit version;
|
inherit version;
|
||||||
@ -78,8 +77,6 @@ let
|
|||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
inherit llvm;
|
inherit llvm;
|
||||||
} // stdenv.lib.optionalAttrs stdenv.isLinux {
|
|
||||||
inherit gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ lowPrio, newScope, pkgs, stdenv, cmake
|
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
|
||||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
|
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
|
||||||
|
, buildPackages
|
||||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||||
}:
|
}:
|
||||||
@ -24,8 +25,8 @@ let
|
|||||||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
||||||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -51,7 +52,8 @@ let
|
|||||||
|
|
||||||
libstdcxxClang = wrapCCWith rec {
|
libstdcxxClang = wrapCCWith rec {
|
||||||
cc = tools.clang-unwrapped;
|
cc = tools.clang-unwrapped;
|
||||||
libcxx = null; # libstdcxx is smuggled in with clang.gcc
|
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
|
||||||
|
libcxx = null;
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
targetLlvmLibraries.compiler-rt
|
targetLlvmLibraries.compiler-rt
|
||||||
];
|
];
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
self = stdenv.mkDerivation ({
|
self = stdenv.mkDerivation ({
|
||||||
pname = "clang";
|
pname = "clang";
|
||||||
inherit version;
|
inherit version;
|
||||||
@ -78,8 +77,6 @@ let
|
|||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
inherit llvm;
|
inherit llvm;
|
||||||
} // stdenv.lib.optionalAttrs stdenv.targetPlatform.isLinux {
|
|
||||||
inherit gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ lowPrio, newScope, pkgs, stdenv, cmake
|
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
|
||||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
|
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
|
||||||
|
, buildPackages
|
||||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||||
}:
|
}:
|
||||||
@ -24,8 +25,8 @@ let
|
|||||||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
||||||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -51,7 +52,8 @@ let
|
|||||||
|
|
||||||
libstdcxxClang = wrapCCWith rec {
|
libstdcxxClang = wrapCCWith rec {
|
||||||
cc = tools.clang-unwrapped;
|
cc = tools.clang-unwrapped;
|
||||||
libcxx = null; # libstdcxx is smuggled in with clang.gcc
|
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
|
||||||
|
libcxx = null;
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
targetLlvmLibraries.compiler-rt
|
targetLlvmLibraries.compiler-rt
|
||||||
];
|
];
|
||||||
|
@ -88,8 +88,6 @@ let
|
|||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
inherit llvm;
|
inherit llvm;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
|
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ lowPrio, newScope, pkgs, stdenv, cmake
|
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
|
||||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
||||||
|
, buildPackages
|
||||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||||
}:
|
}:
|
||||||
@ -24,8 +25,8 @@ let
|
|||||||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
||||||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -58,7 +59,8 @@ let
|
|||||||
|
|
||||||
libstdcxxClang = wrapCCWith rec {
|
libstdcxxClang = wrapCCWith rec {
|
||||||
cc = tools.clang-unwrapped;
|
cc = tools.clang-unwrapped;
|
||||||
libcxx = null; # libstdcxx is smuggled in with clang.gcc
|
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
|
||||||
|
libcxx = null;
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
targetLlvmLibraries.compiler-rt
|
targetLlvmLibraries.compiler-rt
|
||||||
];
|
];
|
||||||
|
@ -98,8 +98,6 @@ let
|
|||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
inherit llvm;
|
inherit llvm;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
|
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ lowPrio, newScope, pkgs, stdenv, cmake
|
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
|
||||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
||||||
|
, buildPackages
|
||||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||||
}:
|
}:
|
||||||
@ -24,8 +25,8 @@ let
|
|||||||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
||||||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ let
|
|||||||
|
|
||||||
libstdcxxClang = wrapCCWith rec {
|
libstdcxxClang = wrapCCWith rec {
|
||||||
cc = tools.clang-unwrapped;
|
cc = tools.clang-unwrapped;
|
||||||
libcxx = null; # libstdcxx is smuggled in with clang.gcc
|
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
|
||||||
|
libcxx = null;
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
targetLlvmLibraries.compiler-rt
|
targetLlvmLibraries.compiler-rt
|
||||||
];
|
];
|
||||||
|
@ -93,8 +93,6 @@ let
|
|||||||
passthru = {
|
passthru = {
|
||||||
isClang = true;
|
isClang = true;
|
||||||
inherit llvm;
|
inherit llvm;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
|
|
||||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ lowPrio, newScope, pkgs, stdenv, cmake
|
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
|
||||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
|
||||||
|
, buildPackages
|
||||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||||
}:
|
}:
|
||||||
@ -24,8 +25,8 @@ let
|
|||||||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
|
||||||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ let
|
|||||||
|
|
||||||
libstdcxxClang = wrapCCWith rec {
|
libstdcxxClang = wrapCCWith rec {
|
||||||
cc = tools.clang-unwrapped;
|
cc = tools.clang-unwrapped;
|
||||||
libcxx = null; # libstdcxx is smuggled in with clang.gcc
|
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
|
||||||
|
libcxx = null;
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
targetLlvmLibraries.compiler-rt
|
targetLlvmLibraries.compiler-rt
|
||||||
];
|
];
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, cmake
|
, cmake
|
||||||
, coreutils
|
, coreutils
|
||||||
, glibc
|
, glibc
|
||||||
|
, gccForLibs
|
||||||
, which
|
, which
|
||||||
, perl
|
, perl
|
||||||
, libedit
|
, libedit
|
||||||
@ -121,7 +122,7 @@ let
|
|||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DGLIBC_INCLUDE_PATH=${stdenv.cc.libc.dev}/include"
|
"-DGLIBC_INCLUDE_PATH=${stdenv.cc.libc.dev}/include"
|
||||||
"-DC_INCLUDE_DIRS=${stdenv.lib.makeSearchPathOutput "dev" "include" devInputs}:${libxml2.dev}/include/libxml2"
|
"-DC_INCLUDE_DIRS=${stdenv.lib.makeSearchPathOutput "dev" "include" devInputs}:${libxml2.dev}/include/libxml2"
|
||||||
"-DGCC_INSTALL_PREFIX=${clang.cc.gcc}"
|
"-DGCC_INSTALL_PREFIX=${gccForLibs}"
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
@ -199,7 +200,7 @@ stdenv.mkDerivation {
|
|||||||
substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \
|
substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \
|
||||||
--replace '/usr/include' "${stdenv.cc.libc.dev}/include"
|
--replace '/usr/include' "${stdenv.cc.libc.dev}/include"
|
||||||
substituteInPlace swift/utils/build-script-impl \
|
substituteInPlace swift/utils/build-script-impl \
|
||||||
--replace '/usr/include/c++' "${clang.cc.gcc}/include/c++"
|
--replace '/usr/include/c++' "${gccForLibs}/include/c++"
|
||||||
patch -p1 -d swift -i ${./patches/glibc-arch-headers.patch}
|
patch -p1 -d swift -i ${./patches/glibc-arch-headers.patch}
|
||||||
patch -p1 -d swift -i ${./patches/0001-build-presets-linux-don-t-require-using-Ninja.patch}
|
patch -p1 -d swift -i ${./patches/0001-build-presets-linux-don-t-require-using-Ninja.patch}
|
||||||
patch -p1 -d swift -i ${./patches/0002-build-presets-linux-allow-custom-install-prefix.patch}
|
patch -p1 -d swift -i ${./patches/0002-build-presets-linux-allow-custom-install-prefix.patch}
|
||||||
@ -264,7 +265,7 @@ stdenv.mkDerivation {
|
|||||||
export NIX_CFLAGS_COMPILE="$(< $NIX_CC/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
|
export NIX_CFLAGS_COMPILE="$(< $NIX_CC/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
|
||||||
# During the Swift build, a full local LLVM build is performed and the resulting clang is invoked.
|
# During the Swift build, a full local LLVM build is performed and the resulting clang is invoked.
|
||||||
# This compiler is not using the Nix wrappers, so it needs some help to find things.
|
# This compiler is not using the Nix wrappers, so it needs some help to find things.
|
||||||
export NIX_LDFLAGS_BEFORE="-rpath ${clang.cc.gcc.lib}/lib -L${clang.cc.gcc.lib}/lib $NIX_LDFLAGS_BEFORE"
|
export NIX_LDFLAGS_BEFORE="-rpath ${gccForLibs.lib}/lib -L${gccForLibs.lib}/lib $NIX_LDFLAGS_BEFORE"
|
||||||
# However, we want to use the wrapped compiler whenever possible.
|
# However, we want to use the wrapped compiler whenever possible.
|
||||||
export CC="${clang}/bin/clang"
|
export CC="${clang}/bin/clang"
|
||||||
|
|
||||||
|
@ -8314,8 +8314,8 @@ in
|
|||||||
mkdir -p "$rsrc/lib"
|
mkdir -p "$rsrc/lib"
|
||||||
ln -s "${cc}/lib" "$rsrc/include"
|
ln -s "${cc}/lib" "$rsrc/include"
|
||||||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
|
||||||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && cc ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
|
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
|
||||||
echo "--gcc-toolchain=${cc.gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -9107,55 +9107,41 @@ in
|
|||||||
|
|
||||||
llvmPackages = recurseIntoAttrs llvmPackages_7;
|
llvmPackages = recurseIntoAttrs llvmPackages_7;
|
||||||
|
|
||||||
llvmPackages_5 = callPackage ../development/compilers/llvm/5 ({
|
llvmPackages_5 = callPackage ../development/compilers/llvm/5 {
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_5.tools;
|
buildLlvmTools = buildPackages.llvmPackages_5.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_5.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_5.libraries;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) {
|
};
|
||||||
stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4'
|
|
||||||
});
|
|
||||||
|
|
||||||
llvmPackages_6 = callPackage ../development/compilers/llvm/6 ({
|
llvmPackages_6 = callPackage ../development/compilers/llvm/6 {
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_6.tools;
|
buildLlvmTools = buildPackages.llvmPackages_6.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_6.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_6.libraries;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) {
|
};
|
||||||
# with gcc-7 on i686: undefined reference to `__divmoddi4'
|
|
||||||
# Failing tests with gcc8.
|
|
||||||
stdenv = overrideCC stdenv (if stdenv.hostPlatform.isi686 then gcc6 else gcc7);
|
|
||||||
});
|
|
||||||
|
|
||||||
llvmPackages_7 = callPackage ../development/compilers/llvm/7 ({
|
llvmPackages_7 = callPackage ../development/compilers/llvm/7 {
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_7.tools;
|
buildLlvmTools = buildPackages.llvmPackages_7.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_7.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_7.libraries;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
|
};
|
||||||
stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4'
|
|
||||||
});
|
|
||||||
|
|
||||||
llvmPackages_8 = callPackage ../development/compilers/llvm/8 ({
|
llvmPackages_8 = callPackage ../development/compilers/llvm/8 {
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_8.tools;
|
buildLlvmTools = buildPackages.llvmPackages_8.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
|
};
|
||||||
stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4'
|
|
||||||
});
|
|
||||||
|
|
||||||
llvmPackages_9 = callPackage ../development/compilers/llvm/9 ({
|
llvmPackages_9 = callPackage ../development/compilers/llvm/9 {
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_9.tools;
|
buildLlvmTools = buildPackages.llvmPackages_9.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_9.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_9.libraries;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
|
};
|
||||||
stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4'
|
|
||||||
});
|
|
||||||
|
|
||||||
llvmPackages_10 = callPackage ../development/compilers/llvm/10 ({
|
llvmPackages_10 = callPackage ../development/compilers/llvm/10 {
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_10.tools;
|
buildLlvmTools = buildPackages.llvmPackages_10.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_10.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_10.libraries;
|
||||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
|
};
|
||||||
stdenv = gcc7Stdenv;
|
|
||||||
});
|
|
||||||
|
|
||||||
llvmPackages_latest = llvmPackages_10;
|
llvmPackages_latest = llvmPackages_10;
|
||||||
|
|
||||||
@ -10491,6 +10477,17 @@ in
|
|||||||
stdenvNoLibs = gccStdenvNoLibs; # cannot be built with clang it seems
|
stdenvNoLibs = gccStdenvNoLibs; # cannot be built with clang it seems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# This is for e.g. LLVM libraries on linux.
|
||||||
|
gccForLibs =
|
||||||
|
# with gcc-7: undefined reference to `__divmoddi4'
|
||||||
|
if stdenv.targetPlatform.isi686
|
||||||
|
then gcc6.cc
|
||||||
|
else if stdenv.targetPlatform == stdenv.hostPlatform && targetPackages.stdenv.cc.isGNU
|
||||||
|
# Can only do this is in the native case, otherwise we might get infinite
|
||||||
|
# recursion if `targetPackages.stdenv.cc.cc` itself uses `gccForLibs`.
|
||||||
|
then targetPackages.stdenv.cc.cc
|
||||||
|
else gcc.cc;
|
||||||
|
|
||||||
libstdcxx5 = callPackage ../development/libraries/gcc/libstdc++/5.nix { };
|
libstdcxx5 = callPackage ../development/libraries/gcc/libstdc++/5.nix { };
|
||||||
|
|
||||||
libsigrok = callPackage ../development/tools/libsigrok { };
|
libsigrok = callPackage ../development/tools/libsigrok { };
|
||||||
|
Loading…
Reference in New Issue
Block a user