nixpkgs/pkgs/development/compilers/llvm/9/lld/default.nix
Aleksey Kladov 6d111cbf61 Clarify that lld package provides unwrapped lld
lld package provides an unwrapped lld. It doesn't always work on NixOS
(eg, it doesn't set rpath), and so dosen't always work.

What one should be using instead is the `lld` from
`llvmPackages.bintools` package. This super counterintutive.

One incremental step we can take here is to clarify that the `lld`
package is unrwapped -- right now, it looks like 100% legit thing one
should be using!
2022-03-27 18:14:55 -04:00

44 lines
1.2 KiB
Nix

{ lib, stdenv, llvm_meta
, buildLlvmTools
, fetch
, cmake
, libxml2
, libllvm
, version
}:
stdenv.mkDerivation rec {
pname = "lld";
inherit version;
src = fetch pname "10hckfxpapfnh6y9apjiya2jpw9nmbbmh8ayijx89mrg7snjn9l6";
patches = [
./gnu-install-dirs.patch
];
nativeBuildInputs = [ cmake ];
buildInputs = [ libllvm libxml2 ];
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"
];
outputs = [ "out" "lib" "dev" ];
meta = llvm_meta // {
homepage = "https://lld.llvm.org/";
description = "The LLVM linker (unwrapped)";
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.
'';
};
}