nixpkgs/pkgs/development/compilers/llvm/8/lld/default.nix

44 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, llvm_meta
, buildLlvmTools
2019-02-28 19:01:31 +01:00
, fetch
, cmake
, libxml2
, libllvm
2019-02-28 19:01:31 +01:00
, version
}:
stdenv.mkDerivation rec {
2019-08-13 23:52:01 +02:00
pname = "lld";
inherit version;
2019-02-28 19:01:31 +01:00
src = fetch pname "121xhxrlvwy3k5nf6p1wv31whxlb635ssfkci8z93mwv4ja1xflz";
2019-02-28 19:01:31 +01:00
patches = [
./gnu-install-dirs.patch
];
2019-02-28 19:01:31 +01:00
nativeBuildInputs = [ cmake ];
buildInputs = [ libllvm libxml2 ];
2019-02-28 19:01:31 +01:00
cmakeFlags = [
"-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
];
2019-02-28 19:01:31 +01:00
outputs = [ "out" "lib" "dev" ];
2019-02-28 19:01:31 +01:00
meta = llvm_meta // {
homepage = "https://lld.llvm.org/";
description = "The LLVM linker";
longDescription = ''
LLD is a linker from the LLVM project that is a drop-in replacement for
system linkers and runs much faster than them. It also provides features
that are useful for toolchain developers.
The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and
WebAssembly in descending order of completeness. Internally, LLD consists
of several different linkers.
'';
2019-02-28 19:01:31 +01:00
};
}