lol
1{ lib, stdenv, llvm_meta
2, buildLlvmTools
3, fetch
4, cmake
5, libllvm
6, version
7}:
8
9stdenv.mkDerivation rec {
10 pname = "lld";
11 inherit version;
12
13 src = fetch "lld" "1ah75rjly6747jk1zbwca3z0svr9b09ylgxd4x9ns721xir6sia6";
14
15 patches = [
16 ./gnu-install-dirs.patch
17 ];
18
19 nativeBuildInputs = [ cmake ];
20 buildInputs = [ libllvm ];
21
22 cmakeFlags = [
23 "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}"
24 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
25 "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
26 ];
27
28 outputs = [ "out" "lib" "dev" ];
29
30 meta = llvm_meta // {
31 homepage = "https://lld.llvm.org/";
32 description = "The LLVM linker";
33 longDescription = ''
34 LLD is a linker from the LLVM project that is a drop-in replacement for
35 system linkers and runs much faster than them. It also provides features
36 that are useful for toolchain developers.
37 The linker supports ELF (Unix), PE/COFF (Windows), and Mach-O (macOS)
38 in descending order of completeness. Internally, LLD consists
39 of several different linkers.
40 '';
41 };
42}