Skip to content

Commit a233db5

Browse files
nikictgross35
authored andcommitted
Don't build out of line atomics support code for uefi
llvm/llvm-project#116706 added Windows support to cpu_model. Compiling for UEFI also goes through that code path, because we treat it as a windows target. However, including windows.h is not actually going to work (and the used API would not be available in an UEFI environment). Disable building of cpu_model on UEFI to fix this.
1 parent 195cc97 commit a233db5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,10 @@ mod c {
644644

645645
// Include out-of-line atomics for aarch64, which are all generated by supplying different
646646
// sets of flags to the same source file.
647-
// Note: Out-of-line aarch64 atomics are not supported by the msvc toolchain (#430).
647+
// Note: Out-of-line aarch64 atomics are not supported by the msvc toolchain (#430) and
648+
// on uefi.
648649
let src_dir = root.join("lib/builtins");
649-
if target.arch == "aarch64" && target.env != "msvc" {
650+
if target.arch == "aarch64" && target.env != "msvc" && target.os != "uefi" {
650651
// See below for why we're building these as separate libraries.
651652
build_aarch64_out_of_line_atomics_libraries(&src_dir, cfg);
652653

0 commit comments

Comments
 (0)