| 14 Feb 2025 |
Artturin | arm-embedded is arm-none-eabi | 17:54:04 |
Artturin | Theres no way to know the cpu.version for arm-none-eabi | 17:55:19 |
Artturin | * I think theres no way to know the cpu.version for arm-none-eabi from the name | 17:55:28 |
Artturin | * I think theres no way to know the cpu.version for arm-none-eabi from the triplet | 17:55:34 |
Artturin | The systemd conditional should check stdenv.hostPlatform.parsed.cpu ? version | 17:55:55 |
Artturin | screcord -> ghostscript -> cups -> systemd | 18:00:14 |
Artturin | If srecord does not need to know targetPlatform (not compiler) then you can put it in depsBuildBuild | 18:00:51 |
Artturin | from pkgsBuildBuild | 18:00:57 |
Artturin | * If srecord does not need to know targetPlatform (is not a compiler) then you can put it in depsBuildBuild | 18:05:23 |
rosssmyth | That did not change anything | 18:06:42 |
Artturin | nix-repl> pkgsCross.arm-embedded.pkgsBuildBuild.srecord
«derivation /nix/store/88q413an8c5nnrhan3lqk3ggsjdwal7v-srecord-1.64.drv»
| 18:10:42 |
rosssmyth | 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 |
rosssmyth | What's the difference between pkgsBuildHost and pkgsBuildBuild? | 18:13:34 |
Artturin | Compilers in pkgsBuildBuild compile for build platform
Compilers in pkgsBuildHost compile for host platform | 18:14:48 |
Artturin | https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-depsBuildBuild | 18:18:23 |
rosssmyth | Cool, thanks for your help. | 18:18:52 |
Artturin | rosssmyth: https://github.com/NixOS/nixpkgs/pull/382110 | 18:23:20 |
emily | you shouldn't need to explicitly specify the package set | 18:29:02 |
emily | splicing ensures that depsBuildBuild = [ srecord ]; should do the right thing | 18:29:11 |
Artturin | (callPackage has spliced packages so you don't have to specify the set) | 18:29:45 |
rosssmyth | Oh, I see. | 18:33:03 |
rosssmyth | 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
armPkgs = import nixpkgs {
inherit system;
crossSystem = {
config = "arm-none-eabi";
libc = "newlib";
gcc = {
arch = "armv6m";
cpu = "cortex-m0";
};
};
};
But that starts recompiling all of gcc again. I see this setting https://github.com/NixOS/nixpkgs/blob/b44babb85a1294e6b0e20ccc2c54cd0f62a84ceb/pkgs/build-support/cc-wrapper/default.nix#L248
Which is pretty much what I want.
| 18:49:17 |
rosssmyth | * 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
armPkgs = import nixpkgs {
inherit system;
crossSystem = {
config = "arm-none-eabi";
libc = "newlib";
gcc = {
arch = "armv6m";
cpu = "cortex-m0";
thumb = true;
};
};
};
But that starts recompiling all of gcc again. I see this setting https://github.com/NixOS/nixpkgs/blob/b44babb85a1294e6b0e20ccc2c54cd0f62a84ceb/pkgs/build-support/cc-wrapper/default.nix#L248
Which is pretty much what I want.
| 18:51:25 |
Artturin | the rebuilds are because you specified arch and cpu | 18:56:44 |
Artturin | Redacted or Malformed Event | 18:56:47 |
Artturin |  Download image.png | 18:56:52 |
Artturin | here's a nix-diff | 18:56:57 |
Artturin | I'm not sure if gcc really needs those 2 flags because cc-wrapper has -mcpu and -march | 18:59:19 |
rosssmyth | Yeah that's what I was hoping it would set 😅. | 19:00:10 |
Artturin | stdenv = overrideCC stdenv (buildPackages.wrapCC (stdenv.cc // { stdenv.cc.targetPlatform = stdenv.cc.targetPlatform // { gcc = stdenv.cc.targetPlatform.gcc // { arch = "arv6m"; cpu = "cortex-m0"; thumb = true; }; }; })) | 19:07:09 |