Prechádzať zdrojové kódy

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
Brad King 4 rokov pred
rodič
commit
a4b6743a3b
1 zmenil súbory, kde vykonal 10 pridanie a 0 odobranie
  1. 10 0
      bootstrap

+ 10 - 0
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