summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2020-09-29 15:18:37 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2020-09-29 15:18:37 +0200
commit911e33ead1483ee802985453ef2c33e047113049 (patch)
tree4b7d1f71612fc7450737e09f02169efc4c71fc53
parent988b189c07db3accd05c1bc8180488c14d970c99 (diff)
gnu: cmake: Explicity declare the _FILE_OFFSET_BITS we want.
* gnu/packages/patches/cmake-file-offset-bits-64.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/cmake.scm (cmake-minimal)[source]: Use it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/cmake.scm2
-rw-r--r--gnu/packages/patches/cmake-file-offset-bits-64.patch34
3 files changed, 37 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 33f1b85549..c81e930594 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -871,6 +871,7 @@ dist_patch_DATA = \
%D%/packages/patches/clisp-remove-failing-test.patch \
%D%/packages/patches/clucene-pkgconfig.patch \
%D%/packages/patches/cmake-curl-certificates.patch \
+ %D%/packages/patches/cmake-file-offset-bits-64.patch \
%D%/packages/patches/coda-use-system-libs.patch \
%D%/packages/patches/collectd-5.11.0-noinstallvar.patch \
%D%/packages/patches/combinatorial-blas-awpm.patch \
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 03b1ce05c2..74dea1a56a 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -256,6 +256,8 @@ and workspaces that can be used in the compiler environment of your choice.")
(name "cmake-minimal")
(source (origin
(inherit (package-source cmake-bootstrap))
+ (patches (search-patches "cmake-curl-certificates.patch"
+ "cmake-file-offset-bits-64.patch"))
(snippet
(match (origin-snippet (package-source cmake-bootstrap))
((_ _ exp ...)
diff --git a/gnu/packages/patches/cmake-file-offset-bits-64.patch b/gnu/packages/patches/cmake-file-offset-bits-64.patch
new file mode 100644
index 0000000000..fef369dcf9
--- /dev/null
+++ b/gnu/packages/patches/cmake-file-offset-bits-64.patch
@@ -0,0 +1,34 @@
+From 5b10f96793ab6f3a4ef446d67c09ea91b7898584 Mon Sep 17 00:00:00 2001
+From: Marc Chevrier <marc.chevrier@gmail.com>
+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")
++ # 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
+