Skip to content

Commit 51f7a1b

Browse files
committed
Unrolled build for #164855 in rollup 164865
Rollup merge of #164855 - bjorn3:unmangle_personality, r=Mark-Simulacrum Stop mangling rust_eh_personality again for now Some projects manually define rust_eh_personality as they use no_std on a target where libcore is compiled with panic=unwind and thus need rust_eh_personality to be present while it is only defined in libstd. These projects don't want to use unstable features and thus can't use a proper #[lang = "eh_personality"]. This reverts just the symbol mangling change of #148413. It preserves all the refactors to prevent codegen backends from hard coding the symbol name, so we can easily change it back to mangled in the future again.
2 parents df87fa6 + 46bc916 commit 51f7a1b

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎compiler/rustc_symbol_mangling/src/v0.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ pub fn eh_personality_symbol<'tcx>(tcx: TyCtxt<'tcx>) -> String {
132132

133133
pub fn mangle_internal_symbol<'tcx>(tcx: TyCtxt<'tcx>, item_name: &str) -> String {
134134
match item_name {
135+
// Some projects manually define rust_eh_personality as they use no_std on a target where
136+
// libcore is compiled with panic=unwind and thus need rust_eh_personality to be present
137+
// while it is only defined in libstd. These projects don't want to use unstable features
138+
// and thus can't use a proper #[lang = "eh_personality"]
139+
// FIXME mangle again once no_std on a target with std support doesn't need it or build-std
140+
// is possible on stable for non-Cargo build systems.
141+
"rust_eh_personality" => return item_name.to_owned(),
135142
// Apple availability symbols need to not be mangled to be usable by
136143
// C/Objective-C code.
137144
"__isPlatformVersionAtLeast" | "__isOSVersionAtLeast" => return item_name.to_owned(),

‎tests/run-make/symbols-all-mangled/rmake.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ fn is_symbol_ok(sym: &str) -> bool {
3434
return true;
3535
}
3636

37+
if sym == "rust_eh_personality" {
38+
return true; // Unfortunately we have to not mangle this for now
39+
}
40+
3741
false
3842
}
3943

‎tests/ui/sanitizer/dataflow-abilist.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,4 +494,5 @@ fun:_ZN4core*=uninstrumented
494494
fun:_R*4core*=uninstrumented
495495
fun:_ZN3std*=uninstrumented
496496
fun:_R*3std*=uninstrumented
497+
fun:rust_eh_personality=uninstrumented
497498
fun:_R*__rustc*=uninstrumented

0 commit comments

Comments
 (0)