guix: compile glibc without -werror

Compiling glibc 2.24 and 2.27 with the new GCC 10 results in a number of new warnings,
i.e:
```bash
libc-tls.c: In function ‘__libc_setup_tls’:
libc-tls.c:208:30: error: array subscript 1 is outside the bounds of an interior zero-length array ‘struct dtv_slotinfo[0]’ [-Werror=zero-length-bounds]
  208 |   static_slotinfo.si.slotinfo[1].map = main_map;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from ../sysdeps/x86_64/ldsodefs.h:54,
                 from ../sysdeps/gnu/ldsodefs.h:46,
                 from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
                 from libc-tls.c:20:
../sysdeps/generic/ldsodefs.h:398:7: note: while referencing ‘slotinfo’
  398 |     } slotinfo[0];
      |       ^~~~~~~~
```

While we could try and backport all the patches required to fix these up, it would
currently seem easier to disable -Werror, which Guix uses by default when building
glibc.
pull/25076/head
fanquake 3 years ago
parent e3bab43329
commit c9c5b3060d
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -150,7 +150,7 @@ chain for " target " development."))
#:key
(base-gcc-for-libc gcc-7)
(base-kernel-headers base-linux-kernel-headers)
(base-libc (make-glibc-without-ssp glibc-2.24))
(base-libc (make-glibc-without-ssp (make-glibc-without-werror glibc-2.24)))
(base-gcc (make-gcc-rpath-link base-gcc)))
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
desirable for building Bitcoin Core release binaries."
@ -518,6 +518,9 @@ and endian independent.")
inspecting signatures in Mach-O binaries.")
(license license:expat))))
(define (make-glibc-without-werror glibc)
(package-with-extra-configure-variable glibc "enable_werror" "no"))
(define-public glibc-2.24
(package
(inherit glibc-2.31)
@ -604,7 +607,7 @@ inspecting signatures in Mach-O binaries.")
(list gcc-toolchain-7 "static")
(cond ((string-contains target "riscv64-")
(make-bitcoin-cross-toolchain target
#:base-libc glibc-2.27/bitcoin-patched
#:base-libc (make-glibc-without-werror glibc-2.27/bitcoin-patched)
#:base-kernel-headers base-linux-kernel-headers))
(else
(make-bitcoin-cross-toolchain target)))))

Loading…
Cancel
Save