Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld: -bundle and -bitcode_bundle cannot be used together

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)?

like image 864
4ntoine Avatar asked Nov 02 '15 06:11

4ntoine


1 Answers

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

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

like image 194
Jorge Arimany Avatar answered Nov 02 '22 10:11

Jorge Arimany