File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
std/src/sys/platform_version/darwin Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ use super::{current_version, pack_i32_os_version};
7777// NOTE: This symbol has a workaround in the compiler's symbol mangling to avoid mangling it, while
7878// still not exposing it from non-cdylib (like `#[no_mangle]` would).
7979#[ rustc_std_internal_symbol]
80+ // NOTE: Making this a weak symbol might not be entirely the right solution for this, `compiler_rt`
81+ // doesn't do that, it instead makes the symbol have "hidden" visibility. But since this is placed
82+ // in `libstd`, which might be used as a dylib, we cannot do the same here.
83+ #[ linkage = "weak" ]
8084// extern "C" is correct, Clang assumes the function cannot unwind:
8185// https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/clang/lib/CodeGen/CGObjC.cpp#L3980
8286//
@@ -145,6 +149,7 @@ pub(super) extern "C" fn __isPlatformVersionAtLeast(
145149/// Old entry point for availability. Used when compiling with older Clang versions.
146150// SAFETY: Same as for `__isPlatformVersionAtLeast`.
147151#[ rustc_std_internal_symbol]
152+ #[ linkage = "weak" ]
148153pub ( super ) extern "C" fn __isOSVersionAtLeast ( major : i32 , minor : i32 , subminor : i32 ) -> i32 {
149154 let version = pack_i32_os_version ( major, minor, subminor) ;
150155 ( version <= current_version ( ) ) as i32
You can’t perform that action at this time.
0 commit comments