Skip to content

Commit 7ab714f

Browse files
committed
mk-component-set: wrap gcc-ld/ld.lld instead of multicall rust-lld
Other flavor dispatchers may use different CLI (eg. MSVC 'link' style) and our wrapper cannot handle all of them. They are usually used for exotic targets like UEFI or WASM ones, where Nix libraries cannot be used without manual configuration anyway.
1 parent 095702e commit 7ab714f

File tree

2 files changed

+5
-285
lines changed

2 files changed

+5
-285
lines changed

ld-wrapper.sh

Lines changed: 0 additions & 281 deletions
This file was deleted.

mk-component-set.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,19 @@ let
124124
chmod +x "$dst"
125125
}
126126
127-
dsts=( "$out"/lib/rustlib/*/bin/rust-lld )
127+
dsts=( "$out"/lib/rustlib/*/bin/gcc-ld/ld.lld )
128128
if [[ ''${#dsts} -ne 0 ]]; then
129-
ls -lah $out
130129
mkdir -p $out/nix-support
131130
substituteAll ${path + "/pkgs/build-support/wrapper-common/utils.bash"} $out/nix-support/utils.bash
132131
substituteAll ${path + "/pkgs/build-support/bintools-wrapper/add-flags.sh"} $out/nix-support/add-flags.sh
133132
substituteAll ${path + "/pkgs/build-support/bintools-wrapper/add-hardening.sh"} $out/nix-support/add-hardening.sh
134133
135134
for dst in "''${dsts[@]}"; do
136-
unwrapped="$(dirname "$dst")/.rust-lld-unwrapped"
135+
# The ld.lld is path/name sensitive because itself is a wrapper. Keep its original name.
136+
unwrapped="$(dirname "$dst")-unwrapped/ld.lld"
137+
mkdir -p "$(dirname "$unwrapped")"
137138
mv "$dst" "$unwrapped"
138-
wrap "$dst" ${./ld-wrapper.sh} "$unwrapped"
139+
wrap "$dst" ${path + "/pkgs/build-support/bintools-wrapper/ld-wrapper.sh"} "$unwrapped"
139140
done
140141
fi
141142
'';

0 commit comments

Comments
 (0)