godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.94k stars 3.22k forks source link

Link failure on macOS for arm64 with prebuilt MoltenVK 1.3.239.0 #6798

Open atrefonas opened 1 year ago

atrefonas commented 1 year ago

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 commented 1 year ago

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

bruvzg commented 1 year ago

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.

akien-mga commented 1 year ago

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

atrefonas commented 1 year ago

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.