我正在建造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,-未定义-Wl,抑制-o ../../lib/BugpointPasses.dylib
CMakeFiles/BugpointPasses.dir/TestPasses.cpp.o
-Wl,-rpath,@executable_path/../lib ld: -bundle 和 -bitcode_bundle (Xcode 设置 ENABLE_BITCODE=YES) 不能一起使用 clang:
错误:链接器命令失败,退出代码为 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
由SDK添加的原因是-fembed-bitcode
.
我该如何修复它?有什么解决方法(例如关闭 dylibs 构建,因为我不需要它们)?
Check that you are not using Bundle loader in any of your projects:
and set match-O type to Executable instead of Bundle
希望有帮助,我遇到了同样的问题并解决了
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)