diff --git a/debian/changelog b/debian/changelog index 1e8f9e107..fc99af105 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ cmake (3.18.4-1) UNRELEASED; urgency=medium [ Felix Geyer ] * New upstream release + * Cherry-pick commit to build with -D_FILE_OFFSET_BITS=64 on 32bit archs. + - Add Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch + - Closes: #965046 -- Felix Geyer Thu, 15 Oct 2020 20:02:27 +0200 diff --git a/debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch b/debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch new file mode 100644 index 000000000..71239a12d --- /dev/null +++ b/debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch @@ -0,0 +1,34 @@ +From 5b10f96793ab6f3a4ef446d67c09ea91b7898584 Mon Sep 17 00:00:00 2001 +From: Marc Chevrier +Date: Wed, 23 Sep 2020 18:06:35 +0200 +Subject: [PATCH] Linux: Compile with _FILE_OFFSET_BITS=64 on 32-bit Linux + +To avoid problems accessing filesystem, use 64-bit file offsets when +compilation model is 32-bit. This explicit definition is needed now +that KWSys does not provide LFS settings in its headers anymore. + +Fixes: #20568 +--- + CompileFlags.cmake | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/CompileFlags.cmake b/CompileFlags.cmake +index 053259f47c..1c5f1beca9 100644 +--- a/CompileFlags.cmake ++++ b/CompileFlags.cmake +@@ -53,6 +53,12 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") + endif() + 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_definitions(-D_FILE_OFFSET_BITS=64) ++endif() ++ + # Workaround for TOC Overflow on ppc64 + set(bigTocFlag "") + if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND +-- +GitLab + diff --git a/debian/patches/series b/debian/patches/series index 5a528003f..429444c88 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ disable_fileapi_json_extra_test.patch +Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch