aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/llvm/8
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/8')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/bintools.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix3
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix3
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/default.nix34
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh6
6 files changed, 30 insertions, 39 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/bintools.nix b/nixpkgs/pkgs/development/compilers/llvm/8/bintools.nix
index 72a2a733193..53f7941e336 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/bintools.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/bintools.nix
@@ -11,9 +11,19 @@ in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } ''
ln -s $prog $out/bin/${prefix}$(basename $prog)
done
for prog in ${llvm}/bin/*; do
- ln -s $prog $out/bin/${prefix}$(echo $(basename $prog) | sed -e "s|llvm-||")
ln -sf $prog $out/bin/${prefix}$(basename $prog)
done
- rm -f $out/bin/${prefix}cat
+
+ ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}ar
+ ln -s ${llvm}/bin/llvm-as $out/bin/${prefix}as
+ ln -s ${llvm}/bin/llvm-dwp $out/bin/${prefix}dwp
+ ln -s ${llvm}/bin/llvm-nm $out/bin/${prefix}nm
+ ln -s ${llvm}/bin/llvm-objcopy $out/bin/${prefix}objcopy
+ ln -s ${llvm}/bin/llvm-objdump $out/bin/${prefix}objdump
+ ln -s ${llvm}/bin/llvm-ranlib $out/bin/${prefix}ranlib
+ ln -s ${llvm}/bin/llvm-readelf $out/bin/${prefix}readelf
+ ln -s ${llvm}/bin/llvm-size $out/bin/${prefix}size
+ ln -s ${llvm}/bin/llvm-strip $out/bin/${prefix}strip
+
ln -s ${lld}/bin/lld $out/bin/${prefix}ld
''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix
index 3b398628e56..2d7fc806890 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix
@@ -28,6 +28,7 @@ let
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
"-DCLANGD_BUILD_XPC=OFF"
+ "-DLLVM_ENABLE_RTTI=ON"
] ++ stdenv.lib.optionals enableManpages [
"-DCLANG_INCLUDE_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
@@ -97,8 +98,6 @@ let
passthru = {
isClang = true;
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 = {
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
index 1f58cb98e3d..a907d408655 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
@@ -46,6 +46,7 @@ stdenv.mkDerivation {
outputs = [ "out" "dev" ];
patches = [
+ ../7/compiler-rt-glibc.patch
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
++ stdenv.lib.optional (useLLVM) ./crtbegin-and-end.patch
@@ -56,7 +57,7 @@ stdenv.mkDerivation {
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build.
- postPatch = ''
+ postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
'' + stdenv.lib.optionalString stdenv.isDarwin ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/default.nix
index d9383d042bb..6e80737f32a 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/default.nix
@@ -1,5 +1,6 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook
+{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
+, buildPackages
, buildLlvmTools # tools, but from the previous 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 "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
- '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
- echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
+ '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
+ echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {
@@ -42,10 +43,11 @@ let
enablePolly = true;
};
- llvm-manpages = lowPrio (tools.llvm.override {
- enableManpages = true;
- python3 = pkgs.python3; # don't use python-boot
- });
+ # disabled until recommonmark supports sphinx 3
+ #llvm-manpages = lowPrio (tools.llvm.override {
+ # enableManpages = true;
+ # python3 = pkgs.python3; # don't use python-boot
+ #});
clang-manpages = lowPrio (tools.clang-unwrapped.override {
enableManpages = true;
@@ -58,25 +60,18 @@ let
libstdcxxClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
- extraTools = [
- libstdcxxHook
- ];
+ # libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
+ libcxx = null;
extraPackages = [
targetLlvmLibraries.compiler-rt
];
- extraBuildCommands = ''
- echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
- echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
- echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
- echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags
- '' + mkExtraBuildCommands cc;
+ extraBuildCommands = mkExtraBuildCommands cc;
};
libcxxClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = targetLlvmLibraries.libcxx;
extraPackages = [
- targetLlvmLibraries.libcxx
targetLlvmLibraries.libcxxabi
targetLlvmLibraries.compiler-rt
];
@@ -103,14 +98,12 @@ let
inherit (tools) bintools;
};
extraPackages = [
- targetLlvmLibraries.libcxx
targetLlvmLibraries.libcxxabi
targetLlvmLibraries.compiler-rt
] ++ stdenv.lib.optionals (!stdenv.targetPlatform.isWasm) [
targetLlvmLibraries.libunwind
];
extraBuildCommands = ''
- echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) ''
@@ -130,7 +123,6 @@ let
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = ''
- echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
echo "-nostdlib++" >> $out/nix-support/cc-cflags
@@ -148,7 +140,6 @@ let
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = ''
- echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
@@ -164,7 +155,6 @@ let
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
- echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
'';
};
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix
index 24bca6aafcd..9c0c7951c79 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix
@@ -43,12 +43,9 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
- linkCxxAbi = stdenv.isLinux;
-
- setupHooks = [
- ../../../../../build-support/setup-hooks/role.bash
- ./setup-hook.sh
- ];
+ passthru = {
+ isLLVM = true;
+ };
meta = {
homepage = "https://libcxx.llvm.org/";
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh
deleted file mode 100644
index 6611259165a..00000000000
--- a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# See pkgs/build-support/setup-hooks/role.bash
-getHostRole
-
-linkCxxAbi="@linkCxxAbi@"
-export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
-export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"