Skip to content

Commit 704e1a5

Browse files
authored
lib.systems: add uefi support (#477645)
2 parents 8fad133 + 9f605ca commit 704e1a5

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

lib/systems/doubles.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ let
109109
"aarch64-windows"
110110
"x86_64-windows"
111111
"i686-windows"
112+
113+
# UEFI
114+
"aarch64-uefi"
115+
"x86_64-uefi"
112116
];
113117

114118
allParsed = map parse.mkSystemFromString all;
@@ -189,6 +193,7 @@ in
189193
redox = filterDoubles predicates.isRedox;
190194
windows = filterDoubles predicates.isWindows;
191195
genode = filterDoubles predicates.isGenode;
196+
uefi = filterDoubles predicates.isUefi;
192197

193198
embedded = filterDoubles predicates.isNone;
194199
}

lib/systems/examples.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,24 @@ rec {
337337
platform = { };
338338
};
339339

340+
#
341+
# UEFI
342+
#
343+
344+
x86_64-unknown-uefi = {
345+
config = "x86_64-unknown-uefi";
346+
libc = null;
347+
useLLVM = true;
348+
linker = "lld";
349+
};
350+
351+
aarch64-unknown-uefi = {
352+
config = "aarch64-unknown-uefi";
353+
libc = null;
354+
useLLVM = true;
355+
linker = "lld";
356+
};
357+
340358
#
341359
# Windows
342360
#

lib/systems/inspect.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ rec {
431431
}
432432
];
433433

434+
isUefi = [
435+
{ kernel = kernels.uefi; }
436+
];
437+
434438
isElf = {
435439
kernel.execFormat = execFormats.elf;
436440
};

lib/systems/parse.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@ rec {
634634
execFormat = unknown;
635635
families = { };
636636
};
637+
uefi = {
638+
execFormat = pe;
639+
families = { };
640+
};
637641
}
638642
// {
639643
# aliases
@@ -849,6 +853,7 @@ rec {
849853
"mmixware"
850854
"ghcjs"
851855
"mingw32"
856+
"uefi"
852857
]
853858
|| hasPrefix "freebsd" (elemAt l 2)
854859
|| hasPrefix "netbsd" (elemAt l 2)

lib/tests/systems.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ lib.runTests (
5555
++ js
5656
++ genode
5757
++ redox
58+
++ uefi
5859
);
5960

6061
testarm = mseteq arm [
@@ -136,6 +137,7 @@ lib.runTests (
136137
"x86_64-solaris"
137138
"x86_64-windows"
138139
"x86_64-none"
140+
"x86_64-uefi"
139141
];
140142

141143
testcygwin = mseteq cygwin [

0 commit comments

Comments
 (0)