【问题标题】:ld: -bundle and -bitcode_bundle cannot be used togetherld: -bundle 和 -bitcode_bundle 不能一起使用
【发布时间】: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 构建,因为我不需要它们)?

【问题讨论】:

标签: ios xcode clang xcode7 bitcode


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-11
    • 2013-11-18
    • 2017-06-16
    • 1970-01-01
    • 2023-03-17
    • 2013-12-19
    • 2011-10-05
    • 2020-04-15
    相关资源
    最近更新 更多