ld:-bundle和-bitcode_bundle不能一起使用 [英] ld: -bundle and -bitcode_bundle cannot be used together

查看:129
本文介绍了ld:-bundle和-bitcode_bundle不能一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建具有位码支持( -fembed-bitcode )的 llvm/clang 3.7 .某些模块由于错误而无法链接:

i'm building llvm/clang 3.7 with bitcode support (-fembed-bitcode). Some modules can't be linked due to error:

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

ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together clang: error: linker command failed with exit code 1 (use -v to see invocation)

完整错误输出:

链接CXX共享模块../../lib/BugpointPasses.dylib cd/Volumes/Transcend/dev/src/llvm_37_ios_any_build/tools/bugpoint-passes&&/usr/local/地窖/cmake/2.8.12.2/bin/cmake -E cmake_link_scriptCMakeFiles/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-未使用的参数-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,/卷/Transcend/dev/src/llvm_37_ios_any_build/tools/bugpoint-passes/BugpointPasses.exports-Wl,-flat_namespace -Wl,-未定义-Wl,禁止-o ../../lib/BugpointPasses.dylibCMakeFiles/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:*** [all]错误2

Linking CXX shared module ../../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 and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: * [lib/BugpointPasses.dylib] Error 1 make[1]: * [tools/bugpoint-passes/CMakeFiles/BugpointPasses.dir/all] Error 2 make: *** [all] Error 2

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

It seems that -bundle is added by CMake as i was not able to find it in CMakeLists.txt and -bitcode_bundle is added by SDK because of -fembed-bitcode.

我该如何解决?任何解决方法(例如,由于我不需要dylib,所以要关闭它们)?

How can i fix it? Any workaround (f.e. to switch off dylibs building since i don't need them)?

推荐答案

请检查您是否在任何项目中均未使用Bundle loader:并将match-O类型设置为Executable而不是Bundle

Check that you are not using Bundle loader in any of your projects: and set match-O type to Executable instead of Bundle

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

Hope that helps, I had the same problem and fixed it

这篇关于ld:-bundle和-bitcode_bundle不能一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆