[release/6.0] Disable objc_msgSend stubs in clang for compatibility with Xcode 13 #91118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #89932 and #90217 to release/6.0
Customer Impact
As soon as we're updating the macOS build machine image used to build dotnet/runtime to one that uses Xcode 14 the native build of Objective-C code will start emitting objc_msgSend stubs. This causes the native libraries to fail during linking with the linker in Xcode 13, effectively preventing Mac/iOS/tvOS apps from working. Note that this can happen automatically if AzDO updates the macOS build images.
The fix is to disable the objc_msgSend stubs via a compiler flag, following what xamarin-macios did a while ago: xamarin/xamarin-macios#16231
Testing
CI and local testing
Risk
Low. The PR adds an additional compiler flag to every .m Objective-C file to prevent the new Xcode 14 behavior.