!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
128 Servers

Load older messages


SenderMessageTime
25 Jan 2026
@gsaurel:laas.frnim65sref https://github.com/NixOS/nixpkgs/issues/47547913:09:07
@gsaurel:laas.frnim65soh, wait, no13:09:57
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemBash is quite an odd one though13:10:00
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemBecause 99% of the builds work13:10:07
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemI guess this is the runtime bash for the system 13:10:14
@dramforever:matrix.orgdramforever this shouldn't change anything since it's stdenv.hostPlatform.isFreeBSD 13:10:14
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemThat might be the problem13:10:38
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemmaybe I need it in my case13:10:47
@dramforever:matrix.orgdramforeverhow we have ended up std=c23 is certainly a mystery...13:11:17
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemBut I forked nixpkgs and added it unconditionally and it seems to crash still13:11:41
@matthewcroughan:defenestrate.itmatthewcroughan @fosdem
diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix
index 86d3727cd94f..8e9fe8ff751b 100644
--- a/pkgs/shells/bash/5.nix
+++ b/pkgs/shells/bash/5.nix
@@ -85,11 +85,9 @@ lib.warnIf (withDocs != null)
     #
     # Once FreeBSD is built with a newer version of Clang, this hack
     # should be removed.
-    +
-      lib.optionalString (stdenv.hostPlatform.isFreeBSD && stdenv.hostPlatform != stdenv.buildPlatform)
-        ''
-          -std=c23
-        '';
+    + ''
+      -std=c23
+    '';
 
13:11:43
@matthewcroughan:defenestrate.itmatthewcroughan @fosdem *
diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix
index 86d3727cd94f..8e9fe8ff751b 100644
--- a/pkgs/shells/bash/5.nix
+++ b/pkgs/shells/bash/5.nix
@@ -85,11 +85,9 @@ lib.warnIf (withDocs != null)
     #
     # Once FreeBSD is built with a newer version of Clang, this hack
     # should be removed.
-    +
-      lib.optionalString (stdenv.hostPlatform.isFreeBSD && stdenv.hostPlatform != stdenv.buildPlatform)
-        ''
-          -std=c23
-        '';
+    + ''
+      -std=c23
+    '';
 
13:11:47
@matthewcroughan:defenestrate.itmatthewcroughan @fosdem In that case I get configure: error: C compiler cannot create executables 13:12:11
@matthewcroughan:defenestrate.itmatthewcroughan @fosdem
Beginning configuration for bash-5.3-release for aarch64-unknown-linux-gnu

checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in '/build/bash-5.3':
configure: error: C compiler cannot create executables
13:12:27
@matthewcroughan:defenestrate.itmatthewcroughan @fosdem Maybe John Ericson would know how to fix it :D 13:13:40
@dramforever:matrix.orgdramforeverdo you have the full log13:13:51
@dramforever:matrix.orgdramforeverfor the first one13:13:52
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemYeah can put it on termbin, sec13:14:02
@matthewcroughan:defenestrate.itmatthewcroughan @fosdem
 nix log /nix/store/946y9d3skwapp70wn66s6rvsfsypn9rc-bash-aarch64-unknown-linux-musl-5.3p9.drv | nc termbin.com 9999
https://termbin.com/z6eb
13:14:31
@dramforever:matrix.orgdramforeveryeah looks like c23-ness mismatch13:16:02
@dramforever:matrix.orgdramforeveri love cross compilation13:16:12
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemAh you would hate native musl llvm stuff more13:19:06
@dramforever:matrix.orgdramforeverhmm, looks like bootstrapping will be "okay"13:24:00
@dramforever:matrix.orgdramforeverlemme give it a try13:24:06
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemFunny enough, system closures end up smaller if you cross compile instead of native13:24:32
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemlike I have a small nixos closure built with gnu-llvm-musl, and it comes out smaller than the one build without the gnu cross stuff13:24:51
@matthewcroughan:defenestrate.itmatthewcroughan @fosdema few megabytes13:24:55
@matthewcroughan:defenestrate.itmatthewcroughan @fosdemthere's also an accidental linkage to the llvm toolchain that occurs in the native setup that adds 40M13:25:29
@matthewcroughan:defenestrate.itmatthewcroughan @fosdembut even when that is corrected for, the cross-compiled setup produces smaller closures13:25:41
@dramforever:matrix.orgdramforeveroh, got tricked by parallel build13:30:48

Show newer messages


Back to Room ListRoom Version: 6