Browse Source

Linux: Compile with 64-bit time_t even on 32-bit architectures

Extend commit 5b10f96793 (Linux: Compile with _FILE_OFFSET_BITS=64 on
32-bit Linux, 2020-09-23, v3.19.0-rc1~112^2) to cover `time_t` too,
by compiling with `_TIME_BITS=64`.
release
Brad King 1 month ago
parent
commit
1b9e8f833f
  1. 2
      CompileFlags.cmake
  2. 3
      Tests/RunCMake/string/RunCMakeTest.cmake

2
CompileFlags.cmake

@ -69,7 +69,7 @@ endif()
# Use 64-bit off_t on 32-bit Linux
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
# ensure 64bit offsets are used for filesystem accesses for 32bit compilation
add_compile_definitions(_FILE_OFFSET_BITS=64)
add_compile_definitions(_FILE_OFFSET_BITS=64 _TIME_BITS=64)
endif()
# Workaround for TOC Overflow on ppc64

3
Tests/RunCMake/string/RunCMakeTest.cmake

@ -23,9 +23,6 @@ run_cmake(JoinNoVar)
run_cmake(Timestamp)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX" # FIXME: Needs 64-bit build
AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS" # FIXME: Needs 64-bit build
AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
CMAKE_SYSTEM_PROCESSOR MATCHES "^(hppa|parisc|parisc64|sparc|sparc64)$" # FIXME: 32-bit time_t?
)
)
run_cmake(Timestamp2038)
endif()

Loading…
Cancel
Save