邻LLVM,不可识别的命令行选项 '-sub' 为64bits的

问题描述:

[email protected]:~/Downloads/hello/jni$ ndk-build -B 
[armeabi] Compile thumb : hello <= hello.c 
[armeabi] Executable : hello 
[armeabi] Install : hello => libs/armeabi/hello 
[x86] Compile : hello <= hello.c 
[x86] Executable : hello 
[x86] Install : hello => libs/x86/hello 
[arm64-v8a] Compile : hello <= hello.c 
aarch64-linux-android-gcc: error: unrecognized command line option '-mllvm' 
aarch64-linux-android-gcc: error: unrecognized command line option '-sub' 
aarch64-linux-android-gcc: error: unrecognized command line option '-mllvm' 
aarch64-linux-android-gcc: error: unrecognized command line option '-fla' 
aarch64-linux-android-gcc: error: unrecognized command line option '-mllvm' 
aarch64-linux-android-gcc: error: unrecognized command line option '-bcf' 

的android.mk的教改尝试:邻LLVM,不可识别的命令行选项 '-sub' 为64bits的

LOCAL_PATH := $(call my-dir) 
include $(CLEAR_VARS) 
LOCAL_MODULE := hello 
LOCAL_SRC_FILES := hello.c 
LOCAL_CFLAGS := -mllvm -sub -mllvm -fla -mllvm -bcf 
include $(BUILD_EXECUTABLE) 

当我建立32位这样的文件,androd-NDK使用我铛(android-ndk-r10e/wang-llvm-3.6/prebuilt/linux-x86/bin) ,但对于64位,它使用aarch64-linux-android-gcc,任何人都可以帮助我?

如果您想使用Obfuscator-LLVM,则必须将其集成到您的构建环境中,适用于32位或64位版本。 -mllvm -sub(指令替代),-mllvm -fla(控制流展平)和-mllvm -bcf(伪控制流注入)是特定于Obfuscator-LLVM的编译标志,因此它们不受aarch64-linux-android-gcc支持。

您有两种解决方案可以解决您的问题:使用Obfuscator-LLVM构建aarch64目标,或者删除违规标志(并生成非混淆目标)。