Skip to content

Commit 9182f44

Browse files
Use -windows-gnu for all UEFI targets
This restores the behavior prior to #1252, when the UEFI targets were hardcoded in src/lib.rs.
1 parent 7a786c5 commit 9182f44

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

dev-tools/gen-target-info/src/main.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ fn generate_target_mapping(f: &mut File, target_specs: &RustcTargetSpecs) -> std
2626
let env = spec.env.as_deref().unwrap_or("");
2727
let abi = spec.abi.as_deref().unwrap_or("");
2828

29-
// Remove deployment target information from LLVM target triples (we
30-
// will add this in another part of CC).
31-
//
32-
// FIXME(madsmtm): Should become unnecessary after
33-
// https://github.com/rust-lang/rust/pull/131037
3429
let unversioned_llvm_target = if spec.llvm_target.contains("apple") {
30+
// Remove deployment target information from LLVM target triples (we
31+
// will add this in another part of CC).
32+
//
33+
// FIXME(madsmtm): Should become unnecessary after
34+
// https://github.com/rust-lang/rust/pull/131037
3535
let mut components = spec.llvm_target.split("-").collect::<Vec<_>>();
3636

3737
components[2] = components[2].trim_end_matches(|c: char| c.is_numeric() || c == '.');
3838

3939
components.join("-")
40+
} else if os == "uefi" && spec.llvm_target.ends_with("windows") {
41+
format!("{}-gnu", spec.llvm_target)
4042
} else {
4143
spec.llvm_target.clone()
4244
};

src/target/generated.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
409409
os: "uefi",
410410
env: "",
411411
abi: "",
412-
unversioned_llvm_target: "aarch64-unknown-windows",
412+
unversioned_llvm_target: "aarch64-unknown-windows-gnu",
413413
},
414414
),
415415
(
@@ -3205,7 +3205,7 @@ pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
32053205
os: "uefi",
32063206
env: "",
32073207
abi: "",
3208-
unversioned_llvm_target: "x86_64-unknown-windows",
3208+
unversioned_llvm_target: "x86_64-unknown-windows-gnu",
32093209
},
32103210
),
32113211
(

0 commit comments

Comments
 (0)