!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

552 Members
116 Servers

Load older messages


SenderMessageTime
18 Dec 2025
@emilazy:matrix.orgemilythe GCC derivations have pretty extensive version conditionals14:01:20
@emilazy:matrix.orgemilythe LLVM ones are closer to being something you can reasonably override versions out-of-tree but still not really there14:01:35
@emilazy:matrix.orgemily I suggest just maintaining a fork of gcc/ 14:01:45
@emilazy:matrix.orgemily it will be less painful than a nest of hacky overrideAttrs 14:02:00
@emilazy:matrix.orgemily(I also suggest putting this effort into making a newer GCC work instead)14:02:15
@bake.monorail:matrix.orgbake.monorailOK, thanks for the feedback14:02:29
@rosssmyth:matrix.orgrosssmyth

Something I was considering yesterday:

Currently we have gcc-arm-embedded, which is a pre-built GCC distribution. It has a manifest with all the configure flags. How hard is it to add a new version of GCC? I took a little look and there's a lot of machinery all over the place in the GCC directory. Maybe easier to use the NG package set?

15:22:17
@k900:0upti.meK900Add a new version of GCC that does what?15:23:37
@k900:0upti.meK900Builds a proper nixpkgs stdenv/15:23:50
@k900:0upti.meK900* Builds a proper nixpkgs stdenv?15:23:51
@k900:0upti.meK900Because gcc-arm-embedded is extremely not that15:23:57
@emilazy:matrix.orgemily gcc-arm-embedded is basically just there because we don't have working stdenvs for its targets, I think. 15:32:21
@rosssmyth:matrix.orgrosssmythyes15:34:15
@rosssmyth:matrix.orgrosssmythNixpkg's cross-compilation infra doesn't really work with some targets15:34:38
@rosssmyth:matrix.orgrosssmythUnfortunately 15:34:48
@rosssmyth:matrix.orgrosssmythI am an avid user of it15:35:00
@rosssmyth:matrix.orgrosssmyth * I am an avid user of gcc-arm-embedded 15:35:14
@rosssmyth:matrix.orgrosssmythBut it would be nice for it to be better integrated with Nixpkgs so that more things work better like clang-tools things 15:36:36
@emilazy:matrix.orgemilywe can just fix that, though.15:37:51
@emilazy:matrix.orgemilyI mean, "just"15:37:55
@emilazy:matrix.orgemily it's effort better spent than trying to integrate gcc-arm-embedded further, IMO 15:38:07
@emilazy:matrix.orgemilysource-building the right GCC is not really the hard part15:38:17
@rosssmyth:matrix.orgrosssmyth I put some effort into that once and it will probably require a breaking change in the embedded parts of lib.systems or multilib support. For example when one writes lib.systems.examples.arm-embedded that will compile a GCC that only targets Armv4 (iirc). So ror any reasonable usage multilib is required because FUCK compiling GCC for every little arm variant. But if you try to make a GCC for specific targets, it also fails (I can't remember why, it's been a while since I tried). There's also build system funniness, such as CMake interpreting embedded target triple differently than GCC and Clang. 15:45:35
@rosssmyth:matrix.orgrosssmyth * I put some effort into that once and it will probably require a breaking change in the embedded parts of lib.systems or multilib support. For example when one writes lib.systems.examples.arm-embedded that will compile a GCC that only targets Armv4 (iirc). So for any reasonable usage multilib is required because FUCK compiling GCC for every little arm variant. But if you try to make a GCC for specific targets, it also fails (I can't remember why, it's been a while since I tried). There's also build system funniness, such as CMake interpreting embedded target triple differently than GCC and Clang. 15:45:50
@emilazy:matrix.orgemily the embedded parts of lib.systems are sufficiently little used that I'm not very concerned about breaking changes to them 15:46:05
@rosssmyth:matrix.orgrosssmyth * I put some effort into that once and it will probably require a breaking change in the embedded parts of lib.systems or multilib support. For example when one writes lib.systems.examples.arm-embedded that will compile a GCC that only targets Armv4 (iirc). So for any reasonable usage multilib is required because FUCK compiling GCC for every little arm variant. But if you try to make a GCC for specific targets, it also fails (I can't remember why, it's been a while since I tried). There's also build system funniness, such as CMake interpreting embedded target triples differently than GCC and Clang. 15:46:07
@emilazy:matrix.orgemily(I also don't think one GCC build per target is that bad though)15:46:18
@emilazy:matrix.orgemily(if you don't want to rebuild a compiler per target my suggestion is to use LLVM :) )15:46:26
@rosssmyth:matrix.orgrosssmythI would like to use llvm at work but that has its own challenges that I have not been able to solve yet. Mainly around libgcc and linker scripts. 15:47:12
@rosssmyth:matrix.orgrosssmythand asm15:48:07

Show newer messages


Back to Room ListRoom Version: 6