Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android NDK Build Error #91

Closed
subu1979 opened this issue Oct 6, 2022 · 14 comments
Closed

Android NDK Build Error #91

subu1979 opened this issue Oct 6, 2022 · 14 comments

Comments

@subu1979
Copy link

subu1979 commented Oct 6, 2022

image

@utelle
Copy link
Owner

utelle commented Oct 6, 2022

For ARM architectures the source code includes the header file arm_neon.h (resp arm64_neon.h) depending on certain preprocessor symbols (namely _M_ARM resp _M_ARM64). Looking at your screenshot of the error messages I get the impression that the header file arm_neon.h you are using does not define several of the NEON intrinsics. However, since you are not giving any version information of the tools you are using I have absolutely no idea why.

Maybe you are using outdated tools, maybe you did not specify all necessary preprocessor symbols.

All I can say is that using the Android build instructions provided by the SQLite project (see top 2 "Building a Custom aar File") work for me flawlessly (after adjusting the file Android.mk and adding the SQLite3MC source amalgamation).

@subu1979
Copy link
Author

subu1979 commented Oct 6, 2022

Thank you.

@subu1979 subu1979 closed this as completed Oct 6, 2022
@utelle
Copy link
Owner

utelle commented Oct 6, 2022

Thank you.

You are welcome. Could you solve your problem? If yes, how? Other developers might have had similar issues.

@subu1979
Copy link
Author

subu1979 commented Oct 6, 2022

Unable to compile sqlite3mc
I'am able to compile sqleet & original sqlite3 (http://www.sqlite.org/android android.fossil)

SQLEET Cross-Compilation :-

root@sysadmin-VirtualBox:/home/sysadmin/sqleet-jni# ndk-build APP_ABI="all" NDK_APP_LIBS_OUT=libs/
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.
[arm64-v8a] Compile : sqleet <= sqleet.c
[arm64-v8a] Compile : sqleet <= shell.c
[arm64-v8a] StaticLibrary : libsqleet.a
[x86_64] Compile : sqleet <= sqleet.c
[x86_64] Compile : sqleet <= shell.c
[x86_64] StaticLibrary : libsqleet.a
[armeabi-v7a] Compile thumb : sqleet <= sqleet.c
[armeabi-v7a] Compile thumb : sqleet <= shell.c
[armeabi-v7a] StaticLibrary : libsqleet.a
[x86] Compile : sqleet <= sqleet.c
[x86] Compile : sqleet <= shell.c
[x86] StaticLibrary : libsqleet.a
root@sysadmin-VirtualBox:/home/sysadmin/sqleet-jni#

Sqlite3 Cross-Compilation

image

@subu1979 subu1979 reopened this Oct 6, 2022
@subu1979
Copy link
Author

subu1979 commented Oct 6, 2022

If you don't mind can you share your Android.mk file

@utelle
Copy link
Owner

utelle commented Oct 6, 2022

When I compile the Android bindings for SQLite3MC I perform the following steps:

  1. Download and extract SQLite Android Bindings from official SQLite site
  2. Replace sqlite3.c and sqlite3.h in subdirectory ./sqlite3/src/main/jni/sqlite by sqlite3mc_amalgamation.c and sqlite3mc_amalgamation.h
  3. Replace Android.mk in subdirectory ./sqlite3/src/main/jni/sqlite by Android.mk (adjusted Android.mk file, rename downloaded file to Android.mk)
  4. Execute commands as described in section 2.3 of SQLite Android guide:
$ export ANDROID_HOME=~/Android/Sdk/
$ cd sqlite3
$ ../gradlew assembleRelease

@subu1979
Copy link
Author

subu1979 commented Oct 6, 2022

sysadmin@sysadmin-VirtualBox:~/Desktop/sqlite/sqlite3$ ../gradlew assembleRelease
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

Task :sqlite3:externalNativeBuildRelease
Build sqliteX_armeabi-v7a
[armeabi-v7a] Compile++ thumb: sqliteX <= android_database_SQLiteCommon.cpp
[armeabi-v7a] Compile++ thumb: sqliteX <= android_database_SQLiteConnection.cpp
[armeabi-v7a] Compile++ thumb: sqliteX <= android_database_SQLiteGlobal.cpp
[armeabi-v7a] Compile++ thumb: sqliteX <= android_database_SQLiteDebug.cpp
[armeabi-v7a] Compile++ thumb: sqliteX <= JNIHelp.cpp
[armeabi-v7a] Compile++ thumb: sqliteX <= JniConstants.cpp
[armeabi-v7a] Compile thumb : sqliteX <= sqlite3.c
[armeabi-v7a] SharedLibrary : libsqliteX.so
Build sqliteX_arm64-v8a
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteCommon.cpp
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteConnection.cpp
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteGlobal.cpp
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteDebug.cpp
[arm64-v8a] Compile++ : sqliteX <= JNIHelp.cpp
[arm64-v8a] Compile++ : sqliteX <= JniConstants.cpp
[arm64-v8a] Compile : sqliteX <= sqlite3.c
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259195:14: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
v8 = vaeseq_u8(v8, vdupq_n_u8(0));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259195:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
v8 = vaeseq_u8(v8, vdupq_n_u8(0));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259258:26: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
keySchedule[j] = vaesimcq_u8(tempKeySchedule[j]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259258:24: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
keySchedule[j] = vaesimcq_u8(tempKeySchedule[j]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259305:18: warning: implicit declaration of function 'vaesmcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259305:29: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259305:16: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259307:16: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259307:14: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259329:18: warning: implicit declaration of function 'vaesmcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259329:29: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259329:16: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259331:16: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259331:14: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259381:14: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259381:26: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259381:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259383:12: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesdq_u8(data, key[1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259383:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesdq_u8(data, key[1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259398:14: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259398:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259400:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesdq_u8(data, key[1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259426:14: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259426:26: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259426:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259428:12: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesdq_u8(data, key[1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259428:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesdq_u8(data, key[1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~
15 warnings and 12 errors generated.
make: *** [/home/sysadmin/Android/Sdk/ndk/25.0.8775105/build/core/build-binary.mk:422: /home/sysadmin/Desktop/sqlite/sqlite3/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/objs/sqliteX/sqlite3.o] Error 1

Task :sqlite3:externalNativeBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':sqlite3:externalNativeBuildRelease'.

Build command failed.
Error while executing process /home/sysadmin/Android/Sdk/ndk/25.0.8775105/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/Android.mk NDK_APPLICATION_MK=/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=0 APP_PLATFORM=android-19 NDK_OUT=/home/sysadmin/Desktop/sqlite/sqlite3/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=/home/sysadmin/Desktop/sqlite/sqlite3/build/intermediates/ndkBuild/release/lib sqliteX}
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteCommon.cpp
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteConnection.cpp
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteGlobal.cpp
[arm64-v8a] Compile++ : sqliteX <= android_database_SQLiteDebug.cpp
[arm64-v8a] Compile++ : sqliteX <= JNIHelp.cpp
[arm64-v8a] Compile++ : sqliteX <= JniConstants.cpp
[arm64-v8a] Compile : sqliteX <= sqlite3.c

/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259195:14: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
v8 = vaeseq_u8(v8, vdupq_n_u8(0));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259195:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
v8 = vaeseq_u8(v8, vdupq_n_u8(0));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259258:26: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
keySchedule[j] = vaesimcq_u8(tempKeySchedule[j]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259258:24: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
keySchedule[j] = vaesimcq_u8(tempKeySchedule[j]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259305:18: warning: implicit declaration of function 'vaesmcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259305:29: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259305:16: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259307:16: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259307:14: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259329:18: warning: implicit declaration of function 'vaesmcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259329:29: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259329:16: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259331:16: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99 [-Wimplicit-function-declaration]
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259331:14: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259381:14: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259381:26: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259381:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259383:12: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesdq_u8(data, key[1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259383:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesdq_u8(data, key[1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259398:14: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259398:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259400:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesdq_u8(data, key[1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259426:14: warning: implicit declaration of function 'vaesimcq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259426:26: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259426:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259428:12: warning: implicit declaration of function 'vaesdq_u8' is invalid in C99 [-Wimplicit-function-declaration]
data = vaesdq_u8(data, key[1]);
^
/home/sysadmin/Desktop/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:259428:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
data = vaesdq_u8(data, key[1]);
^ ~~~~~~~~~~~~~~~~~~~~~~~
15 warnings and 12 errors generated.
make: *** [/home/sysadmin/Android/Sdk/ndk/25.0.8775105/build/core/build-binary.mk:422: /home/sysadmin/Desktop/sqlite/sqlite3/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/objs/sqliteX/sqlite3.o] Error 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 31s
2 actionable tasks: 2 executed
sysadmin@sysadmin-VirtualBox:~/Desktop/sqlite/sqlite3$

@subu1979
Copy link
Author

subu1979 commented Oct 6, 2022

Building succeeds only for "Build sqliteX_armeabi-v7a"

@utelle
Copy link
Owner

utelle commented Oct 6, 2022

Unfortunately I'm not able to reproduce the problems you experience.

Did you apply any further changes to the build files? For example, you seem to use a different NDK version than that that is referenced in the original SQLite Android files.

@utelle
Copy link
Owner

utelle commented Oct 11, 2022

I'm going to close this issue for now, because I can't reproduce the problem. For me the Android build works without any issues. Therefore I suspect that something is wrong with your environment or that you applied some unmentioned changes causing the problem.

If you still feel that this project is to blame for the problem, you have to provide more detailed information (versions and settings of the tools you are using, and so on).

@utelle utelle closed this as completed Oct 11, 2022
@Nailik
Copy link

Nailik commented Oct 20, 2022

I can reproduce the issue with the errors
error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
when using android ndk above 23.

  • ndkVersion '23.2.8568313' (works)
  • ndkVersion '24.0.8215888' (errors)
  • ndkVersion '25.1.8937393' (errors)
    I supressed all waarnings by using
 externalNativeBuild {
                ndkBuild {
                    cFlags += '-w'
                }
            }

And remaining are the following errors:

sqlite3.c:259195:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
          v8 = vaeseq_u8(v8, vdupq_n_u8(0));
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259258:24: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
          keySchedule[j] = vaesimcq_u8(tempKeySchedule[j]);
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259305:16: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
        feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259307:14: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
      feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259329:16: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
        feedback = vaesmcq_u8(vaeseq_u8(feedback, key[j]));
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259331:14: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
      feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sqlite3.c:259381:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
        data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259383:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
      data = vaesdq_u8(data, key[1]);
           ^ ~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259398:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
        data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259400:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
      data = vaesdq_u8(data, key[1]);
           ^ ~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259426:12: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
        data = vaesimcq_u8(vaesdq_u8(data, key[numberOfRounds-j]));
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sqlite3.c:259428:10: error: assigning to 'uint8x16_t' (vector of 16 'uint8_t' values) from incompatible type 'int'
      data = vaesdq_u8(data, key[1]);
           ^ ~~~~~~~~~~~~~~~~~~~~~~~

@utelle
Copy link
Owner

utelle commented Oct 20, 2022

@Nailik Thanks for testing. I have to admit that I hadn't installed NDK version 25 in my test environment. Indeed it works for NDK versions up to 23, but not for higher ones.

I compared the include files arm_neon.h of version 23 and 25, and in fact there is a difference: Up to version 23 the required functions are defined, if the symbol __ARM_FEATURE_CRYPTO is defined, but for higher versions the symbol __ARM_FEATURE_AES is checked.

Defining the symbol __ARM_FEATURE_AES by adding the line

#define __ARM_FEATURE_AES 1

after line 259095 of sqlite3mc_amalgamation.c

#define __ARM_FEATURE_CRYPTO 1

should fix the issue. Could you please confirm? TIA.

@Nailik
Copy link

Nailik commented Oct 20, 2022

I can confirm, that this line fixes the issues !

utelle added a commit that referenced this issue Oct 20, 2022
Define symbol `__ARM_FEATURE_AES` to make the code compatible with Android NDK 24 and higher.
@utelle
Copy link
Owner

utelle commented Oct 20, 2022

Thanks for confirming. Commit 4edf735 applies this fix. A new release (including the amalgamation) will be made shortly after the release of the next SQLite version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants