!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

539 Members
111 Servers

Load older messages


SenderMessageTime
11 Oct 2025
@k900:0upti.meK900To questions that generally indicate that you don't understand the build system12:06:46
@k900:0upti.meK900And like, we can't do your homework for you,12:06:59
@k900:0upti.meK900* And like, we can't do your homework for you12:07:02
@anders:sorby.xyzAndersI don't care. If you don't want to help. Just simply don't. No need to be rude.12:08:10
@k900:0upti.meK900I do care, because this is not the kind of behavior we want to encourage in this community12:08:32
@anders:sorby.xyzAndersI got it working now12:44:25
@artturin:matrix.orgArtturin
In reply to @anders:sorby.xyz
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
	export CC=x86_64-linux-gnu-gcc
	export LD=x86_64-linux-gnu-ld
	export AR=x86_64-linux-gnu-ar
	export NM=x86_64-linux-gnu-nm
	export OBJCOPY=objcopy
	export CPPFLAGS=
	LD_SO_PATH=lib/ld64.so.1
endif

In nixpkgs the compiler for build isn't prefixed, neither during native or cross-compilation

You should remove those lines or substituteInPlace them

12:55:57
@anders:sorby.xyzAnders I don't want to break support for other systems. What is the recommended way of doing this in nix? substituteInPlace 13:01:27
@qyliss:fairydust.spaceAlyssa Rossare they not overridable on the make command line?13:09:37
@qyliss:fairydust.spaceAlyssa Ross i.e. makeFlags 13:09:44
@qyliss:fairydust.spaceAlyssa Rossmake variables usually are13:10:05
@anders:sorby.xyzAndersYes, but I think it is cleanest to use substituteInPlace in this case13:18:17
@qyliss:fairydust.spaceAlyssa RossI don't agree at all. The Make command line is an actual API designed for doing exactly this.13:20:35
@anders:sorby.xyzAndersOk, you seem to be right. It was much simpler and cleaner.13:23:39
@matthewcroughan:defenestrate.itmatthewcroughanhttps://hercules-ci.com/accounts/github/MatthewCroughan/derivations/%2Fnix%2Fstore%2Fdywy5i6pv2l7rs2a6dh357whnhvnmvkl-audit-aarch64-unknown-linux-musl-4.1.2-unstable-2025-09-06.drv/log?via-job=f8d88c3e-3806-4bc0-bdca-0c7ea05b7c6713:51:53
@matthewcroughan:defenestrate.itmatthewcroughan This failure always seems to happen on audit nowadays 13:52:02
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/MatthewCroughan/nixos-musl/tree/refactor13:52:15
@matthewcroughan:defenestrate.itmatthewcroughanI'm building a flake here to track musl/llvm native and cross 13:52:24
@matthewcroughan:defenestrate.itmatthewcroughanGonna need to use cartesianProductOfSets soon13:53:18
@matthewcroughan:defenestrate.itmatthewcroughan
┏━ 134 Errors: 
 ⋮ 
┃        Reason: 1 dependency failed.
┃        Output paths:
┃          /nix/store/nlvwf5bbz1g49mf132c2n5fi32v6h6z5-nix-functional-tests-aarch64-unknown-linux-musl-2.31.2
┃ error: Cannot build '/nix/store/plapm8d3w7phdpbza84155sfqcnadjpn-nix-flake-aarch64-unknown-linux-musl-2.31.2.drv'.
┃        Reason: 1 dependency failed.
┃        Output paths:
┃          /nix/store/5cv0hw9mxlams8ik680vwx0g5l5q32ay-nix-flake-aarch64-unknown-linux-musl-2.31.2-debug
┃          /nix/store/rlwz3nqcgrzdqccgxqaaxg2v4vvi6zd8-nix-flake-aarch64-unknown-linux-musl-2.31.2
┃          /nix/store/s6ikz6qvckn83227n0pi6xc96xpz6haw-nix-flake-aarch64-unknown-linux-musl-2.31.2-dev
┃ error: Cannot build '/nix/store/a9kfaprki0arxirk9scs3wj1d68fq914-nix-expr-c-aarch64-unknown-linux-musl-2.31.2.drv'.
┃        Reason: 1 dependency failed.
┃        Output paths:
┃          /nix/store/hr2aj62dr0bywrdspkyg20n0pwnn7v3z-nix-expr-c-aarch64-unknown-linux-musl-2.31.2-debug
┃          /nix/store/s9vva3v8iwhcz4m56jd1afvqsnig9f3l-nix-expr-c-aarch64-unknown-linux-musl-2.31.2
┃          /nix/store/xhg2sjms4v97d72zd4gwsf9rfggagql1-nix-expr-c-aarch64-unknown-linux-musl-2.31.2-dev
┃ error: build of '/nix/store/yyisvqakf3m3lh9j35yjrsxc9p459w5w-nix-expr-aarch64-unknown-linux-musl-2.31.2.drv' on 'ssh-ng://nix-ssh@m2u' failed: Cannot build '/nix/store/yyisvqakf3m3lh9j35yjrsxc9p459w5w-nix-expr-aarch64-unknown-linux-musl-2.31.2.drv'.
┃        Reason: builder failed with exit code 1.
┃        Output paths:
┃          /nix/store/30w8b1v8g89zp8xr2l2chpil7n759h8d-nix-expr-aarch64-unknown-linux-musl-2.31.2-debug
┃          /nix/store/6cwcr4dq8jkprdm3nw1z5c0ciwhvqian-nix-expr-aarch64-unknown-linux-musl-2.31.2
┃          /nix/store/z8pki19hszkc9wwd1ncjqx69ghjh77ab-nix-expr-aarch64-unknown-linux-musl-2.31.2-dev
┃        Last 25 log lines:
┃        > [27/35] Compiling C++ object libnixexpr.so.p/eval-error.cc.o
┃        > [28/35] Compiling C++ object libnixexpr.so.p/json-to-value.cc.o
┃        > [29/35] Compiling C++ object libnixexpr.so.p/eval-profiler-settings.cc.o
┃        > [30/35] Compiling C++ object libnixexpr.so.p/primops_context.cc.o
┃        > [31/35] Compiling C++ object libnixexpr.so.p/eval.cc.o
┃        > [32/35] Compiling C++ object libnixexpr.so.p/eval-settings.cc.o
┃        > [33/35] Compiling C++ object libnixexpr.so.p/nixexpr.cc.o
┃        > [34/35] Compiling C++ object libnixexpr.so.p/primops.cc.o
┃        > [35/35] Linking target libnixexpr.so
┃        > FAILED: [code=1] libnixexpr.so
┃        > aarch64-unknown-linux-musl-g++  -o libnixexpr.so libnixexpr.so.p/meson-generated_.._parser-tab.cc.o libnixexpr.so.p/meson-generated_.._lexer-tab.cc.o libnixexpr.so.p/attr-path.cc.o libnixexpr.so.p/attr-set.cc.o libnixexpr.so.p/eval-cache.cc.o l…
┃        > /nix/store/nl59fryy8axlnrsbznxn0zqk79s0m6xx-fortify-headers-1.1alpine3/include/stdio.h: In function '__to_xstring.constprop':
┃        > /nix/store/nl59fryy8axlnrsbznxn0zqk79s0m6xx-fortify-headers-1.1alpine3/include/stdio.h:80:28: error: inlining failed in call to 'always_inline' 'vsnprintf': function body can be overwritten at link time
┃        >    80 | _FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n,
┃        >       |                            ^
┃        > /nix/store/fnzv66zl645i4ww95aji5gybb5glq7w8-aarch64-unknown-linux-musl-gcc-14.3.0/include/c++/14.3.0/ext/string_conversions.h:113:32: note: called from here
┃        >   113 |       const int __len = __convf(__s, __n, __fmt, __args);
┃        >       |                                ^
┃        > make: *** [/build/ccBDxfRO.mk:86: /build/ccncA3uz.ltrans28.ltrans.o] Error 1
┃        > make: *** Waiting for unfinished jobs....
┃        > lto-wrapper: fatal error: make returned 2 exit status
┃        > compilation terminated.
┃        > /nix/store/d53k5mwl4lhbz2ax5s5b0vkc64g7lnsx-aarch64-unknown-linux-musl-binutils-2.44/bin/aarch64-unknown-linux-musl-ld: error: lto-wrapper failed
┃        > collect2: error: ld returned 1 exit status
┃        > ninja: build stopped: subcommand failed.
┃        For full logs, run:
┃          nix log /nix/store/yyisvqakf3m3lh9j35yjrsxc9p459w5w-nix-expr-aarch64-unknown-linux-musl-2.31.2.drv

15:32:19
@matthewcroughan:defenestrate.itmatthewcroughanweird, nix isn't building on musl on nixos-unstable15:32:27
@matthewcroughan:defenestrate.itmatthewcroughanmaybe gcc 15 fixed this 15:32:36
@midischwarz12:libg.somidischwarz12 joined the room.20:33:05
12 Oct 2025
@dramforever:matrix.orgdramforeverthere's some problems with static linking on aarch64-linux on unstable rn00:22:21
@dramforever:matrix.orgdramforeveri know it doesn't look like you're static linking but maybe it's related00:22:52
@dramforever:matrix.orgdramforever
diff --git a/pkgs/tools/package-management/nix/common-meson.nix b/pkgs/tools/package-management/nix/common-meson.nix
index 66a221c55521..40094ecac21b 100644
--- a/pkgs/tools/package-management/nix/common-meson.nix
+++ b/pkgs/tools/package-management/nix/common-meson.nix
@@ -101,8 +101,6 @@ stdenv.mkDerivation (finalAttrs: {
     "doc"
   ];
 
-  hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
-
   hardeningDisable = [
     "shadowstack"
   ]
00:26:46
@dramforever:matrix.orgdramforeverthis should come when the current ongoing staging-next merges00:27:14
@dramforever:matrix.orgdramforeveri'll try it now we'll see00:27:27
@dramforever:matrix.orgdramforeverugh too much to build00:33:13
@matthewcroughan:defenestrate.itmatthewcroughanYeah this is why I got an m2 ultra00:40:07

Show newer messages


Back to Room ListRoom Version: 6