From a4b6743a3bba9c591a7750facec2627934879ff0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Jun 2021 12:41:07 -0400 Subject: bootstrap: Compile with _FILE_OFFSET_BITS=64 on Linux To avoid problems accessing filesystem, explicitly use 64-bit file offsets in case the compilation model is 32-bit. This change was made for the main CMake build by commit 5b10f96793 (Linux: Compile with _FILE_OFFSET_BITS=64 on 32-bit Linux, 2020-09-23, v3.19.0-rc1~112^2), but conditionally on 32-bit Linux. For bootstrap, just always add the definition instead of trying to detect the architecture. Fixes: #22328 --- bootstrap | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bootstrap b/bootstrap index f8d2f69..dc5ed0b 100755 --- a/bootstrap +++ b/bootstrap @@ -1747,6 +1747,16 @@ if test "x${cmake_ansi_cxx_flags}" != "x"; then cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}" fi +system_flags='' +case "${cmake_system}" in + # Ensure filesystem access uses 64-bit offsets even on 32-bit hosts. + *Linux*) system_flags='-D_FILE_OFFSET_BITS=64' ;; +esac +if test "x${system_flags}" != "x"; then + cmake_c_flags="${cmake_c_flags} ${system_flags}" + cmake_cxx_flags="${cmake_cxx_flags} ${system_flags}" +fi + if test "x${cmake_c_flags}" != "x"; then cmake_c_flags="${cmake_c_flags} " fi -- cgit v0.12