2021-04-15 18:41:38 +02:00
|
|
|
{ lib, stdenv, llvm_meta
|
2021-04-01 11:27:57 +02:00
|
|
|
, fetch
|
2021-03-17 18:17:32 +01:00
|
|
|
, libunwind
|
2021-04-01 11:27:57 +02:00
|
|
|
, cmake
|
|
|
|
, libxml2
|
|
|
|
, llvm
|
|
|
|
, version
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lld";
|
|
|
|
inherit version;
|
|
|
|
|
2021-04-15 16:28:00 +02:00
|
|
|
src = fetch pname "1zakyxk5bwnh7jarckcd4rbmzi58jgn2dbah5j5cwcyfyfbx9drc";
|
2021-04-01 11:27:57 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ llvm libxml2 ];
|
|
|
|
|
2021-03-17 18:17:32 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace MachO/CMakeLists.txt --replace \
|
|
|
|
'(''${LLVM_MAIN_SRC_DIR}/' '('
|
|
|
|
mkdir -p libunwind/include
|
|
|
|
tar -xf "${libunwind.src}" --wildcards -C libunwind/include --strip-components=2 "libunwind-*/include/"
|
|
|
|
'';
|
|
|
|
|
2021-04-01 11:27:57 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
moveToOutput include "$dev"
|
|
|
|
moveToOutput lib "$dev"
|
|
|
|
'';
|
|
|
|
|
2021-04-15 18:41:38 +02: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.
|
|
|
|
'';
|
2021-04-01 11:27:57 +02:00
|
|
|
};
|
|
|
|
}
|