Build filesystem library with large file support

Programming / Compilers / GCC - redi [138bc75d-0d04-0410-961f-82ee72b054a4] - 4 October 2019 15:08 EDT

Enable AC_SYS_LARGEFILE to set the macros needed for large file APIs to be used by default. We do not want to define those macros in the public headers that users include. The values of the macros are copied to a separate file that is only included by the filesystem sources during the build, and then the macros in are renamed so that they don't have any effect in user code including our headers.

Also use larger type for result of filesystem::file_size to avoid truncation of large values on 32-bit systems (PR 91947).

PR libstdc++/81091 PR libstdc++/91947
- configure.ac: Use AC_SYS_LARGEFILE to enable 64-bit file APIs.
- config.h.in: Regenerate:
- configure: Regenerate:
- include/Makefile.am (${host_builddir}/largefile-config.h): New target to generate config header for filesystem library. (${host_builddir}/c++config.h): Rename macros for large file support.
- include/Makefile.in: Regenerate.
- src/c++17/fs_dir.cc: Include new config header.
- src/c++17/fs_ops.cc: Likewise. (filesystem::file_size): Use uintmax_t for size.
- src/filesystem/dir.cc: Include new config header.
- src/filesystem/ops.cc: Likewise. (experimental::filesystem::file_size): Use uintmax_t for size.

40c11e51931 Build filesystem library with large file support
libstdc++-v3/ChangeLog | 16 +++
libstdc++-v3/config.h.in | 11 ++
libstdc++-v3/configure | 223 +++++++++++++++++++++++++++++++++++--
libstdc++-v3/configure.ac | 2 +
libstdc++-v3/include/Makefile.am | 23 ++++
libstdc++-v3/include/Makefile.in | 23 ++++
libstdc++-v3/src/c++17/fs_dir.cc | 1 +
libstdc++-v3/src/c++17/fs_ops.cc | 3 +-
libstdc++-v3/src/filesystem/dir.cc | 1 +
libstdc++-v3/src/filesystem/ops.cc | 3 +-
10 files changed, 294 insertions(+), 12 deletions(-)

Upstream: gcc.gnu.org


  • Share