about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
index a907d4086550..3c6265c4fca0 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
@@ -41,6 +41,11 @@ stdenv.mkDerivation {
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
   ] ++ stdenv.lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+    # The compiler-rt build infrastructure sniffs supported platforms on Darwin
+    # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
+    # when it tries to use libc++ and libc++api for i386.
+    "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
   ];
 
   outputs = [ "out" "dev" ];