32-bit android uses 32-bit off_t by default. When building with
-D_FILE_OFFSET_BITS=64 with unified headers off_t are promoted
to 64-bit, but there are bugs in the toolchain and spotty support
for it in the platform (not all functions are available until
android-24, and the platform zlib is compiled with 32-bit off_t).
Also, unless every library&program is rebuilt with 64-bit off_t,
including user-built ones, we risk a mismatch between programs and
libraries which can cause serious (but sometimes subtle) runtime
failures.
As -D_FILE_OFFSET_BITS=64 is not that important for most users
(with mariadb requiring it as an exception), we drop the support
for now by patching it away in <sys/cdefs.h>.
EXPERIMENTAL STATUS!
To try things out: Define TERMUX_UNIFIED_HEADERS=1 and build to
use the new unified headers.
This causes ndk_patches_unified/ to be used to patch the NDK header
files instead of ndk_patches/.
The docker image has been updated, use
./scripts/update-docker.sh
to update.
Note that we are still using the old deprecated non-unified headers
- updating to that is the next step.
* remove ndk_patches/sys-shm.h.patch
add a note about libandroid-shmem and posix semaphores
* libandroid-shmem: enable package
* separate function to replace autoconf guess scripts
For those using Docker build environments: run scripts/update-docker.sh
to pull the latest Docker image with r14 installed.
Otherwise, remove the $NDK directory (defaults to
$HOME/lib/android-ndk if not setup in the environment) and run
scripts/setup-android-sdk.sh to setup a r14 installation.
When having an already downloaded source archive, use the checksum
to validated it. This avoids problems if the file has been modified
by mistake after downloading in a previous build and detects if
an incorrect checksum has been specified.