Skip to content

Commit

Permalink
lib.systems.examples: use four component triples for embedded
Browse files Browse the repository at this point in the history
Thanks to a [change in gnu-config] we no longer have to rely on
gnu-config interpreting `none` as a vendor and nixpkgs as a kernel.
Instead we can specify a four component triple that corresponds to how
nixpkgs interprets the shortened one because gnu-config now accepts
them (the long form at least).

As a result, we also need to make sure that an up to date gnu-config is
used for the affected platforms (everything with kernel none).

Reference #165836.

[change in gnu-config]: https://git.savannah.gnu.org/cgit/config.git/commit/?id=998ba1414387b4ce1a519be234e1609bc7912e0c
  • Loading branch information
sternenseemann committed Aug 6, 2023
1 parent 9e910fd commit 8fec22f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ rec {
riscv32 = riscv "32";

riscv64-embedded = {
config = "riscv64-none-elf";
config = "riscv64-unknown-none-elf";
libc = "newlib";
};

riscv32-embedded = {
config = "riscv32-none-elf";
config = "riscv32-unknown-none-elf";
libc = "newlib";
};

mips64-embedded = {
config = "mips64-none-elf";
config = "mips64-unknown-none-elf";
libc = "newlib";
};

mips-embedded = {
config = "mips-none-elf";
config = "mips-unknown-none-elf";
libc = "newlib";
};

Expand All @@ -153,7 +153,7 @@ rec {
};

rx-embedded = {
config = "rx-none-elf";
config = "rx-unknown-none-elf";
libc = "newlib";
};

Expand Down Expand Up @@ -189,11 +189,11 @@ rec {
};

arm-embedded = {
config = "arm-none-eabi";
config = "arm-unknown-none-eabi";
libc = "newlib";
};
armhf-embedded = {
config = "arm-none-eabihf";
config = "arm-unknown-none-eabihf";
libc = "newlib";
# GCC8+ does not build without this
# (https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg552339.html):
Expand All @@ -204,22 +204,22 @@ rec {
};

aarch64-embedded = {
config = "aarch64-none-elf";
config = "aarch64-unknown-none-elf";
libc = "newlib";
};

aarch64be-embedded = {
config = "aarch64_be-none-elf";
config = "aarch64_be-unknown-none-elf";
libc = "newlib";
};

ppc-embedded = {
config = "powerpc-none-eabi";
config = "powerpc-unknown-none-eabi";
libc = "newlib";
};

ppcle-embedded = {
config = "powerpcle-none-eabi";
config = "powerpcle-unknown-none-eabi";
libc = "newlib";
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/cross/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ in lib.init bootStages ++ [
(hostPlatform.isLinux && !buildPlatform.isLinux)
[ buildPackages.patchelf ]
++ lib.optional
(let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode;
(let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode || p.isNone;
in f hostPlatform && !(f buildPlatform) )
buildPackages.updateAutotoolsGnuConfigScriptsHook
;
Expand Down

0 comments on commit 8fec22f

Please sign in to comment.