summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Childs <lorne@cons.org.nz>2020-07-30 00:32:34 +0900
committerAndrew Childs <lorne@cons.org.nz>2020-11-09 20:00:39 +0900
commitddd17201abbec8bf04e55164b995eb148ae94b48 (patch)
tree5f41fe36d3f16e628737e79f56d288f15ef6feec
parentfece3eb2e981b3bd9ea73b34f302ff3aa3d9f81c (diff)
downloadnixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.tar
nixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.tar.gz
nixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.tar.bz2
nixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.tar.lz
nixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.tar.xz
nixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.tar.zst
nixpkgs-ddd17201abbec8bf04e55164b995eb148ae94b48.zip
compiler-rt: prevent platform sniffing on Darwin
Exposed by the tbd stubs which contains fat libraries. The previously
used proxy libraries were x86_64 only.
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt.nix5
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt.nix5
-rw-r--r--pkgs/development/compilers/llvm/6/compiler-rt.nix5
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt.nix5
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt.nix5
-rw-r--r--pkgs/development/compilers/llvm/9/compiler-rt.nix5
6 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt.nix
index 47bbe808ac2..e6882cbabb8 100644
--- a/pkgs/development/compilers/llvm/10/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/10/compiler-rt.nix
@@ -41,6 +41,11 @@ stdenv.mkDerivation rec {
     "-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" ];
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt.nix b/pkgs/development/compilers/llvm/5/compiler-rt.nix
index 32d6dd3d479..41f2b24b057 100644
--- a/pkgs/development/compilers/llvm/5/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/5/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" ];
diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt.nix
index 89f25cad2c5..8bd61f5d7f7 100644
--- a/pkgs/development/compilers/llvm/6/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/6/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" ];
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt.nix
index 97a5d73f304..ec9b7e6e6ad 100644
--- a/pkgs/development/compilers/llvm/7/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/7/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" ];
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix
index a907d408655..3c6265c4fca 100644
--- a/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/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" ];
diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt.nix
index 394f66ff7f1..13b0b522771 100644
--- a/pkgs/development/compilers/llvm/9/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/9/compiler-rt.nix
@@ -41,6 +41,11 @@ stdenv.mkDerivation rec {
     "-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" ];