ld: -bundle and -bitcode_bundle cannot be used together

北城余情 提交于 2021-01-27 04:51:28

问题


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

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)

Full error output:

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

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.

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


回答1:


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



来源:https://stackoverflow.com/questions/33471809/ld-bundle-and-bitcode-bundle-cannot-be-used-together

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!