Repository navigation
Commit 7bcafc9
fix(nix): strip the unused libiconv dependency on Darwin (#1292)
* fix(nix): drop unused libiconv from the Darwin build
ccusage links no iconv symbols (verified: `nm -u` shows none on both arm64 and
x64, no iconv crate in Cargo.lock), but libiconv was listed in the Darwin
buildInputs, so the linker recorded /usr/lib/libiconv.2.dylib as an unused
load-time dependency. When the Darwin package was built with Nix that path was
the /nix/store one, which dyld can't resolve on non-Nix Macs — the crash behind
#1251 (worked around in #1256 by rewriting the install name).
Remove libiconv from buildInputs so the binary links only system dylibs and the
install-name rewrite is no longer needed. The portability gate (otool, reject
non-system dylibs) stays to catch any future stray /nix dependency.
* fix(nix): strip the unused libiconv dependency with dead_strip_dylibs
Removing libiconv from buildInputs was not enough: the nixpkgs Darwin stdenv
injects -liconv regardless, so the arm64 binary still recorded the unused
/nix/store libiconv dylib (the otool gate caught it). ccusage references no
iconv symbols, so add -Wl,-dead_strip_dylibs to the Darwin link, which drops
dylib load commands with no used symbols. The arm64 binary now links only
/usr/lib/libSystem.B.dylib (verified), so the install-name rewrite stays gone.
(Linux ships a fully static musl binary with no dynamic deps, so no equivalent
is needed there.)
* fix(nix): fall back to libiconv install_name_tool rewrite when dead_strip_dylibs doesn't strip it
---------
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>1 parent b1c60c4 commit 7bcafc9
2 files changed
Lines changed: 24 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | | - | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
0 commit comments