-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
make sqlite v3.20.0 #210
Comments
Seems unlikely it's an emscripten bug, but in theory, maybe clang fixed a bug in the preprocessor which sqlite depended on? If so, you can bisect emscripten versions if you find a good one and a bad one, to see where the problem started. |
Only reason I mention it is because this occurs only in 3.2.0 of SQLite, and it appears they started using the preprocessor differently in this version compared to 3.1.9 If you look at sqlite.c, you see that on 3.2.0 a new compiler preprocessor directive that's causing the issue: #if SQLITE_INT64_TYPE
"INT64_TYPE",
#endif This doesn't exist in 3.1.9. Per the comment in 3.2.0@line 69 : ** BEGIN CODE GENERATED BY tool/mkctime.tcl I believe new code was added into the amalgamation that previous builds haven't seen before. The only way the preprocessor was used before was when the flag was not treated as a |
Here's how the same #ifdef SQLITE_INT64_TYPE
typedef SQLITE_INT64_TYPE sqlite_int64; Notice now how it fails if it's used as
|
Hmm, if there's something wrong in sqlite 2.0 in those macros, I would expect it to also cause problems in a native build with clang. Might be worth checking that (but I would expect a stable release of sqlite to work properly, so maybe unlikely to fail). |
$ clang sqlite3.c -fsyntax-only
$ clang sqlite3.c -S -O3 -o -
# ... clean outout no errors This was on sqlite 3.2 on the amalgamation file, MD5 |
Very strange. I would try to reduce this to a small standalone testcase. Then either file that on emscripten, or maybe i the process the underlying bug will reveal itself. |
What has changed or is everything the same? |
Compiling sql.js with sqlite 3.20.1: http://sqlite.org/2017/sqlite-amalgamation-3200100.zip
|
problems again) coffee --version emcc --version sqlite error: Uncaught TypeError: Cannot read property 'Database' of undefined |
clear install for linux make
|
Uncaught abort("Assertion failed: Cannot call unknown function RegisterExtensionFunctions, make sure it is exported"). Build with -s ASSERTIONS=1 for more info. |
I've filed a bug with SQLite for the |
@kripken : Can you elaborate on what the original intent of setting |
Ah, nevermind. This bug was fixed in SQL.js with this commit, that removed the -DSQLITE_INT64_TYPE: |
This issue is fixed by #255 |
make
Generate llvm bitcode
/home/kirill/emsdk/emscripten/1.37.13/emcc -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DISABLE_LFS -DLONGDOUBLE_TYPE=double -DSQLITE_INT64_TYPE="long long int" -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS c/sqlite3.c -o c/sqlite3.bc
c/sqlite3.c:385:5: error: token is not a valid binary operator in a preprocessor subexpression
#if SQLITE_INT64_TYPE
^~~~~~~~~~~~~~~~~
:8:32: note: expanded from here
#define SQLITE_INT64_TYPE long long int
~~~~ ^
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
Makefile:42: ошибка выполнения рецепта для цели «c/sqlite3.bc»
make: *** [c/sqlite3.bc] Ошибка 1
The text was updated successfully, but these errors were encountered: