godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Link failure on macOS for arm64 with prebuilt MoltenVK 1.3.239.0

Open atrefonas opened this issue 2 years ago • 4 comments

Godot version

62d4d8bfc63506fe382ae21cfe040fe4f03df8c8

System information

macOS Monterey, version 12.4

Issue description

I tried building Godot from the source for the first time and see this. I'm not sure if it has to do with my Vulkan version which is vulkansdk-macos-1.3.239.0.dmg. Any ideas?


[Initial build] Compiling core/config/project_settings.cpp ...
[Initial build] Compiling core/error/error_list.cpp ...
[Initial build] Compiling core/error/error_macros.cpp ...
[Initial build] progress_finish(["progress_finish"], [])
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/environment/voxel_gi_sdf.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/giprobe_write.glsl.gen.h"
[Initial build] Linking Static Library core/libcore.macos.editor.arm64.a ...
Ranlib Library core/libcore.macos.editor.arm64.a ...
[Initial build] Linking Program bin/godot.macos.editor.arm64 ...
ld: warning: option -s is obsolete and being ignored
Undefined symbols for architecture arm64:
  "_objc_msgSend$HDR10MetadataWithDisplayInfo:contentInfo:opticalOutputScale:", referenced from:
      MVKSwapchain::setHDRMetadataEXT(VkHdrMetadataEXT const&) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
  "_objc_msgSend$UTF8String", referenced from:
      MVKCommandResourceFactory::newMTLFunction(NSString*, NSString*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKCommandResourceFactory::initMTLLibrary() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKWatermark::newRenderPipelineState() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKWatermark::initShaders(char const*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKGPUCounterQueryPool::initMTLCounterSampleBuffer(VkQueryPoolCreateInfo const*, id<MTLCounterSet>, char const*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKInstance::debugReportMessage(MVKVulkanAPIObject*, MVKConfigLogLevel, char const*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKBuffer::propagateDebugName() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      ...
  "_objc_msgSend$UUIDString", referenced from:
      MVKPhysicalDevice::logGPUInfo() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
  "_objc_msgSend$addCompletedHandler:", referenced from:

Steps to reproduce

git clone godotengine repo (master)

Install the following: https://sdk.lunarg.com/sdk/download/1.3.239.0/mac/vulkansdk-macos-1.3.239.0.dmg

scons platform=macos arch=arm64

Minimal reproduction project

N/A - build issue

atrefonas avatar Feb 21 '23 03:02 atrefonas

I see the issue referenced here: https://github.com/KhronosGroup/MoltenVK/issues/1756

atrefonas avatar Feb 21 '23 03:02 atrefonas

Upgrade to Xcode 14 or use a custom build, there's nothing we can do, if Vulkan SDK is built with Xcode 14 (and without -fno-objc-msgsend-selector-stubs) it won't be useable with older Xcode.

bruvzg avatar Feb 21 '23 07:02 bruvzg

We should add a note about this in our compilation docs, I'll move it to godot-docs.

akien-mga avatar Feb 21 '23 07:02 akien-mga

I was able to fix it on my macOS system with these commands to uninstall and reinstall the Xcode Command Line Tools

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

However, I do agree it should be documented in the compilation docs.

atrefonas avatar Feb 21 '23 13:02 atrefonas