| 15 Sep 2025 |
matthewcroughan | so that derivation just doesn't build for musl atm | 20:25:24 |
matthewcroughan | * so that derivation just doesn't build for musl + llvm atm | 20:25:41 |
matthewcroughan | I cannot get it to stop stripping | 21:02:33 |
matthewcroughan | dontStrip has no impact on the netbsd derivations | 21:02:38 |
matthewcroughan | Tristan Ross: this fixes it, but is it the right solution? | 21:11:41 |
matthewcroughan | diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix
index e0be2bb06..cda2a441a 100644
--- a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix
+++ b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix
@@ -11,6 +11,7 @@
netbsdSetupHook,
makeMinimal,
version,
+ binutils,
}:
mkDerivation (
@@ -69,6 +70,7 @@ mkDerivation (
"TSORT=cat"
# Can't process man pages yet
"MKSHARE=no"
+ "OBJCOPY=${binutils}/bin/strip"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# GNU objcopy produces broken .a libs which won't link into dependers.
| 21:11:45 |
Tristan Ross | Um | 21:11:59 |
matthewcroughan | What I really wanted to do was find a way to pass --strip-unneeded to the build | 21:12:04 |
Tristan Ross | You probably want to use stdenv.cc.bintools | 21:12:09 |
matthewcroughan | but I could not figure out a way of doing it | 21:12:14 |
emily | OBJCOPY=strip does not seem like it would ever be the right solution… | 21:13:23 |
matthewcroughan | this does not contain strip in this case | 21:14:21 |
Tristan Ross | Weird | 21:14:31 |
matthewcroughan | /nix/store/ip27s5zi4zgdb65zbkccgpggr28sg506-aarch64-unknown-linux-musl-llvm-binutils-wrapper-19.1.7 | 21:15:11 |
matthewcroughan | /nix/store/ip27s5zi4zgdb65zbkccgpggr28sg506-aarch64-unknown-linux-musl-llvm-binutils-wrapper-19.1.7/bin/
aarch64-unknown-linux-musl-addr2line aarch64-unknown-linux-musl-dwp aarch64-unknown-linux-musl-objcopy aarch64-unknown-linux-musl-size
aarch64-unknown-linux-musl-ar aarch64-unknown-linux-musl-ld aarch64-unknown-linux-musl-objdump aarch64-unknown-linux-musl-strings
aarch64-unknown-linux-musl-c++filt aarch64-unknown-linux-musl-ld.lld aarch64-unknown-linux-musl-ranlib aarch64-unknown-linux-musl-strip
aarch64-unknown-linux-musl-dlltool aarch64-unknown-linux-musl-nm aarch64-unknown-linux-musl-readelf aarch64-unknown-linux-musl-windre
| 21:15:27 |
matthewcroughan | ah it's fully named | 21:15:30 |
matthewcroughan | https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix#L72-L76 | 21:16:34 |
matthewcroughan | There's an existing pattern in the derivation for darwin that is the same solution more or less | 21:16:46 |
matthewcroughan | No that gives me the broken strip | 21:19:31 |
matthewcroughan | the llvm strip is bad, I need the gnu strip | 21:19:39 |
matthewcroughan | which is what binutils is giving me | 21:19:49 |
emily | it could at least be ${stdenv.cc.bintools}/bin/strip | 21:23:50 |
emily | which will work across all platforms | 21:23:55 |
Tristan Ross | Wouldn't that fail with cross compilation since strip would have the prefix? | 21:25:15 |
matthewcroughan | It's not the strip I need anyway | 21:25:37 |
matthewcroughan | because only the gnu strip performs properly | 21:25:47 |
Tristan Ross | Ok, then pkgsBuildHost.binutils should be right. | 21:26:53 |
emily | are you sure? Darwin sets it to a non-GNU strip… | 21:27:19 |
matthewcroughan | I've been unsuccessful so far | 21:27:32 |
emily | but yes I guess it'd be lib.getExe stdenv.cc.bintools "${stdenv.cc.bintools.targetPrefix}strip" or something. | 21:27:40 |