Fix iOS 15 launch dyld crash caused by shaderc libc++ symbol reference.#1441
Open
0x1306a94 wants to merge 1 commit into
Open
Fix iOS 15 launch dyld crash caused by shaderc libc++ symbol reference.#14410x1306a94 wants to merge 1 commit into
0x1306a94 wants to merge 1 commit into
Conversation
fe9ec31 to
8dcb94f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题现象
std::__1::__libcpp_verbose_abort(char const*, ...)排查确认该符号来自 tgfx.a 中 shaderc / SPIRV 相关静态库对象,并非业务代码引入。根因分析
vendor.json 中 iOS 平台 shaderc 的
CMAKE_CXX_FLAGS包含-D_LIBCPP_DISABLE_AVAILABILITY定位到是在 Add Metal and OpenGL Hello2D demos, fix GPU resource sync and rendering issues. #1354 这次添加的-D_LIBCPP_DISABLE_AVAILABILITY在 Xcode 26.4 / iPhoneOS 26.4 SDK 下,Debug 构建会启用 libc++ hardening
_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG正常情况下,libc++ 的 availability 机制会识别__libcpp_verbose_abort在 iOS 15 上不可用,并在编译期退化为__builtin_abort()不会产生外部符号引用。但
_LIBCPP_DISABLE_AVAILABILITY关闭了这一保护,导致 shaderc 及其依赖(glslang、SPIRV-Tools 等)编译出的 .o 文件中包含对__libcpp_verbose_abort的外部引用。这些对象被链入 tgfx.a 后,宿主 App 在 iOS 15 设备上加载时,系统 libc++ 中找不到该符号,dyld 在启动阶段即失败。修复方案
-D_LIBCPP_DISABLE_AVAILABILITY让 libc++ availability 机制正常工作Test plan
./autotest.sh验证测试通过./autotest.sh USE_METALCanvasTest.PictureMaskPath 测试失败