@@ -83,6 +83,8 @@ AC_PROG_CC
AC_PROG_CXX
CXXFLAGS="$save_CXXFLAGS"
+AC_SYS_LARGEFILE
+
# Runs configure.host, and assorted other critical bits. Sets
# up critical shell variables.
GLIBCXX_CONFIGURE
@@ -1014,6 +1014,7 @@ allstamped = \
# catenation.
allcreated = \
${host_builddir}/c++config.h \
+ ${host_builddir}/largefile-config.h \
${thread_host_headers} \
${pch_build}
@@ -1237,10 +1238,29 @@ stamp-float128:
echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128
endif
+# This header is not installed, it's only used to build libstdc++ itself.
+${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \
+ ${glibcxx_srcdir}/include/bits/c++config
+ @echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@
+ @echo '# error "This file must be included before any others"' >> $@
+ @echo '#endif' >> $@
+ @echo >> $@
+ @echo '/* Enable large inode numbers on Mac OS X 10.5. */' >> $@
+ @echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@
+ @echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@
+ @echo '#endif' >> $@
+ @echo >> $@
+ @echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@
+ @grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@
+ @echo >> $@
+ @echo '/* Define for large files, on AIX-style hosts. */' >> $@
+ @grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@
+
# NB: The non-empty default ldbl_compat works around an AIX sed
# oddity, see libstdc++/31957 for details.
${host_builddir}/c++config.h: ${CONFIG_HEADER} \
${glibcxx_srcdir}/include/bits/c++config \
+ ${host_builddir}/largefile-config.h \
stamp-${host_alias} \
${toplevel_srcdir}/gcc/DATESTAMP \
stamp-namespace-version \
@@ -1278,6 +1298,9 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
-e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
-e 's/VERSION/_GLIBCXX_VERSION/g' \
-e 's/WORDS_/_GLIBCXX_WORDS_/g' \
+ -e 's/_DARWIN_USE_64_BIT_INODE/_GLIBCXX_DARWIN_USE_64_BIT_INODE/g' \
+ -e 's/_FILE_OFFSET_BITS/_GLIBCXX_FILE_OFFSET_BITS/g' \
+ -e 's/_LARGE_FILES/_GLIBCXX_LARGE_FILES/g' \
-e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \
-e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \
< ${CONFIG_HEADER} >> $@ ;\
@@ -26,6 +26,7 @@
# define _GLIBCXX_USE_CXX11_ABI 1
#endif
+#include <bits/largefile-config.h>
#include <filesystem>
#include <utility>
#include <stack>
@@ -28,6 +28,7 @@
# define NEED_DO_SPACE
#endif
+#include <bits/largefile-config.h>
#include <filesystem>
#include <functional>
#include <ostream>
@@ -950,7 +951,7 @@ fs::file_size(const path& p, error_code& ec) noexcept
S(const stat_type& st) : type(make_file_type(st)), size(st.st_size) { }
S() : type(file_type::not_found) { }
file_type type;
- size_t size;
+ uintmax_t size;
};
auto s = do_stat(p, ec, [](const auto& st) { return S{st}; }, S{});
if (s.type == file_type::regular)
@@ -26,6 +26,7 @@
# define _GLIBCXX_USE_CXX11_ABI 1
#endif
+#include <bits/largefile-config.h>
#include <experimental/filesystem>
#ifndef _GLIBCXX_HAVE_DIRENT_H
@@ -28,6 +28,7 @@
# define NEED_DO_SPACE
#endif
+#include <bits/largefile-config.h>
#include <experimental/filesystem>
#include <functional>
#include <ostream>
@@ -806,7 +807,7 @@ fs::file_size(const path& p, error_code& ec) noexcept
S(const stat_type& st) : type(make_file_type(st)), size(st.st_size) { }
S() : type(file_type::not_found) { }
file_type type;
- size_t size;
+ uintmax_t size;
};
auto s = do_stat(p, ec, [](const auto& st) { return S{st}; }, S{});
if (s.type == file_type::regular)