6

我正在构建llvm/clang 3.7比特码支持(-fembed-bitcode)。部分模块因错误无法链接:

ld:-bundle 和 -bitcode_bundle(Xcode 设置 ENABLE_BITCODE=YES)不能一起使用 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

完整的错误输出:

链接 CXX 共享模块 ../../lib/BugpointPasses.dylib cd /Volumes/Transcend/dev/src/llvm_37_ios_any_build/tools/bugpoint-passes && /usr/local/Cellar/cmake/2.8.12.2/bin/cmake - E cmake_link_script CMakeFiles/BugpointPasses.dir/link.txt --verbose=1 /usr/bin/c++ -fembed-bitcode -Os -std=c++11 -stdlib=libc++ -arch arm64 -mios-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -pedantic -Wno-long -long -Wnon-virtual-dtor -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -bundle -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-exported_symbols_list,/Volumes/Transcend/dev/src/llvm_37_ios_any_build/tools/bugpoint-passes/BugpointPasses.exports -Wl,-flat_namespace -Wl,-undefined -Wl,suppress -o ../../lib/BugpointPasses.dylib CMakeFiles/BugpointPasses .dir/TestPasses.cpp.o -Wl,-rpath,@executable_path/../lib ld: -bundle 和 -bitcode_bundle (Xcode 设置 ENABLE_BITCODE=YES) 不能一起使用 clang: error: linker command failed with exit code 1 (使用 -v 查看调用) make[2]:* [lib/BugpointPasses.dylib] 错误 1 ​​make[1]: * [tools/bugpoint-passes/CMakeFiles/BugpointPasses.dir/all] 错误 2 make: *** [all] 错误 2

似乎-bundle是由 CMake 添加的,因为我无法在 CMakeLists.txt 中找到它,并且-bitcode_bundle由于-fembed-bitcode.

我该如何解决?任何解决方法(fe 关闭 dylibs 构建,因为我不需要它们)?

4

2 回答 2

0

Enable Bitcode构建设置设置No为您的调试配置:

如果您没有看到该Enable Bitcode选项,请确保BaseSDK设置为iOStvOSwatchOS

于 2022-03-03T23:14:14.233 回答
0

检查您是否没有在任何项目中使用 Bundle 加载器: 捆绑加载器设置 并将 match-O 类型设置为 Executable 而不是 Bundle Match-O 类型设置

希望有帮助,我遇到了同样的问题并解决了

于 2016-04-25T16:41:01.540 回答