default to obfuscation
This is not a real Pull Request it has not been tested thoroughly enough, and may not be fit for everybody. I open it now as a way of discussion: what should be the right approach to resolve the limitation that was introduced by LLVM relatively recently.
This is the easiest way I found to work around -mllvm is not supported with -fembed-bitcode.
This didn't happen before, on llvm-9.0.1 (but that was not compatible with the modern Xcode).
I tried to simply remove the error check for mllvm from clang/lib/Driver/ToolChains/Clang.cpp, but this resulted in lots of suspicious warnings while compiling my iOS code, so I did not follow this path. Maybe, I did something wrong?
@heroims please open the issue page
@alexcohn
你好,我按照您的修改,有以下报错。要怎样才能编译出 LLVMgold.so
Hello, according to your modification, I have the following error reports. How to compile llvmgold.so。
`
[armeabi-v7a] StaticLibrary : libkooapk.a [armeabi-v7a] Compile++ thumb: utils <= missing.cpp [armeabi-v7a] Compile++ thumb: utils <= new.cpp [armeabi-v7a] Compile++ thumb: utils <= files.cpp [armeabi-v7a] Compile++ thumb: utils <= misc.cpp [armeabi-v7a] Compile++ thumb: utils <= selinux.cpp [armeabi-v7a] Compile++ thumb: utils <= logging.cpp [armeabi-v7a] Compile++ thumb: utils <= xwrap.cpp [armeabi-v7a] Compile++ thumb: utils <= stream.cpp [armeabi-v7a] StaticLibrary : libutils.a [armeabi-v7a] Executable : binary /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /root/kooapk/llvm/obfuscator_9.0.1/build/bin/../lib/LLVMgold.so: could not load plugin library: /root/kooapk/llvm/obfuscator_9.0.1/build/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/binary/binary.o:1:3: invalid character /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/binary/binary.o:1:3: syntax error, unexpected $end /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/binary/binary.o: not an object or archive /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/resetprop/persist_properties.o:1:3: invalid character /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/resetprop/persist_properties.o:1:3: syntax error, unexpected $end /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/resetprop/persist_properties.o: not an object or archive /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/resetprop/resetprop.o:1:3: invalid character /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/resetprop/resetprop.o:1:3: syntax error, unexpected $end /root/kooapk/cmdline-tools/ndk/ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/binary/resetprop/resetprop.o: not an object or archive /root/kooapk/cmdline-tools/ndk/ollvm/platforms/android-16/arch-arm/usr/lib/../lib/crtbegin_dynamic.o:crtbegin.c:function _start_main: error: undefined reference to 'main' clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [/root/kooapk/cmdline-tools/ndk/ollvm/build/core/build-binary.mk:738: obj/local/armeabi-v7a/binary] Error 1 `
@androiddisk This build failure does not look related to the change in PassManagerBuilder.cpp.