Ld: -bundle and -bitcode_bundle cannot be used together

I am building llvm/clang 3.7 with bitcode support ( -fembed-bitcode ). Some modules cannot be linked due to an 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 the call)

Full error output:

Binding a common CXX 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-pass / BugpointPasses.exports -Wl, -flat_namespace -Wl, - undefined -Wress, Wrong, suppressoWW, /../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 ended with exit code 1 (use -v to see invoke) make [2]: * [lib / BugpointPasses.dylib] Error 1 make [1]: * [tools / bugpoint-pass / CMakeFiles / BugpointPasses.dir / all] Error 2 : *** [all] Error 2

It seems that -bundle is -bundle added by CMake, since I could not find it in CMakeLists.txt and -bitcode_bundle added by the SDK due to -fembed-bitcode .

How can i fix this? Any workaround (e.g. to disable building dylibs since I don't need them)?

+5
source share
1 answer

Make sure you are not using the Bundle bootloader in any of your projects: Configuring the package loader and set match-O to Executable instead of Bundle Match Type Setting

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

0
source

Source: https://habr.com/ru/post/1234991/


All Articles