summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-23 12:41:07 -0400
committerBrad King <brad.king@kitware.com>2021-06-23 12:46:37 -0400
commita4b6743a3bba9c591a7750facec2627934879ff0 (patch)
treec023473b9b403f7fec69a6089113f8623571820d /bootstrap
parent0aae790a5edc2f8cc7501f61c011409c55d32d89 (diff)
downloadcmake-a4b6743a3bba9c591a7750facec2627934879ff0.tar.gz
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
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap10
1 files changed, 10 insertions, 0 deletions
diff --git a/bootstrap b/bootstrap
index f8d2f693c2..dc5ed0b477 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