From fa817af1042f6207e9eddd4fb1702fbf6e374295 Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Sat, 16 Nov 2024 01:04:41 +0900 Subject: [PATCH] Remove `no_dead_strip` marks --- crates/objc2/src/macros/mod.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/objc2/src/macros/mod.rs b/crates/objc2/src/macros/mod.rs index ab2ffb0a8..494c21e59 100644 --- a/crates/objc2/src/macros/mod.rs +++ b/crates/objc2/src/macros/mod.rs @@ -356,7 +356,7 @@ macro_rules! __statics_image_info { /// but things still seems to work. #[cfg_attr( not(all(target_os = "macos", target_arch = "x86")), - link_section = "__DATA,__objc_imageinfo,regular,no_dead_strip" + link_section = "__DATA,__objc_imageinfo,regular" )] #[cfg_attr( all(target_os = "macos", target_arch = "x86"), @@ -382,7 +382,7 @@ macro_rules! __statics_module_info { /// /// This is similar to image info, and must be present in the final /// binary on macOS 32-bit. - #[link_section = "__OBJC,__module_info,regular,no_dead_strip"] + #[link_section = "__OBJC,__module_info,regular"] #[export_name = $crate::__macro_helpers::concat!("\x01L_OBJC_MODULES_", $hash)] #[used] // Make sure this reaches the linker static _MODULE_INFO: $crate::__macro_helpers::ModuleInfo = @@ -439,14 +439,11 @@ macro_rules! __statics_sel { /// info on "life before main". #[cfg_attr( not(all(target_os = "macos", target_arch = "x86")), - // Clang uses `no_dead_strip` in the link section for some reason, - // which other tools (notably some LLVM tools) now assume is - // present, so we have to add it as well. - link_section = "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", + link_section = "__DATA,__objc_selrefs,literal_pointers", )] #[cfg_attr( all(target_os = "macos", target_arch = "x86"), - link_section = "__OBJC,__message_refs,literal_pointers,no_dead_strip", + link_section = "__OBJC,__message_refs,literal_pointers", )] #[export_name = $crate::__macro_helpers::concat!("\x01L_OBJC_SELECTOR_REFERENCES_", $hash)] static REF: $crate::__macro_helpers::SyncUnsafeCell<$crate::runtime::Sel> = unsafe { @@ -504,7 +501,7 @@ macro_rules! __statics_class { } /// SAFETY: Same as `REF` above in `__statics_sel!`. - #[link_section = "__DATA,__objc_classrefs,regular,no_dead_strip"] + #[link_section = "__DATA,__objc_classrefs,regular"] #[export_name = $crate::__macro_helpers::concat!( "\x01L_OBJC_CLASSLIST_REFERENCES_$_", $hash, @@ -536,7 +533,7 @@ macro_rules! __statics_class { static NAME_DATA: [$crate::__macro_helpers::u8; X.len()] = $crate::__statics_string_to_known_length_bytes!(X); /// SAFETY: Same as `REF` above in `__statics_sel!`. - #[link_section = "__OBJC,__cls_refs,literal_pointers,no_dead_strip"] + #[link_section = "__OBJC,__cls_refs,literal_pointers"] #[export_name = $crate::__macro_helpers::concat!( "\x01L_OBJC_CLASS_REFERENCES_", $hash,