stdenvAdapters: add useMoldLinker#216383
Conversation
2e2624c to
28e766c
Compare
e4872a4 to
9fba3af
Compare
allows using wrapBintoolsWith with all linkers ``` $ nix build ".#binutils" $ ls ./result/bin/ld* ./result/bin/ld* ./result/bin/ld.bfd* ./result/bin/ld.gold* $ nix build "nixpkgs#binutils" $ ls ./result/bin/ld* ./result/bin/ld* ./result/bin/ld.bfd* ./result/bin/ld.gold* ```
e5385bc to
3697dde
Compare
|
binutils works bin/ld in wrapped mold fails |
|
So I guess there are two issues:
Right? |
|
They install a ld in libexec https://github.com/rui314/mold/blob/main/CMakeLists.txt#L453 perhaps we could just add a |
|
That sounds good. The wrapper could also "promote" one of the |
I guess we can just apply this patch in the scope of this PR to avoid opening more PRs. diff --git i/pkgs/development/tools/mold/default.nix w/pkgs/development/tools/mold/default.nix
index bb55ba80796..4b2b35fb26f 100644
--- i/pkgs/development/tools/mold/default.nix
+++ w/pkgs/development/tools/mold/default.nix
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
+, makeWrapper
, cmake
, mimalloc
, ninja
@@ -45,6 +46,10 @@ stdenv.mkDerivation rec {
"-faligned-allocation"
];
+ postInstall = ''
+ makeWrapper "$out/bin/mold" "$out/bin/ld"
+ '';
+
passthru.tests.version = testers.testVersion { package = mold; };
meta = with lib; {
I'm not sure about a 100% flag parity to GNU |
|
The fact that they have an |
not all linkers have a ld binary in bin
also note the '${ld:-}' which allows users to set the ld path with a env
var
> '${foo:-val}' $foo, or val if unset (or null)
eff450b to
b5abc3d
Compare
2465936 to
a159267
Compare
a159267 to
299a7bd
Compare
|
i removed this works and the resulting binaries have diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix
index 2bdd49f672f..8976d3314cb 100644
--- a/pkgs/tools/misc/man-db/default.nix
+++ b/pkgs/tools/misc/man-db/default.nix
@@ -12,9 +12,14 @@
, stdenv
, zstd
, autoreconfHook
+, stdenvAdapters
}:
-stdenv.mkDerivation rec {
+let
+ stdenv' = stdenvAdapters.useMoldLinker stdenv;
+in
+
+stdenv'.mkDerivation rec {
pname = "man-db";
version = "2.11.1"; |
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)