Skip to content

Commit ed48e8d

Browse files
Skip assembly implementations on the UEFI targets
The UEFI targets link with `/SAFESEH`. That requires that objects have a symbol called [`@feat.00`]. Clang adds that symbol for COFF targets if the input is a C file, but not if the input is an ASM file. That doesn't prevent compiler_builtins or rustc from building, but using the resulting rustc to compile something that references one of the objects lacking `@feat.00` will result in a linker error. Fix by removing all the `.S` implementations when `target_os == uefi`. [`@feat.00`]: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#the-sxdata-section
1 parent 8d3af61 commit ed48e8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@ mod c {
465465
}
466466

467467
// Remove the assembly implementations that won't compile for the target
468-
if llvm_target[0] == "thumbv6m" || llvm_target[0] == "thumbv8m.base" {
468+
if llvm_target[0] == "thumbv6m" || llvm_target[0] == "thumbv8m.base" || target_os == "uefi"
469+
{
469470
let mut to_remove = Vec::new();
470471
for (k, v) in sources.map.iter() {
471472
if v.ends_with(".S") {

0 commit comments

Comments
 (0)