ivanarh / ndcrash

A powerful crash reporting library for Android NDK. Don't forget to run git submodule update --init --recursive after checking out.
Apache License 2.0
111 stars 21 forks source link

elfxx.c:499:56: error: too few arguments to function call, expected 8, have 7 #1

Open kasru opened 6 years ago

kasru commented 6 years ago

$ mkdir build $ cd build $ cmake .. \ -DCMAKE_SYSTEM_NAME=Android \ -DCMAKE_SYSTEM_VERSION=21 \ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ -DCMAKE_ANDROID_NDK=${ANDROID_NDK_ROOT} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DENABLE_LIBCORKSCREW=OFF \ -DENABLE_LIBUNWIND=ON \ -DENABLE_LIBUNWINDSTACK=OFF \ -DENABLE_CXXABI=ON \ -DENABLE_STACKSCAN=ON \ -DENABLE_INPROCESS=ON \ -DENABLE_OUTOFPROCESS=ON

$ cmake --build . --target ndcrash

[ 68%] Building C object external/libunwind-ndk/cmake/CMakeFiles/unwind.dir//src/ptrace/_UPT_elf.c.o cd /home/kas/work/MobileContrib/ndcrash-0.0.1/build-libc++_shared-arm64-v8a/external/libunwind-ndk/cmake && /home/kas/android/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android --gcc-toolchain=/home/kas/android/android-ndk-r17b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 --sysroot=/home/kas/android/android-ndk-r17b/sysroot -DENABLE_INPROCESS -DENABLE_LIBUNWIND -DENABLE_OUTOFPROCESS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/home/kas/work/MobileContrib/ndcrash-0.0.1/include -I/home/kas/work/MobileContrib/ndcrash-0.0.1/src -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/include -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/include/tdep -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/src -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/cmake/../src -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/cmake/../include -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/cmake/../lzma/C -I/home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/cmake/../include/tdep-aarch64 -isystem /home/kas/android/android-ndk-r17b/sysroot/usr/include -isystem /home/kas/android/android-ndk-r17b/sysroot/usr/include/aarch64-linux-android -funwind-tables -no-canonical-prefixes -DANDROID_API=21 -fexceptions -Werror=implicit-function-declaration -Werror=incompatible-function-pointer-types -Wno-format -O3 -DNDEBUG -fPIC -U_FORTIFY_SOURCE -o CMakeFiles/unwind.dir//src/ptrace/_UPT_elf.c.o -c /home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/src/ptrace/_UPT_elf.c In file included from /home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/src/ptrace/_UPT_elf.c:5: /home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/src/ptrace/../elfxx.c:479:15: warning: incompatible pointer types assigning to 'void ()(ISzAllocPtr, size_t)' (aka 'void ()(const struct ISzAlloc , unsigned long)') from 'void (void , size_t)' (aka 'void (void , unsigned long)') [-Wincompatible-pointer-types] alloc.Alloc = xz_alloc; ^ ~~~~ /home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/src/ptrace/../elfxx.c:480:14: warning: incompatible pointer types assigning to 'void ()(ISzAllocPtr, void )' (aka 'void ()(const struct ISzAlloc , void )') from 'void (void , void )' [-Wincompatible-pointer-types] alloc.Free = xz_free; ^ ~~~ /home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/src/ptrace/../elfxx.c:499:56: error: too few arguments to function call, expected 8, have 7 CODER_FINISH_ANY, &status); ^ /home/kas/work/MobileContrib/ndcrash-0.0.1/external/libunwind-ndk/cmake/../lzma/C/Xz.h:330:1: note: 'XzUnpacker_Code' declared here SRes XzUnpacker_Code(CXzUnpacker p, Byte dest, SizeT *destLen, ^ 2 warnings and 1 error generated.

ivanarh commented 6 years ago

It seems like you use a bogus toolchain and (or) cmake. Please try this:

mkdir build
cd build
${ANDROID_HOME}/cmake/3.6.4111459/bin/cmake \
-Wno-dev \
-DCMAKE_SYSTEM_NAME=Android \
-DANDROID_PLATFORM=android-21 \
-DANDROID_ABI=arm64-v8a \
-DANDROID_NDK=${ANDROID_NDK_ROOT} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake \
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_LIBCORKSCREW=OFF \
-DENABLE_LIBUNWIND=ON \
-DENABLE_LIBUNWINDSTACK=OFF \
-DENABLE_CXXABI=ON \
-DENABLE_STACKSCAN=ON \
-DENABLE_INPROCESS=ON \
-DENABLE_OUTOFPROCESS=ON \
..
cmake --build . --target ndcrash

ANDROID_HOME variable should point to Android SDK location.