diff options
author | Brad King <brad.king@kitware.com> | 2021-06-23 16:41:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-23 16:46:37 (GMT) |
commit | a4b6743a3bba9c591a7750facec2627934879ff0 (patch) | |
tree | c023473b9b403f7fec69a6089113f8623571820d /bootstrap | |
parent | 0aae790a5edc2f8cc7501f61c011409c55d32d89 (diff) | |
download | CMake-a4b6743a3bba9c591a7750facec2627934879ff0.zip CMake-a4b6743a3bba9c591a7750facec2627934879ff0.tar.gz CMake-a4b6743a3bba9c591a7750facec2627934879ff0.tar.bz2 |
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-x | bootstrap | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |