File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
library/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};
77
77
// NOTE: This symbol has a workaround in the compiler's symbol mangling to avoid mangling it, while
78
78
// still not exposing it from non-cdylib (like `#[no_mangle]` would).
79
79
#[ 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" ]
80
84
// extern "C" is correct, Clang assumes the function cannot unwind:
81
85
// https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/clang/lib/CodeGen/CGObjC.cpp#L3980
82
86
//
@@ -145,6 +149,7 @@ pub(super) extern "C" fn __isPlatformVersionAtLeast(
145
149
/// Old entry point for availability. Used when compiling with older Clang versions.
146
150
// SAFETY: Same as for `__isPlatformVersionAtLeast`.
147
151
#[ rustc_std_internal_symbol]
152
+ #[ linkage = "weak" ]
148
153
pub ( super ) extern "C" fn __isOSVersionAtLeast ( major : i32 , minor : i32 , subminor : i32 ) -> i32 {
149
154
let version = pack_i32_os_version ( major, minor, subminor) ;
150
155
( version <= current_version ( ) ) as i32
You can’t perform that action at this time.
0 commit comments