File cmake-11505.patch of Package cmake

From cea7f7fc328955de5632f856bfc0474749b50219 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 11 Dec 2025 14:33:49 -0500
Subject: [PATCH 3/3] Linux: Do not force 64-bit `time_t` on 32-bit archs with
 system libarchive

Commit 1b9e8f833f (Linux: Compile with 64-bit time_t even on 32-bit
architectures, 2025-06-26, v4.1.0-rc2~16^2) broke running with a
system-provided libarchive that uses a 32-bit `time_t`.  If CMake
is configured to build with a system libarchive, assume the user
has taken responsibility to match `time_t` sizes.

Fixes: #27448
---
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 1d2ed5a300f..62e5233a800 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -68,8 +68,14 @@ 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 _TIME_BITS=64)
+  # Use 64-bit off_t even in 32-bit builds.
+  add_compile_definitions(_FILE_OFFSET_BITS=64)
+
+  # Use 64-bit time_t even in 32-bit builds.  Skip this with
+  # system libarchive because its ABI uses the default time_t.
+  if (NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
+    add_compile_definitions(_TIME_BITS=64)
+  endif()
 endif()
 
 # Workaround for TOC Overflow on ppc64
-- 
GitLab
openSUSE Build Service is sponsored by