Open weibindev opened 5 years ago
Build command failed. Error while executing process F:\SDK\cmake\3.10.2.4988404\bin\cmake.exe with arguments {--build D:\GitHub\Android_Anti_Debug\AntiDebug\app.externalNativeBuild\cmake\debug\x86_64 --target native-lib} [1/2] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o FAILED: CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o F:\SDK\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android --gcc-toolchain=F:/SDK/ndk-bundle/toolchains/x86_64-4.9/prebuilt/windows-x86_64 --sysroot=F:/SDK/ndk-bundle/sysroot -Dnative_lib_EXPORTS -isystem F:/SDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem F:/SDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/include -isystem F:/SDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem F:/SDK/ndk-bundle/sysroot/usr/include/x86_64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -MF CMakeFiles\native-lib.dir\src\main\cpp\native-lib.cpp.o.d -o CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -c ../../../../src/main/cpp/native-lib.cpp ../../../../src/main/cpp/native-lib.cpp:84:14: warning: cast to 'elf32_hdr ' from smaller integer type 'unsigned int' [-Wint-to-pointer-cast] elfhdr = (Elf32_Ehdr ) base; ^ ../../../../src/main/cpp/native-lib.cpp:94:19: warning: cast to 'char ' from smaller integer type 'unsigned int' [-Wint-to-pointer-cast] char p = (char)offset; ^ ../../../../src/main/cpp/native-lib.cpp:96:37: warning: comparison of constant 222 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] if(p == 0x01 && *(p+1) == 0xde) {
../../../../src/main/cpp/native-lib.cpp:99:27: warning: comparison of constant 240 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] } else if (*p == 0xf0 && *(p+1) == 0xf7 && *(p+2) == 0x00 && *(p+3) == 0xa0) { ~~ ^ ~~~~ ../../../../src/main/cpp/native-lib.cpp:99:45: warning: comparison of constant 247 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] } else if (*p == 0xf0 && *(p+1) == 0xf7 && *(p+2) == 0x00 && *(p+3) == 0xa0) { ~~~~~~ ^ ~~~~ ../../../../src/main/cpp/native-lib.cpp:99:81: warning: comparison of constant 160 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] } else if (*p == 0xf0 && *(p+1) == 0xf7 && *(p+2) == 0x00 && *(p+3) == 0xa0) { ~~~~~~ ^ ~~~~ ../../../../src/main/cpp/native-lib.cpp:102:63: warning: comparison of constant 159 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] } else if (*p == 0x01 && *(p+1) == 0x00 && *(p+2) == 0x9f && *(p+3) == 0xef) { ~~~~~~ ^ ~~~~ ../../../../src/main/cpp/native-lib.cpp:102:81: warning: comparison of constant 239 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] } else if (*p == 0x01 && *(p+1) == 0x00 && *(p+2) == 0x9f && *(p+3) == 0xef) { ~~~~~~ ^ ~~~~ ../../../../src/main/cpp/native-lib.cpp:162:17: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings] char* tra = "TracerPid"; ^ ../../../../src/main/cpp/native-lib.cpp:276:25: error: unknown use of instruction mnemonic without a size suffix __asm__("push {r5}\n\t" ^ <inline asm>:2:2: note: instantiated into assembly here push r0-r4,lr ^ ../../../../src/main/cpp/native-lib.cpp:277:31: error: unknown use of instruction mnemonic without a size suffix "push {r0-r4,lr}\n\t" ^ <inline asm>:3:2: note: instantiated into assembly here mov r0,pc ^ ../../../../src/main/cpp/native-lib.cpp:278:25: error: unknown token in expression "mov r0,pc\n\t" //<U+6B64><U+65F6>pc<U+6307><U+5411><U+540E><U+4E24><U+6761><U+6307><U+4EE4> ^ <inline asm>:4:12: note: instantiated into assembly here add r0,r0,#6 ^ ../../../../src/main/cpp/native-lib.cpp:279:28: error: unknown use of instruction mnemonic without a size suffix "add r0,r0,#6\n\t"//cjh:<U+8FD9><U+91CC><U+7684>add<U+662F>add.w<U+FF0C><U+6240><U+4EE5><U+4F1A><U+5360>32<U+4F4D><U+FF0C><U+56E0><U+6B64><U+9700><U+8981>+6<U+624D><U+5BF9><U+3002> <U+539F><U+6587><U+FF1A>+4 <U+662F><U+7684>lr <U+5730><U+5740><U+4E3A> pop{r0-r5} ^ <inline asm>:5:2: note: instantiated into assembly here mov lr,r0 ^ ../../../../src/main/cpp/native-lib.cpp:282:27: error: unknown use of instruction mnemonic without a size suffix "pop {r0-r5}\n\t" ^ <inline asm>:8:2: note: instantiated into assembly here mov lr,r5 ^ ../../../../src/main/cpp/native-lib.cpp:281:25: error: symbol 'r5' can not be undefined in a subtraction expression "mov pc,%0\n\t" ^ <inline asm>:7:2: note: instantiated into assembly here pop r0-r5 ^ 9 warnings and 6 errors generated. ninja: build stopped: subcommand failed.
我也遇到编译错误,但是错误不一样。AntiDebug/app/src/main/cpp/native-lib.cpp:276:13: error: vector register expected,ndk 20版本。不知道项目是使用那个版本编译的。
Build command failed. Error while executing process F:\SDK\cmake\3.10.2.4988404\bin\cmake.exe with arguments {--build D:\GitHub\Android_Anti_Debug\AntiDebug\app.externalNativeBuild\cmake\debug\x86_64 --target native-lib} [1/2] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o FAILED: CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o F:\SDK\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android --gcc-toolchain=F:/SDK/ndk-bundle/toolchains/x86_64-4.9/prebuilt/windows-x86_64 --sysroot=F:/SDK/ndk-bundle/sysroot -Dnative_lib_EXPORTS -isystem F:/SDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem F:/SDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/include -isystem F:/SDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem F:/SDK/ndk-bundle/sysroot/usr/include/x86_64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -MF CMakeFiles\native-lib.dir\src\main\cpp\native-lib.cpp.o.d -o CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -c ../../../../src/main/cpp/native-lib.cpp ../../../../src/main/cpp/native-lib.cpp:84:14: warning: cast to 'elf32_hdr ' from smaller integer type 'unsigned int' [-Wint-to-pointer-cast] elfhdr = (Elf32_Ehdr ) base; ^ ../../../../src/main/cpp/native-lib.cpp:94:19: warning: cast to 'char ' from smaller integer type 'unsigned int' [-Wint-to-pointer-cast] char p = (char)offset; ^ ../../../../src/main/cpp/native-lib.cpp:96:37: warning: comparison of constant 222 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] if(p == 0x01 && *(p+1) == 0xde) {