guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/08: build-system/gnu: Explicity declare the _FILE_OFFSET_BITS we want


From: guix-commits
Subject: 03/08: build-system/gnu: Explicity declare the _FILE_OFFSET_BITS we want.
Date: Sun, 4 Oct 2020 03:30:10 -0400 (EDT)

dannym pushed a commit to branch wip-file-offset-bits-64-sledgehammer
in repository guix.

commit 410520afa857145234df6852b92069071f5fdc6a
Author: Danny Milosavljevic <dannym@scratchpost.org>
AuthorDate: Tue Sep 29 16:03:44 2020 +0200

    build-system/gnu: Explicity declare the _FILE_OFFSET_BITS we want.
    
    * guix/build/gnu-build-system.scm (set-FILE-OFFSET-BITS): New procedure.
    (%standard-phases): Add it.
---
 guix/build/gnu-build-system.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index d3347c9..1a1c462 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -60,6 +60,17 @@ See 
https://reproducible-builds.org/specs/source-date-epoch/.";
   (setenv "SOURCE_DATE_EPOCH" "1")
   #t)
 
+(define* (set-FILE-OFFSET-BITS #:rest _)
+  "Define '_FILE_OFFSET_BITS' using the C preprocessor.
+This ensures that 32 bit and 64 bit user space both can handle results
+returned from a 64 bit kernel.
+See https://bugzilla.kernel.org/show_bug.cgi?id=205957.";
+  ;; Setting CFLAGS here makes packages not default CFLAGS.
+  ;; Since glibc (and probably other packages) don't like being built without 
optimization, enable optimization here.
+  (setenv "CFLAGS" "-D_FILE_OFFSET_BITS=64 -g -O2")
+  (setenv "CXXFLAGS" "-D_FILE_OFFSET_BITS=64 -g -O2")
+  #t)
+
 (define (first-subdirectory directory)
   "Return the file name of the first sub-directory of DIRECTORY."
   (match (scandir directory
@@ -803,7 +814,7 @@ which cannot be found~%"
   ;; Standard build phases, as a list of symbol/procedure pairs.
   (let-syntax ((phases (syntax-rules ()
                          ((_ p ...) `((p . ,p) ...)))))
-    (phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack
+    (phases set-SOURCE-DATE-EPOCH set-FILE-OFFSET-BITS set-paths 
install-locale unpack
             bootstrap
             patch-usr-bin-file
             patch-source-shebangs configure patch-generated-file-shebangs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]