!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

518 Members
108 Servers

Load older messages


SenderMessageTime
15 Sep 2025
@matthewcroughan:defenestrate.itmatthewcroughan
/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:defenestrate.itmatthewcroughanah it's fully named21:15:30
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix#L72-L7621:16:34
@matthewcroughan:defenestrate.itmatthewcroughanThere's an existing pattern in the derivation for darwin that is the same solution more or less21:16:46
@matthewcroughan:defenestrate.itmatthewcroughanNo that gives me the broken strip21:19:31
@matthewcroughan:defenestrate.itmatthewcroughanthe llvm strip is bad, I need the gnu strip21:19:39
@matthewcroughan:defenestrate.itmatthewcroughanwhich is what binutils is giving me21:19:49
@emilazy:matrix.orgemily it could at least be ${stdenv.cc.bintools}/bin/strip 21:23:50
@emilazy:matrix.orgemilywhich will work across all platforms21:23:55
@rosscomputerguy:matrix.orgTristan RossWouldn't that fail with cross compilation since strip would have the prefix?21:25:15
@matthewcroughan:defenestrate.itmatthewcroughanIt's not the strip I need anyway21:25:37
@matthewcroughan:defenestrate.itmatthewcroughanbecause only the gnu strip performs properly21:25:47
@rosscomputerguy:matrix.orgTristan Ross Ok, then pkgsBuildHost.binutils should be right. 21:26:53
@emilazy:matrix.orgemilyare you sure? Darwin sets it to a non-GNU strip…21:27:19
@matthewcroughan:defenestrate.itmatthewcroughanI've been unsuccessful so far21:27:32
@emilazy:matrix.orgemily but yes I guess it'd be lib.getExe stdenv.cc.bintools "${stdenv.cc.bintools.targetPrefix}strip" or something. 21:27:40
@emilazy:matrix.orgemily * but yes I guess it'd be lib.getExe' stdenv.cc.bintools "${stdenv.cc.bintools.targetPrefix}strip" or something. 21:27:42
@matthewcroughan:defenestrate.itmatthewcroughan
diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix
index e0be2bb06..84d53ff13 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,
+  writeShellScript
 }:

 mkDerivation (
@@ -59,7 +60,11 @@ mkDerivation (

     # temporarily use gnuinstall for bootstrapping
     # bsdinstall will be built later
-    makeFlags =
+    makeFlags = let
+      strip = writeShellScript "" ''
+        ${stdenv.cc.bintools}/bin/${stdenv.hostPlatform.config}-strip --strip-unneeded "$@"
+      '';
+    in
       defaultMakeFlags
       ++ [
         "INSTALL=${coreutils}/bin/install"
@@ -69,6 +74,7 @@ mkDerivation (
         "TSORT=cat"
         # Can't process man pages yet
         "MKSHARE=no"
+        "OBJCOPY=${strip}"
       ]
       ++ lib.optionals stdenv.hostPlatform.isDarwin [
         # GNU objcopy produces broken .a libs which won't link into dependers.
21:28:20
@matthewcroughan:defenestrate.itmatthewcroughan it looks like --strip-unneeded didn't help 21:28:25
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/llvm/llvm-project/pull/130704/files21:28:38
@matthewcroughan:defenestrate.itmatthewcroughanYeah I'm not sure, it doesn't seem to be passing anything in the Makefiles21:30:01
@matthewcroughan:defenestrate.itmatthewcroughan
--- md2.po ---
/nix/store/bpf1nk00iz2dbam5x5gzhad3c9zql4m7-llvm-binutils-19.1.7/bin/aarch64-unknown-linux-musl-strip: error: 'md2.po': not stripping symbol '.L.str.1' because it is named in a relocation
21:30:02
@matthewcroughan:defenestrate.itmatthewcroughanthis is all we get whenever an llvm strip/objcopy is used21:30:12
@matthewcroughan:defenestrate.itmatthewcroughanregardless of any fancy flags 21:30:21
@emilazy:matrix.orgemilythat seems like a different matter21:41:16
@matthewcroughan:defenestrate.itmatthewcroughanI have both a musl native and musl llvm nixos configuration build and working in github.com/MatthewCroughan/nixos-musl 22:33:55
@matthewcroughan:defenestrate.itmatthewcroughandon't pay any attention to the overlay horrors22:34:02
@matthewcroughan:defenestrate.itmatthewcroughanupstreaming some of that eventually22:34:06
@matthewcroughan:defenestrate.itmatthewcroughanmy back hurts22:34:21
16 Sep 2025
@sapphire:pub.solarSapphire changed their profile picture.21:14:56

There are no newer messages yet.


Back to Room ListRoom Version: 6