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

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

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:


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: <>

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]