Skip to content

Commit 2183276

Browse files
committed
Rename unversioned_llvm_target to llvm_target
Since we no longer version the LLVM target, it is no longer that important to call out that the LLVM target is unversioned.
1 parent b6539dd commit 2183276

File tree

5 files changed

+305
-318
lines changed

5 files changed

+305
-318
lines changed

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

+4-15
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,9 @@ 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-
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
35-
let mut components = spec.llvm_target.split("-").collect::<Vec<_>>();
36-
37-
components[2] = components[2].trim_end_matches(|c: char| c.is_numeric() || c == '.');
38-
39-
components.join("-")
29+
// FIXME(madsmtm): Unnecessary once we bump MSRV to Rust 1.74
30+
let llvm_target = if spec.llvm_target == "armv7-apple-ios7.0.0" {
31+
"armv7-apple-ios".to_string()
4032
} else if os == "uefi" {
4133
// Override the UEFI LLVM targets.
4234
//
@@ -80,10 +72,7 @@ fn generate_target_mapping(f: &mut File, target_specs: &RustcTargetSpecs) -> std
8072
writeln!(f, " os: {os:?},")?;
8173
writeln!(f, " env: {env:?},")?;
8274
writeln!(f, " abi: {abi:?},")?;
83-
writeln!(
84-
f,
85-
" unversioned_llvm_target: {unversioned_llvm_target:?},"
86-
)?;
75+
writeln!(f, " llvm_target: {llvm_target:?},")?;
8776
writeln!(f, " }},")?;
8877
writeln!(f, " ),")?;
8978
}

src/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ impl Build {
21952195
// and instead pass that via `-mmacosx-version-min=` and similar flags, for
21962196
// better compatibility with older versions of Clang that has poor support for
21972197
// versioned target names (especially when it comes to configuration files).
2198-
cmd.push_cc_arg(format!("--target={}", target.unversioned_llvm_target).into());
2198+
cmd.push_cc_arg(format!("--target={}", target.llvm_target).into());
21992199
}
22002200
}
22012201
ToolFamily::Msvc { clang_cl } => {
@@ -2211,9 +2211,7 @@ impl Build {
22112211
cmd.push_cc_arg("-m32".into());
22122212
cmd.push_cc_arg("-arch:IA32".into());
22132213
} else {
2214-
cmd.push_cc_arg(
2215-
format!("--target={}", target.unversioned_llvm_target).into(),
2216-
);
2214+
cmd.push_cc_arg(format!("--target={}", target.llvm_target).into());
22172215
}
22182216
} else if target.full_arch == "i586" {
22192217
cmd.push_cc_arg("-arch:IA32".into());

src/target.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) struct TargetInfo<'a> {
4747
///
4848
/// NOTE: You should never need to match on this explicitly, use the other
4949
/// fields on [`TargetInfo`] instead.
50-
pub unversioned_llvm_target: &'a str,
50+
pub llvm_target: &'a str,
5151
}
5252

5353
impl FromStr for TargetInfo<'_> {

0 commit comments

Comments
 (0)