gnu: glibc: Work around broken GNU Mach header detection.

* gnu/packages/base.scm (%glibc/hurd-configure-flags): New variable.
(glibc)[arguments]: Use it.
(glibc/hurd-headers)[arguments]: likewise.
* gnu/packages/cross-base.scm (cross-libc*): Likewise.

Co-authored-by: Josselin Poiret <dev@jpoiret.xyz>
This commit is contained in:
Ludovic Courtès 2023-03-26 21:40:46 +02:00
parent d9dc32b871
commit 065d766f09
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 19 additions and 4 deletions

View file

@ -755,6 +755,17 @@ (define* (make-ld-wrapper name #:key
(home-page "https://www.gnu.org/software/guix//") (home-page "https://www.gnu.org/software/guix//")
(license gpl3+))) (license gpl3+)))
(define-public %glibc/hurd-configure-flags
;; 'configure' in glibc 2.35 omits to pass '-ffreestanding' when detecting
;; Mach headers. This is fixed in glibc commits
;; 8b8c768e3c701ed1993789bb46acb8a12c7a93df and
;; 7685630b98ca2a3f5de86eadf130993e6cf998a0; as a workaround, bypass those
;; tests.
'("ac_cv_header_mach_mach_types_defs=yes"
"ac_cv_header_mach_mach_types_h=yes"
"ac_cv_header_mach_machine_ndr_def_h=no"
"libc_cv_mach_task_creation_time=yes"))
(define-public glibc (define-public glibc
;; This is the GNU C Library, used on GNU/Linux and GNU/Hurd. Prior to ;; This is the GNU C Library, used on GNU/Linux and GNU/Hurd. Prior to
;; version 2.28, GNU/Hurd used a different glibc branch. ;; version 2.28, GNU/Hurd used a different glibc branch.
@ -854,7 +865,8 @@ (define-public glibc
;; On GNU/Hurd we get discarded-qualifiers warnings for ;; On GNU/Hurd we get discarded-qualifiers warnings for
;; 'device_write_inband' among other things. Ignore them. ;; 'device_write_inband' among other things. Ignore them.
,@(if (hurd-target?) ,@(if (hurd-target?)
'("--disable-werror") `("--disable-werror"
,@%glibc/hurd-configure-flags)
'())) '()))
#:tests? #f ; XXX #:tests? #f ; XXX
@ -1392,9 +1404,10 @@ (define-public glibc/hurd-headers
(arguments (arguments
(substitute-keyword-arguments (package-arguments glibc) (substitute-keyword-arguments (package-arguments glibc)
;; We just pass the flags really needed to build the headers. ;; We just pass the flags really needed to build the headers.
((#:configure-flags _) ((#:configure-flags flags)
`(list "--enable-add-ons" `(list "--enable-add-ons"
"--host=i586-pc-gnu")) "--host=i586-pc-gnu"
,@%glibc/hurd-configure-flags))
((#:phases _) ((#:phases _)
'(modify-phases %standard-phases '(modify-phases %standard-phases
(replace 'install (replace 'install

View file

@ -577,7 +577,9 @@ (define* (cross-libc* target
((#:configure-flags flags) ((#:configure-flags flags)
`(cons ,(string-append "--host=" target) `(cons ,(string-append "--host=" target)
,(if (target-hurd? target) ,(if (target-hurd? target)
`(cons "--disable-werror" ,flags) `(append (list "--disable-werror"
,@%glibc/hurd-configure-flags)
,flags)
flags))) flags)))
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases `(modify-phases ,phases