2021-07-12 21:12:26 +02:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, autoPatchelfHook
|
|
|
|
, cmake
|
|
|
|
, llvmPackages_latest
|
|
|
|
, xxHash
|
|
|
|
, zlib
|
|
|
|
, openssl
|
2022-01-27 09:45:38 +01:00
|
|
|
, nix-update-script
|
2021-07-12 21:12:26 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mold";
|
2022-04-29 10:03:08 +02:00
|
|
|
version = "1.2.1";
|
2021-07-12 21:12:26 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rui314";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-04-29 10:03:08 +02:00
|
|
|
sha256 = "sha256-qrIaHDjPiOzQ8Gi7aPT0BM9oIgWr1IdcT7vvYmsea7k=";
|
2021-07-12 21:12:26 +02:00
|
|
|
};
|
|
|
|
|
2021-07-28 17:11:51 +02:00
|
|
|
buildInputs = [ zlib openssl ];
|
2021-07-12 21:12:26 +02:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook cmake xxHash ];
|
|
|
|
|
2022-01-01 19:21:23 +01:00
|
|
|
enableParallelBuilding = true;
|
2021-07-12 21:12:26 +02:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
EXTRA_LDFLAGS = "-fuse-ld=${llvmPackages_latest.lld}/bin/ld.lld";
|
|
|
|
LTO = 1;
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
2022-01-27 09:45:38 +01:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-07-12 21:12:26 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A high performance drop-in replacement for existing unix linkers";
|
|
|
|
homepage = "https://github.com/rui314/mold";
|
|
|
|
license = lib.licenses.agpl3Plus;
|
|
|
|
maintainers = with maintainers; [ nitsky ];
|
2022-03-22 18:59:05 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
# error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
|
|
|
|
broken = stdenv.isAarch64 || stdenv.isDarwin;
|
2021-07-12 21:12:26 +02:00
|
|
|
};
|
|
|
|
}
|