Subject: [Boost-bugs] [Boost C++ Libraries] #13230: _FILE_OFFSET_BITS=64 breaks compilation with Android NDK r15 and API<24
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-09-27 18:09:30
#13230: _FILE_OFFSET_BITS=64 breaks compilation with Android NDK r15 and API<24
------------------------------+-------------------------
Reporter: d.mikhirev@⦠| Owner: Beman Dawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.65.0 | Severity: Problem
Keywords: |
------------------------------+-------------------------
Behavior of `_FILE_OFFSET_BITS` in Android NDK is described at
android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md
> Android support for `_FILE_OFFSET_BITS=64` (which turns off_t into
`off64_t` and replaces each `off_t` function with its `off64_t`
counterpart, such as `lseek` in the source becoming `lseek64` at runtime)
was added late. Even when it became available for the platform, it wasnât
available from the NDK until !r15. Before NDK !r15, `_FILE_OFFSET_BITS=64`
silently did nothing: all code compiled with that was actually using a
32-bit `off_t`. With a new enough NDK, the situation becomes complicated.
If youâre targeting an API before 21, almost all functions that take an
`off_t` become unavailable. Youâve asked for their 64-bit equivalents, and
none of them (except `lseek`/`lseek64`) exist. As you increase your target
API level, youâll have more and more of the functions available. API 12
adds some of the `<unistd.h>` functions, API 21 adds mmap, and by API 24
you have everything including `<stdio.h>`.
In `filesystem/src/operations.cpp` `_FILE_OFFSET_BITS` is unconditionally
defined to `64` in hope that
> at worst, these defines may have no effect
It actually breaks compilation with Android NDK !r15 if `__ANDROID_API__`
is less than 24.
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13230> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-09-27 18:15:56 UTC