-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MoltenVK 1.3.231.1 binaries use Apple LLVM 14+ option -fobjc-msgsend-selector-stubs
, incompatible with earlier Xcode or osxcross with LLVM < 16
#1756
Comments
godotengine/godot#68080 (comment)
We confirmed that building MoltenVK 1.2.0 with Xcode 14.1 on macOS and |
Thanks for your analysis and research. So how severe is this, and how do we want to handle it?
|
I think that devs rebuilding their copies is the correct way, as it will match whole dev environment better. |
That's the option we took for Godot, though we couldn't build MoltenVK with our main dev environment as it seems only Xcode / xcodebuild is supported, so we can't use osxcross. So for now I just had a dev compile it on macOS with the mentioned flag and the build works fine for us. So from our perspective we're all set (though we'll have to keep making custom builds manually until we finally have access to LLVM 16), but figured it would be good to let you folks know about the problem since other users may face it (and hopefully find this issue if they do). |
Although As a result, I've removed |
As an update, for users who may stumble upon this issue while doing the same thing we do for Godot (linking MoltenVK with osxcross instead of the native Xcode toolchain): This issue is still reproducible as of latest osxcross, despite using Apple LLVM based on LLVM 16, which should have https://reviews.llvm.org/D128108 included. I suspect Apple's open source codebase for the ld64 linker (used in osxcross via https://github.com/tpoechtrager/cctools-port/ ) might still be lagging behind and not offering this feature yet. So for Godot we've consistently made our custom MoltenVK builds with https://github.com/godotengine/moltenvk-osxcross/releases I might not tag all upstream releases there, but at least the ones we decide to use in Godot whenever we update our Vulkan SDK components. |
For official builds of Godot Engine 4.0, we use osxcross to cross-compile macOS and iOS binaries from Linux (Fedora 36). osxcross uses upstream LLVM/Clang.
Recent MoltenVK binaries in the Vulkan SDK seem to be built with Xcode 14 (and thus Apple LLVM 14), which includes a new
-fobjc-msgsend-selector-stubs
optimization enabled by default. This flag enables the use of symbols which are unique to Apple LLVM 14+, and therefore currentlibMoltenVK.a
cannot be used with:It should be possible to make the
libMoltenVK.a
binaries portable again by disabling the optimization with-fno-objc-msgsend-selector-stubs
.That optimization made its way into upstream LLVM with https://reviews.llvm.org/D128108, but this was merged recently and will first be included in LLVM 16.
Here's an example of linking error (with osxcross built with Xcode 14.1 SDKs):
See Godot PR to update our Vulkan SDK blocked by this issue:
The text was updated successfully, but these errors were encountered: