Closed johnfound closed 1 year ago
I am trying to compile with MUSL, using the following command:
gcc -m32 -Os -shared -fno-stack-protector -mpreferred-stack-boundary=2 -march=x86-64 \ -fno-omit-frame-pointer \ -specs musl/musl-gcc.specs \ -DSQLITE_DEFAULT_MEMSTATUS=0 \ -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \ -DSQLITE_MAX_EXPR_DEPTH=0 \ -DSQLITE_OMIT_DEPRECATED \ -DSQLITE_OMIT_PROGRESS_CALLBACK \ -DSQLITE_OMIT_SHARED_CACHE \ -DSQLITE_ENABLE_FTS5 \ -DSQLITE_OMIT_COMPLETE \ -DSQLITE_OMIT_GET_TABLE \ -DSQLITE_OMIT_UTF16 \ -DSQLITE_OMIT_AUTHORIZATION \ -DSQLITE_THREADSAFE=1 \ -DSQLITE_ENABLE_STAT4 \ -DHAVE_USLEEP \ ./sqlite3.c -o ./libsqlite3.so \
First, some general remarks:
SQLITE_OMIT_*
may or may not work with the amalgamation (see SQLite's documentation about omitting features)sqlite3.c
is the original SQLite amalgamation while sqlite3mc_amalgamation.c
is the amalgamation of this project (but maybe you renamed the file). At first got an error:
./sqlite3.c: In function ‘sqlite3FinishCoding’: ./sqlite3.c:118477:15: error: ‘Parse’ has no member named ‘nTableLock’ 118477 | if( pParse->nTableLock>0 && db->init.busy==0 ){ | ^~ Error: Can't compile SQLite.
This problem is related to the user authentication extension, which is enabled by default, if not explicitly disabled. Just add
-DSQLITE_USER_AUTHENTICATION=0
and the error will go away. This is a known problem with the user authentication extension, but the SQLite core developer team has not addressed this (and other) issues related to this extension. And unfortunately I don't know enough about the inner workings of SQLite to fix it on my own.
When I removed SQLITE_OMIT_SHARED_CACHE for test (because Parse depends on it, which is mistake IMHO),
Yes, that is definitely a bug, but see my comment above.
got another error:
/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/include/wmmintrin.h:87:1: error: inlining failed in call to ‘always_inline’ ‘_mm_aeskeygenassist_si128’: target specific option mismatch 87 | _mm_aeskeygenassist_si128 (__m128i __X, const int __C) | ^~~~~~~~~~~~~~~~~~~~~~~~~ ./sqlite3.c:265027:16: note: called from here 265027 | temp = _mm_extract_epi32(_mm_aeskeygenassist_si128(_mm_setr_epi32(0, temp, 0, 0), 0), 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: Can't compile SQLite.
Which is really strange, because I expected to not have external dependencies in the amalgamation source...
No, actually this is not strange. SQLite3mc uses native support for AES encryption. To make this native code compile with GCC it is necessary to specify the compiler options -msse4.2 -maes.
Yes, I have renamed the file, because the build scripts have hard coded name. Thank's for the information. Will test again and report the result.
It compiled now. Will test further. Thanks for the help.
I am trying to compile with MUSL, using the following command:
At first got an error:
When I removed SQLITE_OMIT_SHARED_CACHE for test (because Parse depends on it, which is mistake IMHO), got another error:
Which is really strange, because I expected to not have external dependencies in the amalgamation source...
Any advises are welcome.