Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib.systems: accept *-unknown-elf triples #230160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ rec {
else { cpu = elemAt l 0; kernel = elemAt l 1; };
"3" =
# cpu-kernel-environment
if elemAt l 1 == "linux" ||
elem (elemAt l 2) ["eabi" "eabihf" "elf" "gnu"]
if elemAt l 1 == "linux"
then {
cpu = elemAt l 0;
kernel = elemAt l 1;
Expand All @@ -429,16 +428,20 @@ rec {
}
# cpu-vendor-os
else if elemAt l 1 == "apple" ||
elem (elemAt l 2) [ "wasi" "redox" "mmixware" "ghcjs" "mingw32" ] ||
elem (elemAt l 2) [ "elf" "ghcjs" "gnu" "mingw32" "mmixware" "redox" "wasi" ] ||
hasPrefix "eabi" (elemAt l 2) ||
hasPrefix "freebsd" (elemAt l 2) ||
hasPrefix "netbsd" (elemAt l 2) ||
hasPrefix "genode" (elemAt l 2)
then {
kernel = "none";
} // {
cpu = elemAt l 0;
vendor = elemAt l 1;
kernel = if elemAt l 2 == "mingw32"
then "windows" # autotools breaks on -gnu for window
else elemAt l 2;
vendor = if elemAt l 1 == "none" then "unknown" else elemAt l 1;
${if hasPrefix "eabi" (elemAt l 2) || elem (elemAt l 2) [ "elf" "gnu" ] then "abi" else "kernel"} =
if elemAt l 2 == "mingw32"
then "windows" # autotools breaks on -gnu for windows
else elemAt l 2;
}
else throw "Target specification with 3 components is ambiguous";
"4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
Expand Down