【发布时间】:2016-02-01 23:50:34
【问题描述】:
我正在构建 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: 错误:链接器命令失败,退出代码为 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 构建,因为我不需要它们)?
【问题讨论】:
-
我建议在 clang 用户邮件列表中询问:lists.llvm.org/mailman/listinfo/cfe-users
-
这个问题你解决了吗?
标签: ios xcode clang xcode7 bitcode