Quantcast

Build issue on Mac (building for Android)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Build issue on Mac (building for Android)

Ignacio Rodrigo
Hi all,

I found this issue while building the SQLite C library for an Android app on my Mac. I’m using the amalgamated version of SQLIte 3.8.11.1.

I think it could be a valid issue, but it’s the first time I use the library so please let me know if I’m missing something obvious.

Building the library fails because it tries to use mmap but <sys/mman.h> has not been included.

I found that <sys/mman.h> is only included if the following conditions are met:

1. #if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0
2. #if SQLITE_OS_UNIX

The first precondition is checked right before the #include <sys/mman.h> line, so it’s obvious. But the second precondition is checked several lines above the include.

Then I noticed that before using mman, it checks that the first precondition is true, but it doesn’t check for the second precondition which is false in mi case, and that’s why the build is failing for me.

I think the exact same conditions which are checked before the include should also be checked again before using it, what do you think?

I also confirmed this is still an issue in the latest version of the source code, 3.18.0, which I downloaded here: sqlite-amalgamation-3180000.zip <http://sqlite.org/2017/sqlite-amalgamation-3180000.zip>

Please let me know if you need any more information about my dev environment or something, but I think it should be pretty easy to check this by just looking at the code.

Thanks in advance,
Ignacio Rodrigo
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...