about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-18 01:12:31 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-18 01:12:31 +0000
commit50053cda79099c9a0b2a7803aef61f730a54848f (patch)
tree6413bbed5cbdd3f58d26d54cbf1b37d54a8c3a22 /nixpkgs/pkgs/development/compilers/llvm
parent7fbd32a525182f2089e1098723219a1a4ef264bb (diff)
parent36f316007494c388df1fec434c1e658542e3c3cc (diff)
downloadnixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.gz
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.bz2
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.lz
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.xz
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.zst
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.zip
Merge commit '36f316007494c388df1fec434c1e658542e3c3cc'
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix17
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix27
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/common.nix22
3 files changed, 29 insertions, 37 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix
index 54617a075734..f16f3f721379 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix
@@ -13,9 +13,10 @@
 , fetchpatch
 , debugVersion ? false
 , enableManpages ? false
-# Mesa requires AMDGPU target
-, enableTargets ? [ stdenv.hostPlatform stdenv.targetPlatform "AMDGPU" ]
 , enableSharedLibraries ? true
+# Mesa requires AMDGPU target
+# BPF is used by bcc
+, enableTargets ? [ stdenv.hostPlatform stdenv.targetPlatform "AMDGPU" "BPF" ]
 }:
 
 let
@@ -27,10 +28,6 @@ let
   shortVersion = with stdenv.lib;
     concatStringsSep "." (take 2 (splitString "." release_version));
 
-  inherit
-    (import ../common.nix { inherit (stdenv) lib; })
-    llvmBackendList;
-
 in stdenv.mkDerivation (rec {
   name = "llvm-${version}";
 
@@ -51,11 +48,16 @@ in stdenv.mkDerivation (rec {
   propagatedBuildInputs = [ ncurses zlib ];
 
   patches = [
-    # fixes tests, included in llvm_7
+    # Patches to fix tests, included in llvm_7
     (fetchpatch {
       url = "https://github.com/llvm-mirror/llvm/commit/737553be0c9c25c497b45a241689994f177d5a5d.patch";
       sha256 = "0hnaxnkx7zy5yg98f1ggv8a9l0r6g19n6ygqsv26masrnlcbccli";
     })
+    (fetchpatch {
+      url = "https://github.com/llvm-mirror/llvm/commit/1c0dd31a7837c3e2f1c4ac14e4d5ac640688bd1f.patch";
+      includes = [ "test/tools/gold/X86/common.ll" ];
+      sha256 = "0fxgrxmfnjx17w3lcq19rk68b2xksh1bynz3ina784kma7hp4wdb";
+    })
   ];
 
   postPatch = optionalString stdenv.isDarwin ''
@@ -93,7 +95,6 @@ in stdenv.mkDerivation (rec {
     "-DLLVM_ENABLE_RTTI=ON"
     "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
     "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
-    "-DLLVM_TARGETS_TO_BUILD=${llvmBackendList enableTargets}"
     "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
     "-DLLVM_ENABLE_DUMP=ON"
   ] ++ optionals enableSharedLibraries [
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix
index bff89812cae8..5bb629931fd5 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetch
+, fetchpatch
 , cmake
 , python
 , libffi
@@ -14,8 +15,6 @@
 , debugVersion ? false
 , enableManpages ? false
 , enableSharedLibraries ? true
-# Mesa requires AMDGPU target
-, enableTargets ? [ stdenv.hostPlatform stdenv.targetPlatform "AMDGPU" ]
 , enablePFM ? !stdenv.isDarwin
 }:
 
@@ -28,9 +27,6 @@ let
   shortVersion = with stdenv.lib;
     concatStringsSep "." (take 1 (splitString "." release_version));
 
-  inherit
-    (import ../common.nix { inherit (stdenv) lib; })
-    llvmBackendList;
 in stdenv.mkDerivation (rec {
   name = "llvm-${version}";
 
@@ -51,6 +47,24 @@ in stdenv.mkDerivation (rec {
 
   propagatedBuildInputs = [ ncurses zlib ];
 
+  patches = [
+    # https://bugs.llvm.org/show_bug.cgi?id=39427
+    # https://github.com/NixOS/nixpkgs/issues/54370
+    (fetchpatch {
+      url = "https://github.com/llvm-mirror/llvm/commit/57567def148f387153a8149fb590bd39b1b006a1.patch";
+      sha256 = "1w1xg5pxpc6cals1nf5j5k4p6qi8lcrpvn0paxc86m415i79xmcg";
+    })
+    # backport, fix building rust crates with lto
+    (fetchpatch {
+      url = "https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f.patch";
+      sha256 = "0p81gkhc1xhcx0hmnkwyhrn8x8l8fd24xgaj1whni29yga466dwc";
+    })
+    (fetchpatch {
+      url = "https://github.com/llvm-mirror/llvm/commit/cc1f2a595ead516812a6c50398f0f3480ebe031f.patch";
+      sha256 = "0k6k1p5yisgwx417a67s7sr9930rqh1n0zv5jvply8vjjy4b3kf8";
+    })
+  ];
+
   postPatch = optionalString stdenv.isDarwin ''
     substituteInPlace cmake/modules/AddLLVM.cmake \
       --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
@@ -88,7 +102,6 @@ in stdenv.mkDerivation (rec {
     "-DLLVM_ENABLE_RTTI=ON"
     "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
     "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
-    "-DLLVM_TARGETS_TO_BUILD=${llvmBackendList enableTargets}"
     "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
     "-DLLVM_ENABLE_DUMP=ON"
   ] ++ optionals enableSharedLibraries [
@@ -134,7 +147,7 @@ in stdenv.mkDerivation (rec {
     ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
   '';
 
-  doCheck = stdenv.isLinux && (!stdenv.isi686);
+  doCheck = stdenv.isLinux && (!stdenv.isx86_32);
 
   checkTarget = "check-all";
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/common.nix b/nixpkgs/pkgs/development/compilers/llvm/common.nix
deleted file mode 100644
index df0cd29ad5b7..000000000000
--- a/nixpkgs/pkgs/development/compilers/llvm/common.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ lib }:
-
-rec {
-  llvmBackend = platform:
-    if builtins.typeOf platform == "string" then
-      platform
-    else if platform.parsed.cpu.family == "x86" then
-      "X86"
-    else if platform.parsed.cpu.name == "aarch64" then
-      "AArch64"
-    else if platform.parsed.cpu.family == "arm" then
-      "ARM"
-    else if platform.parsed.cpu.family == "mips" then
-      "Mips"
-    else if platform.parsed.cpu.family == "power" then
-      "PowerPC"
-    else
-      throw "Unsupported system";
-
-  llvmBackendList = platforms:
-    lib.concatStringsSep ";" (map llvmBackend platforms);
-}