3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/llvm/rocm/lld/default.nix

46 lines
1,013 B
Nix
Raw Normal View History

{ lib, stdenv
, buildLlvmTools
2020-07-10 18:28:08 +01:00
, cmake
, libxml2
, llvm
, version
, src
}:
stdenv.mkDerivation rec {
inherit version src;
pname = "lld";
nativeBuildInputs = [ cmake ];
buildInputs = [ libxml2 llvm ];
cmakeFlags = [
"-DLLVM_MAIN_SRC_DIR=${llvm.src}"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
"-DLLVM_CONFIG_PATH=${llvm.dev}/bin/llvm-config-native"
];
outputs = [ "out" "dev" ];
2021-03-24 07:43:58 +00:00
2020-07-10 18:28:08 +01:00
postInstall = ''
moveToOutput include "$dev"
moveToOutput lib "$dev"
# Fix lld binary path for CMake.
substituteInPlace "$dev/lib/cmake/lld/LLDTargets-release.cmake" \
--replace "\''${_IMPORT_PREFIX}/bin/lld" "$out/bin/lld"
2020-07-10 18:28:08 +01:00
'';
meta = with lib; {
2020-07-10 18:28:08 +01:00
description = "ROCm fork of the LLVM Linker";
homepage = "https://github.com/RadeonOpenCompute/llvm-project";
license = licenses.ncsa;
maintainers = with maintainers; [ danieldk ];
platforms = platforms.linux;
};
}