about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/8
diff options
context:
space:
mode:
authorTravis Whitaker <pi.boy.travis@gmail.com>2020-04-07 00:46:15 +0000
committerJohn Ericson <git@JohnEricson.me>2020-04-13 18:49:27 -0400
commit74f3b25896129f20f7af62fd7ccbb9fd1046761b (patch)
tree72ae0a1ba5ae7cbc9dc96e499d9ec6d734820f40 /pkgs/development/compilers/llvm/8
parent79374b98700366f0aa39241c05a840c4c221c1c0 (diff)
downloadnixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.tar
nixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.tar.gz
nixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.tar.bz2
nixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.tar.lz
nixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.tar.xz
nixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.tar.zst
nixlib-74f3b25896129f20f7af62fd7ccbb9fd1046761b.zip
LLVM: Always pass host/target info to compiler-rt/libstdcxxClang
Diffstat (limited to 'pkgs/development/compilers/llvm/8')
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt.nix2
-rw-r--r--pkgs/development/compilers/llvm/8/default.nix10
2 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix
index 795c81f42196..573c198d6dac 100644
--- a/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/8/compiler-rt.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
   ];
 
-  cmakeFlags = stdenv.lib.optionals (useLLVM || stdenv.isDarwin) [
+  cmakeFlags = [
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix
index 105011595c8b..d9383d042bbc 100644
--- a/pkgs/development/compilers/llvm/8/default.nix
+++ b/pkgs/development/compilers/llvm/8/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook
+{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
@@ -7,6 +7,7 @@
 let
   release_version = "8.0.1";
   version = release_version; # differentiating these is important for rc's
+  targetConfig = stdenv.targetPlatform.config;
 
   fetch = name: sha256: fetchurl {
     url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz";
@@ -63,7 +64,12 @@ let
       extraPackages = [
         targetLlvmLibraries.compiler-rt
       ];
-      extraBuildCommands = mkExtraBuildCommands cc;
+      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;
     };
 
     libcxxClang = wrapCCWith rec {