!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
127 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
6 May 2025
@rosssmyth:matrix.orgrosssmyth

I was messing around trying to see if I could build a stdenv with gcc-arm-embedded last night. Feels like it should be possible, but I'm unsure of the exact incantation to do so. I'm starting with an embedded stdenv, then trying to override it.

The first issue that apparently cc-wrapper complain if your target platform is not linux or darwin, so I have to pass NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM. Whether this is actually unsupported or not I'm unsure.

I've tried it two ways: One using pkgs.wrapCCWith { stdenvNoCC = pkgsCross.stdenvNoCC; } and one with pkgsCross.wrapCCWith. The former got me closer, but for some reason the wrapper were not being symlinked to the bin dir. Looking at the source I tried a few things, but was unsuccessful in getting it to work. The latter fails because even though I'm trying to make a nolibc wrapper, the gcc wrapper seems to try and access libc directories at pkgs/development/compilers/gcc/common/configure-flags.nix:112:31, resulting in a cannot coerce null to string.

You can find my progress so far here:
https://github.com/RossSmyth/armRepro/tree/NativeWrap
https://github.com/RossSmyth/armRepro/tree/EmbedWrap

If anyone has tried this in the past, let me know if you may know how to wrangle it into shape

16:50:03
7 May 2025
@aerden:matrix.orgAerden joined the room.07:55:08
@szlend:matrix.orgszlend is there any way to get a pkgs instance where buildPlatform != hostPlatform != targetPlatform? 20:30:56
@qyliss:fairydust.spaceAlyssa RossI don't think so20:37:40

Show newer messages


Back to Room ListRoom Version: 6