-
-
Notifications
You must be signed in to change notification settings - Fork 18k
stdenvAdapters: add useMoldLinker #216383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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/)