From c9c5b3060d2edb47ebfa7974fdde3154036717c2 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 8 Apr 2022 10:13:15 +0100 Subject: guix: compile glibc without -werror MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- contrib/guix/manifest.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index b61c2b8899..1b2590013e 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -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))))) -- cgit v1.2.3