wang@ubuntu:~/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的强力:
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使用我的clang(android-ndk-r10e/wang-llvm-3.6/prebuilt/linux-x86/bin
),但对于64位,它使用aarch64-linux-android-gcc,任何人都可以帮助我吗?
答案 0 :(得分:1)
如果您想使用Obfuscator-LLVM,则必须将其集成到构建环境中,用于32位或64位构建。 -mllvm -sub
(指令替换),-mllvm -fla
(控制流展平)和-mllvm -bcf
(伪控制流注入)是Obfuscator-LLVM特有的编译标志,因此不支持它们按aarch64-linux-android-gcc
。
您有两种替代方案可以解决您的问题:使用Obfuscator-LLVM构建aarch64
目标,或删除有问题的标记(并生成非混淆的目标)。