Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1a134d8

Browse files
committed
Auto merge of rust-lang#121854 - matthiaskrgr:rollup-uulg3t8, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#119199 (Add arm64ec-pc-windows-msvc target) - rust-lang#121416 (Improve error messages for generics with default parameters) - rust-lang#121475 (Add tidy check for .stderr/.stdout files for non-existent test revisions) - rust-lang#121736 (Remove `Mutex::unlock` Function) - rust-lang#121784 (Make the success arms of `if lhs || rhs` meet up in a separate block) - rust-lang#121818 (CFI: Remove unused `typeid_for_fnsig`) - rust-lang#121819 (Handle stashing of delayed bugs) - rust-lang#121828 (Remove unused fluent messages) - rust-lang#121831 (Fix typo in comment) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6db96de + a9d3734 commit 1a134d8

File tree

68 files changed

+552
-860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+552
-860
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ version = "0.1.0"
447447

448448
[[package]]
449449
name = "cc"
450-
version = "1.0.79"
450+
version = "1.0.88"
451451
source = "registry+https://github.com/rust-lang/crates.io-index"
452-
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
452+
checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc"
453453

454454
[[package]]
455455
name = "cfg-if"

compiler/rustc_builtin_macros/messages.ftl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ builtin_macros_requires_cfg_pattern =
221221
macro requires a cfg-pattern as an argument
222222
.label = cfg-pattern required
223223
224-
builtin_macros_should_panic = functions using `#[should_panic]` must return `()`
225-
226-
builtin_macros_test_arg_non_lifetime = functions used as tests can not have any non-lifetime generic parameters
227-
228-
builtin_macros_test_args = functions used as tests can not have any arguments
229-
230224
builtin_macros_test_bad_fn = {$kind} functions cannot be used for tests
231225
.label = `{$kind}` because of this
232226

compiler/rustc_codegen_llvm/src/back/archive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fn llvm_machine_type(cpu: &str) -> LLVMMachineType {
5555
"x86_64" => LLVMMachineType::AMD64,
5656
"x86" => LLVMMachineType::I386,
5757
"aarch64" => LLVMMachineType::ARM64,
58+
"arm64ec" => LLVMMachineType::ARM64EC,
5859
"arm" => LLVMMachineType::ARM,
5960
_ => panic!("unsupported cpu type {cpu}"),
6061
}

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub enum LLVMMachineType {
5656
AMD64 = 0x8664,
5757
I386 = 0x14c,
5858
ARM64 = 0xaa64,
59+
ARM64EC = 0xa641,
5960
ARM = 0x01c0,
6061
}
6162

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,13 @@ impl<'a> IntoIterator for LLVMFeature<'a> {
204204
// which might lead to failures if the oldest tested / supported LLVM version
205205
// doesn't yet support the relevant intrinsics
206206
pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> LLVMFeature<'a> {
207-
let arch = if sess.target.arch == "x86_64" { "x86" } else { &*sess.target.arch };
207+
let arch = if sess.target.arch == "x86_64" {
208+
"x86"
209+
} else if sess.target.arch == "arm64ec" {
210+
"aarch64"
211+
} else {
212+
&*sess.target.arch
213+
};
208214
match (arch, s) {
209215
("x86", "sse4.2") => {
210216
LLVMFeature::with_dependency("sse4.2", TargetFeatureFoldStrength::EnableOnly("crc32"))

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
266266
// Generic x86
267267
"x86" => emit_ptr_va_arg(bx, addr, target_ty, false, Align::from_bytes(4).unwrap(), true),
268268
// Windows AArch64
269-
"aarch64" if target.is_like_windows => {
269+
"aarch64" | "arm64ec" if target.is_like_windows => {
270270
emit_ptr_va_arg(bx, addr, target_ty, false, Align::from_bytes(8).unwrap(), false)
271271
}
272272
// macOS / iOS AArch64

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
# tidy-alphabetical-start
88
ar_archive_writer = "0.1.5"
99
bitflags = "2.4.1"
10-
cc = "1.0.69"
10+
cc = "1.0.88"
1111
itertools = "0.11"
1212
jobserver = "0.1.28"
1313
pathdiff = "0.2.0"

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::path::Path;
88
use object::write::{self, StandardSegment, Symbol, SymbolSection};
99
use object::{
1010
elf, pe, xcoff, Architecture, BinaryFormat, Endianness, FileFlags, Object, ObjectSection,
11-
ObjectSymbol, SectionFlags, SectionKind, SymbolFlags, SymbolKind, SymbolScope,
11+
ObjectSymbol, SectionFlags, SectionKind, SubArchitecture, SymbolFlags, SymbolKind, SymbolScope,
1212
};
1313

1414
use rustc_data_structures::memmap::Mmap;
@@ -182,37 +182,40 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
182182
Endian::Little => Endianness::Little,
183183
Endian::Big => Endianness::Big,
184184
};
185-
let architecture = match &sess.target.arch[..] {
186-
"arm" => Architecture::Arm,
187-
"aarch64" => {
185+
let (architecture, sub_architecture) = match &sess.target.arch[..] {
186+
"arm" => (Architecture::Arm, None),
187+
"aarch64" => (
188188
if sess.target.pointer_width == 32 {
189189
Architecture::Aarch64_Ilp32
190190
} else {
191191
Architecture::Aarch64
192-
}
193-
}
194-
"x86" => Architecture::I386,
195-
"s390x" => Architecture::S390x,
196-
"mips" | "mips32r6" => Architecture::Mips,
197-
"mips64" | "mips64r6" => Architecture::Mips64,
198-
"x86_64" => {
192+
},
193+
None,
194+
),
195+
"x86" => (Architecture::I386, None),
196+
"s390x" => (Architecture::S390x, None),
197+
"mips" | "mips32r6" => (Architecture::Mips, None),
198+
"mips64" | "mips64r6" => (Architecture::Mips64, None),
199+
"x86_64" => (
199200
if sess.target.pointer_width == 32 {
200201
Architecture::X86_64_X32
201202
} else {
202203
Architecture::X86_64
203-
}
204-
}
205-
"powerpc" => Architecture::PowerPc,
206-
"powerpc64" => Architecture::PowerPc64,
207-
"riscv32" => Architecture::Riscv32,
208-
"riscv64" => Architecture::Riscv64,
209-
"sparc64" => Architecture::Sparc64,
210-
"avr" => Architecture::Avr,
211-
"msp430" => Architecture::Msp430,
212-
"hexagon" => Architecture::Hexagon,
213-
"bpf" => Architecture::Bpf,
214-
"loongarch64" => Architecture::LoongArch64,
215-
"csky" => Architecture::Csky,
204+
},
205+
None,
206+
),
207+
"powerpc" => (Architecture::PowerPc, None),
208+
"powerpc64" => (Architecture::PowerPc64, None),
209+
"riscv32" => (Architecture::Riscv32, None),
210+
"riscv64" => (Architecture::Riscv64, None),
211+
"sparc64" => (Architecture::Sparc64, None),
212+
"avr" => (Architecture::Avr, None),
213+
"msp430" => (Architecture::Msp430, None),
214+
"hexagon" => (Architecture::Hexagon, None),
215+
"bpf" => (Architecture::Bpf, None),
216+
"loongarch64" => (Architecture::LoongArch64, None),
217+
"csky" => (Architecture::Csky, None),
218+
"arm64ec" => (Architecture::Aarch64, Some(SubArchitecture::Arm64EC)),
216219
// Unsupported architecture.
217220
_ => return None,
218221
};
@@ -227,6 +230,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
227230
};
228231

229232
let mut file = write::Object::new(binary_format, architecture, endianness);
233+
file.set_sub_architecture(sub_architecture);
230234
if sess.target.is_like_osx {
231235
if macho_is_arm64e(&sess.target) {
232236
file.set_macho_cpu_subtype(object::macho::CPU_SUBTYPE_ARM64E);

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,10 @@ pub fn linking_symbol_name_for_instance_in_crate<'tcx>(
563563
return undecorated;
564564
}
565565

566-
let x86 = match &target.arch[..] {
567-
"x86" => true,
568-
"x86_64" => false,
566+
let prefix = match &target.arch[..] {
567+
"x86" => Some('_'),
568+
"x86_64" => None,
569+
"arm64ec" => Some('#'),
569570
// Only x86/64 use symbol decorations.
570571
_ => return undecorated,
571572
};
@@ -602,8 +603,8 @@ pub fn linking_symbol_name_for_instance_in_crate<'tcx>(
602603
Conv::X86Stdcall => ("_", "@"),
603604
Conv::X86VectorCall => ("", "@@"),
604605
_ => {
605-
if x86 {
606-
undecorated.insert(0, '_');
606+
if let Some(prefix) = prefix {
607+
undecorated.insert(0, prefix);
607608
}
608609
return undecorated;
609610
}

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,11 @@ impl CrateInfo {
907907
lang_items::required(tcx, l).then_some(name)
908908
})
909909
.collect();
910-
let prefix = if target.is_like_windows && target.arch == "x86" { "_" } else { "" };
910+
let prefix = match (target.is_like_windows, target.arch.as_ref()) {
911+
(true, "x86") => "_",
912+
(true, "arm64ec") => "#",
913+
_ => "",
914+
};
911915

912916
// This loop only adds new items to values of the hash map, so the order in which we
913917
// iterate over the values is not important.

0 commit comments

Comments
 (0)