forked from mirrors/nixpkgs
llvm_6, llvm_7: build all default targets (#53941)
This makes LLVM tools (including dependent tools such as LLD) readily useful in more situations, foresees such needed additions as BPF and NVPTX, and brings llvm_6 and newer on par with the current default llvm_5.
This commit is contained in:
parent
263bc89c1b
commit
d6f401e132
|
@ -28,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}";
|
||||
|
||||
|
@ -52,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 ''
|
||||
|
@ -94,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 [
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
, debugVersion ? false
|
||||
, enableManpages ? false
|
||||
, enableSharedLibraries ? true
|
||||
# Mesa requires AMDGPU target
|
||||
# BPF is used by bcc
|
||||
, enableTargets ? [ stdenv.hostPlatform stdenv.targetPlatform "AMDGPU" "BPF" ]
|
||||
, enablePFM ? !stdenv.isDarwin
|
||||
}:
|
||||
|
||||
|
@ -29,9 +26,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}";
|
||||
|
||||
|
@ -89,7 +83,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 [
|
||||
|
|
|
@ -1,20 +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
|
||||
throw "Unsupported system";
|
||||
|
||||
llvmBackendList = platforms:
|
||||
lib.concatStringsSep ";" (map llvmBackend platforms);
|
||||
}
|
Loading…
Reference in a new issue