Nix Cross Compiling | 581 Members | |
| 126 Servers |
| Sender | Message | Time |
|---|---|---|
| 14 Feb 2025 | ||
| * Hello. I am trying to clean up my build process. I am attempting to use the
and then it is called with
This fails with the error
The build target is armv6m, and I am building on x86. Is there some way to provide it the info it needs? Note that if I instance a dedicated cross instance with
It almost works (it gets to the build stage but hits an error I've not seen with the arm-embedded compiler), but it requires compiling GCC from source which is not really needed. | 17:46:29 | |
| No version here https://github.com/NixOS/nixpkgs/blob/795a271ba11f5a7875e314d2d197a7bd361e695f/lib/systems/parse.nix#L111 | 17:53:43 | |
arm-embedded is arm-none-eabi | 17:54:04 | |
| Theres no way to know the cpu.version for arm-none-eabi | 17:55:19 | |
| * I think theres no way to know the cpu.version for arm-none-eabi from the name | 17:55:28 | |
| * I think theres no way to know the cpu.version for arm-none-eabi from the triplet | 17:55:34 | |
The systemd conditional should check stdenv.hostPlatform.parsed.cpu ? version | 17:55:55 | |
screcord -> ghostscript -> cups -> systemd | 18:00:14 | |
| If srecord does not need to know targetPlatform (not compiler) then you can put it in depsBuildBuild | 18:00:51 | |
| from pkgsBuildBuild | 18:00:57 | |
| * If srecord does not need to know targetPlatform (is not a compiler) then you can put it in depsBuildBuild | 18:05:23 | |
| That did not change anything | 18:06:42 | |
| 18:10:42 | |
Oh, I did not know of pkgs.pkgsBuildBuild I thought you just meant moving it to depsBuildBuild = [pkgs.pkgsBuildHost.srecord];. That does work. Thanks. | 18:12:56 | |
| What's the difference between pkgsBuildHost and pkgsBuildBuild? | 18:13:34 | |
| Compilers in pkgsBuildBuild compile for build platform Compilers in pkgsBuildHost compile for host platform | 18:14:48 | |
| https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-depsBuildBuild | 18:18:23 | |
| Cool, thanks for your help. | 18:18:52 | |
| rosssmyth: https://github.com/NixOS/nixpkgs/pull/382110 | 18:23:20 | |
| you shouldn't need to explicitly specify the package set | 18:29:02 | |
splicing ensures that depsBuildBuild = [ srecord ]; should do the right thing | 18:29:11 | |
| (callPackage has spliced packages so you don't have to specify the set) | 18:29:45 | |
| Oh, I see. | 18:33:03 | |
| Then for the compiler itself, is there a way I can override the gcc wrapper settings? Currently it is compiling in ARM mode, while it needs to be in thumb. I once again tried a custom nixpkgs instance with
But that starts recompiling all of gcc again. I see this setting Which is pretty much what I want. | 18:49:17 | |
| * Then for the compiler itself, is there a way I can override the gcc wrapper settings? Currently it is compiling in ARM mode, while it needs to be in thumb. I once again tried a custom nixpkgs instance with
But that starts recompiling all of gcc again. I see this setting Which is pretty much what I want. | 18:51:25 | |
| the rebuilds are because you specified arch and cpu | 18:56:44 | |
| Redacted or Malformed Event | 18:56:47 | |
Download image.png | 18:56:52 | |
here's a nix-diff | 18:56:57 | |
I'm not sure if gcc really needs those 2 flags because cc-wrapper has -mcpu and -march | 18:59:19 | |