Skip to content

Commit

Permalink
Don't build out of line atomics support code for uefi
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic authored and tgross35 committed Jan 28, 2025
1 parent 195cc97 commit a233db5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,10 @@ mod c {

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

Expand Down

0 comments on commit a233db5

Please sign in to comment.