guix-commits
[Top][All Lists]
Advanced

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

02/08: gnu: glibc-mesboot0: Catch all cases of a glibc user not requesti


From: guix-commits
Subject: 02/08: gnu: glibc-mesboot0: Catch all cases of a glibc user not requesting 64-bit offsets and then using readdir regardless.
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 156e6ef349e56439234f33f9b3a3c867d59aa37d
Author: Danny Milosavljevic <dannym@scratchpost.org>
AuthorDate: Sun Oct 4 00:04:40 2020 +0200

    gnu: glibc-mesboot0: Catch all cases of a glibc user not requesting 64-bit
    offsets and then using readdir regardless.
    
    * gnu/packages/commencement.scm 
(glibc-mesboot0)[arguments]#<:phases>[patch-dirent]:
    Catch all cases of a glibc user not requesting 64-bit offsets and then using
    readdir regardless.
---
 gnu/packages/commencement.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index e5a4caa..8529313 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1398,6 +1398,26 @@ ac_cv_c_float_format='IEEE (little-endian)'
            ,(string-append "--prefix=" out)))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch-dirent
+           (lambda _
+             ;; See package "glibc" for why this is necessary.
+             (let ((port (open-file "dirent/dirent.h" "a")))
+               (display "
+#ifndef _LIBC
+#if __SIZEOF_LONG__ < 8
+#ifndef __USE_FILE_OFFSET64
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 32
+#warning \"Using -D_FILE_OFFSET_BITS=32 and using readdir is a bad idea, see 
<https://bugzilla.kernel.org/show_bug.cgi?id=205957>\"
+#else
+#undef readdir
+#define readdir @READDIR_WITHOUT_FILE_OFFSET64_IS_A_REALLY_BAD_IDEA@
+#endif
+#endif
+#endif
+#endif
+" port)
+               (close-port port))
+               #t))
          (add-after 'unpack 'apply-boot-patch
            (lambda* (#:key inputs #:allow-other-keys)
              (and (let ((patch (assoc-ref inputs "boot-patch")))



reply via email to

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