@@ -71,7 +71,10 @@ use super::{current_version, pack_u32_os_version};
71
71
// SAFETY: The signature is the same as what Clang expects, and we export weakly to allow linking
72
72
// both this and `libclang_rt.*.a`, similar to how `compiler-builtins` does it:
73
73
// https://github.com/rust-lang/compiler-builtins/blob/0.1.113/src/macros.rs#L494
74
- #[ cfg_attr( not( feature = "compiler-builtins-mangled-names" ) , unsafe ( no_mangle) , linkage = "weak" ) ]
74
+ //
75
+ // NOTE: This symbol has a workaround in the compiler's symbol mangling to avoid mangling it, while
76
+ // still not exposing it from non-cdylib (like `#[no_mangle]` would).
77
+ #[ rustc_std_internal_symbol]
75
78
// extern "C" is correct, Clang assumes the function cannot unwind:
76
79
// https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/clang/lib/CodeGen/CGObjC.cpp#L3980
77
80
//
@@ -139,7 +142,7 @@ pub(super) extern "C" fn __isPlatformVersionAtLeast(
139
142
140
143
/// Old entry point for availability. Used when compiling with older Clang versions.
141
144
// SAFETY: Same as for `__isPlatformVersionAtLeast`.
142
- #[ cfg_attr ( not ( feature = "compiler-builtins-mangled-names" ) , unsafe ( no_mangle ) , linkage = "weak" ) ]
145
+ #[ rustc_std_internal_symbol ]
143
146
pub ( super ) extern "C" fn __isOSVersionAtLeast ( major : u32 , minor : u32 , subminor : u32 ) -> i32 {
144
147
let version = pack_u32_os_version ( major, minor, subminor) ;
145
148
( version <= current_version ( ) ) as i32
0 commit comments