Closed william52328 closed 2 years ago
You can pass -fno-objc-msgsend-selector-stubs
to your compiles to avoid this
Perhaps I'll just make that the default for now
You have to do that to clang for each object compile, not ld unfortunately
Do you know if lld has a plan for fixing this?
I started looking at it this morning, not sure how far i'll get
👋, is there any progress regarding this issue? 👀
Sorry to be clear I started working on this for LLD, tracked here https://github.com/llvm/llvm-project/issues/56034, for zld to get this it would either require @michaeleisel to implement it entirely, or apple to update their open source dump of ld64 and zld rebase on it. I would suggest disabling it with -fno-objc-msgsend-selector-stubs
in the meantime
i may just turn that flag on by default
oh wait, right, it's a clang flag, not an ld one
I noticed that even if you put -fno-objc-msgsend-selector-stubs
for all clang invocations, if -miphoneos-version-min=8.0
is presented in the linker command, the _objc_msgSend
issue will happen too.
The linker passes after changing the flag to -miphoneos-version-min=10.0
so, my plan is that i will not be fixing this bug. instead, i will detect when it occurs, and in the error message tell the user either to add the -fno-objc-msgsend-selector-stubs
flag to their compilations, or else switch to lld. i am working with the lld people to make user-friendly lld install docs to send people to
1.3.6 has a better error message for this, including a link to the new mach-o lld docs
I compiled my project with Xcode14 beta and found that the.a static library could not link to its own library symbols。
Example Like This: Undefined symbols for architecture arm64: "_objc_msgSend$setOffsetFromCenter:", referenced from: +[SVProgressHUD setOffsetFromCenter:] in libSVProgressHUD.a(SVProgressHUD.o) +[SVProgressHUD resetOffsetFromCenter] in libSVProgressHUD.a(SVProgressHUD.o) "_objc_msgSend$unreachableBlock", referenced from: -[Reachability reachabilityChanged:] in libReachability.a(Reachability.o)
SetOffsetFromCenter is a symbol in the SVProgressHUD library, but cannot be linked using ZLD。