diff options
author | fanquake <fanquake@gmail.com> | 2022-05-18 09:50:13 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-05-18 09:57:03 +0100 |
commit | 84bf31f8e9842cb5f613151dc4c5a0ffa67a3a03 (patch) | |
tree | f8dd03349dfb746fc0551abd58e25e604230547b | |
parent | f7a1e676d536115aba649672ba1e68755a1c90dc (diff) | |
parent | 6b9d53e1ff0099a8d9abb3c389df96fa75eac3f5 (diff) |
Merge bitcoin/bitcoin#25076: guix: native GCC 10 toolchain for Linux builds
6b9d53e1ff0099a8d9abb3c389df96fa75eac3f5 guix: native GCC 10 toolchain for Linux builds (fanquake)
88fd3f81ec626c363a5846089d99305a9a9b343d guix: use -fcommon when building glibc 2.24 (fanquake)
0e51913595c4fbe32ce9811e3ff5bcf1ed5f9ddc guix: fix glibc 2.27 multiple definition warnings with GCC 10 (fanquake)
508bd4d35720fd611a7bdfed559f46e7dbc70272 guix: adjust RISC-V __has_include() patch to work with GCC 10 (fanquake)
c9c5b3060d2edb47ebfa7974fdde3154036717c2 guix: compile glibc without -werror (fanquake)
Pull request description:
Completes the migration to using a native GCC 10 toolchain for all HOSTS. This change means we'll now use GCC 10 when compiling glibc and friends (currently we use GCC 7), which is the same as our release compiler, except for macOS (Clang 10). See each commit for more details.
Guix build (x86_64):
```bash
9f7ef2dc4421aded7f594c272c4feb1fe04f70b6c3f1ab85ed40242851cc6193 guix-build-6b9d53e1ff00/output/aarch64-linux-gnu/SHA256SUMS.part
216fde83c860a59d14a03c0a5f27c1d11ba40388da280dd42843d7c24b652a47 guix-build-6b9d53e1ff00/output/aarch64-linux-gnu/bitcoin-6b9d53e1ff00-aarch64-linux-gnu-debug.tar.gz
55b8bef29285dcd066156c2eaccd99f7d6956c3d9691363ac7482ad459856fdc guix-build-6b9d53e1ff00/output/aarch64-linux-gnu/bitcoin-6b9d53e1ff00-aarch64-linux-gnu.tar.gz
f190e12f5d2fe8bfd891421752c8f31f728c7db66736ca46f97c1c2f3a346583 guix-build-6b9d53e1ff00/output/arm-linux-gnueabihf/SHA256SUMS.part
ac4abd22b115896ba870a3f2149c66b3ce9bd25b401a75cf560681276bacc99d guix-build-6b9d53e1ff00/output/arm-linux-gnueabihf/bitcoin-6b9d53e1ff00-arm-linux-gnueabihf-debug.tar.gz
9a9a26f15b90ca5e22687272b7c9487863106f358f54b4a4cd9bcc844e96259f guix-build-6b9d53e1ff00/output/arm-linux-gnueabihf/bitcoin-6b9d53e1ff00-arm-linux-gnueabihf.tar.gz
96f73e9f17e19720e3517ebfed06a4b5295759906186770627fb8c0beb18508a guix-build-6b9d53e1ff00/output/arm64-apple-darwin/SHA256SUMS.part
4c9937e7221c56373808feacff38492f4530a4db986a07da3e56d1a293a59569 guix-build-6b9d53e1ff00/output/arm64-apple-darwin/bitcoin-6b9d53e1ff00-arm64-apple-darwin-unsigned.dmg
f7c447fb40fa0d1382db0ec6b20a45c6dbc8660c004d41fa7418e40cc684200f guix-build-6b9d53e1ff00/output/arm64-apple-darwin/bitcoin-6b9d53e1ff00-arm64-apple-darwin-unsigned.tar.gz
067bbc0f7a50be93e469af855ab8bbb9dd598ee970db9ccfc99621a93d725348 guix-build-6b9d53e1ff00/output/arm64-apple-darwin/bitcoin-6b9d53e1ff00-arm64-apple-darwin.tar.gz
d8ac116bec19dde955c5d19c85d41e3899a75def3e1c27bc047aa17906d094af guix-build-6b9d53e1ff00/output/dist-archive/bitcoin-6b9d53e1ff00.tar.gz
822085203ae9a64de3443141cd0a5f222a344451a7fdc69820efd0aeee8eca5e guix-build-6b9d53e1ff00/output/powerpc64-linux-gnu/SHA256SUMS.part
78a488dad3acf22d99f97d7874c5bf0fc0bd83bd33d27af8f1a723cd949df1d9 guix-build-6b9d53e1ff00/output/powerpc64-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64-linux-gnu-debug.tar.gz
918477bee628771f3b927dba0e0e0ca0d0708cfe60a0cb47c10b98c403c9b266 guix-build-6b9d53e1ff00/output/powerpc64-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64-linux-gnu.tar.gz
738e2771d4a6141cd69838bb65f54d853032075c077e428c6daf1eabc9046fc0 guix-build-6b9d53e1ff00/output/powerpc64le-linux-gnu/SHA256SUMS.part
5e7ce848931c790780154f276fae9d2b8dc03c0e995bb123d950e432a54803bb guix-build-6b9d53e1ff00/output/powerpc64le-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64le-linux-gnu-debug.tar.gz
8caaf8bdc5e0a13a2e1c7242940d505c28a5fd2f2727c592b18f55530558f8c3 guix-build-6b9d53e1ff00/output/powerpc64le-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64le-linux-gnu.tar.gz
8aeed7814f839aa0624752090ae75dc77f6098d2ac2b4d526945e42efeff16b8 guix-build-6b9d53e1ff00/output/riscv64-linux-gnu/SHA256SUMS.part
e694fa6a3ca56fd121afe3cbf26cf9c17d0b4bac424e1b9086a095d63fc6f0fb guix-build-6b9d53e1ff00/output/riscv64-linux-gnu/bitcoin-6b9d53e1ff00-riscv64-linux-gnu-debug.tar.gz
8241e6c1f1a669ca5144b90796235d2a4b9c08bf75d6d2bf1b2862df8da626b3 guix-build-6b9d53e1ff00/output/riscv64-linux-gnu/bitcoin-6b9d53e1ff00-riscv64-linux-gnu.tar.gz
84d0d1391e07ac55684e107492def79fa0a6e404f2ec10f3130bd0734d031ad9 guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/SHA256SUMS.part
cde5bf4c3b1880b81b887b1b13293c1e91aac3f4ca9895aba515675e3dc69d1a guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/bitcoin-6b9d53e1ff00-x86_64-apple-darwin-unsigned.dmg
906cebff955e514202a0d93fcf0782441f42c7592ade3205c908554086322440 guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/bitcoin-6b9d53e1ff00-x86_64-apple-darwin-unsigned.tar.gz
c8a4522380d5ff22c800d73968b4758ed5edde346fc6720558285ce02251dec0 guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/bitcoin-6b9d53e1ff00-x86_64-apple-darwin.tar.gz
de2e24dfe08f31bfeca03aff70f3e38b2671272f357b430ce8a3d3879020745f guix-build-6b9d53e1ff00/output/x86_64-linux-gnu/SHA256SUMS.part
32c01add177f3a1c7fb85f1c687b502105a98919a0fa9e8675917c68cb651dfb guix-build-6b9d53e1ff00/output/x86_64-linux-gnu/bitcoin-6b9d53e1ff00-x86_64-linux-gnu-debug.tar.gz
c2af2390d8232463c824756ba4d88194f6fc3bfd0f71286237f2d3067d67ff25 guix-build-6b9d53e1ff00/output/x86_64-linux-gnu/bitcoin-6b9d53e1ff00-x86_64-linux-gnu.tar.gz
b3fa5cc4dbe908274f84ca4ee4bd8fad7b0d0678b5e47ca8e0134b8872d1262c guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/SHA256SUMS.part
69cff7bfa42918434f7aee4a5c1f87c824bfe387d5a40bea502437e320703b68 guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64-debug.zip
6c4ce699bdc9cd0fd5b3626b7c740b0d9f381f126a6581b38d481bddca74c25d guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64-setup-unsigned.exe
f5ca2fc6988e9a90ed7c47bd05c120a8d5a2c2a0bc0abcc076739d27869779b7 guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64-unsigned.tar.gz
73862bfc4c6a614e467b0b4f07a7264e4a758bacbf75c0ac49b76d253385dcec guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64.zip
```
Guix build (arm64):
```bash
63fd172e3bf01fe47e845c7b5af76b56b40ecd26f77363c9e5782c12997a1f3b guix-build-6b9d53e1ff00/output/arm-linux-gnueabihf/SHA256SUMS.part
6007a3ab95315a9e7206f32f13b6fc574833afd3e3d1ea0ed905800016fbf786 guix-build-6b9d53e1ff00/output/arm-linux-gnueabihf/bitcoin-6b9d53e1ff00-arm-linux-gnueabihf-debug.tar.gz
a172a098403a29cc6c2fdb8fdd388fab10e0e2477f78cb8c7ee0d8112442c5f4 guix-build-6b9d53e1ff00/output/arm-linux-gnueabihf/bitcoin-6b9d53e1ff00-arm-linux-gnueabihf.tar.gz
e07565d39160db87a857edc8ea4dc4444476837fc9d85fb17245efaa68b4ec41 guix-build-6b9d53e1ff00/output/arm64-apple-darwin/SHA256SUMS.part
b9cc419a750afd5688c5f2dbfb717fccb5f177fb60b07bfede792336f7a4c563 guix-build-6b9d53e1ff00/output/arm64-apple-darwin/bitcoin-6b9d53e1ff00-arm64-apple-darwin-unsigned.dmg
d9105b702f6756645efba5a4e47fc1efbca178e0a76b30c46dd6333f2362c1a2 guix-build-6b9d53e1ff00/output/arm64-apple-darwin/bitcoin-6b9d53e1ff00-arm64-apple-darwin-unsigned.tar.gz
d46ecdc6f485d78d8afe4e6d679e97844dc6f817cd470226290843b9e0a5c677 guix-build-6b9d53e1ff00/output/arm64-apple-darwin/bitcoin-6b9d53e1ff00-arm64-apple-darwin.tar.gz
d8ac116bec19dde955c5d19c85d41e3899a75def3e1c27bc047aa17906d094af guix-build-6b9d53e1ff00/output/dist-archive/bitcoin-6b9d53e1ff00.tar.gz
8f35311efd75f1a2a27c5090a3134648a3e58d40692d363f1fe0afce08925bcb guix-build-6b9d53e1ff00/output/powerpc64-linux-gnu/SHA256SUMS.part
b012ce67aa18f54ea688961a01de30f9b4127fee7184d1292ac8f664449972f5 guix-build-6b9d53e1ff00/output/powerpc64-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64-linux-gnu-debug.tar.gz
3ebd59090b02a295965923a1d74a2ce0aa23774d59116f62668e2a246343d971 guix-build-6b9d53e1ff00/output/powerpc64-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64-linux-gnu.tar.gz
2017c04652d18a29107e06a1efee44d93d01607f12f7af626e687a72eca06a7c guix-build-6b9d53e1ff00/output/powerpc64le-linux-gnu/SHA256SUMS.part
4520225674157af40168813a2497a2f79df8131b0a73251a3d44dbe67cb002d2 guix-build-6b9d53e1ff00/output/powerpc64le-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64le-linux-gnu-debug.tar.gz
9e7660470d56573c9c08470383d745910f2834586182a51b661eb10cc41fbf1d guix-build-6b9d53e1ff00/output/powerpc64le-linux-gnu/bitcoin-6b9d53e1ff00-powerpc64le-linux-gnu.tar.gz
2015b8d13798746e4d7e3a75250a2b83bb8cb9289410a1576f0e9892732e1931 guix-build-6b9d53e1ff00/output/riscv64-linux-gnu/SHA256SUMS.part
735c1a285933499406a4f6c396a12b13fcf79188100b541d532055c06092741c guix-build-6b9d53e1ff00/output/riscv64-linux-gnu/bitcoin-6b9d53e1ff00-riscv64-linux-gnu-debug.tar.gz
f541d5397e28558dea1976a79f6bfdb01f12d7b4031925247cb32ace2360782e guix-build-6b9d53e1ff00/output/riscv64-linux-gnu/bitcoin-6b9d53e1ff00-riscv64-linux-gnu.tar.gz
84d0d1391e07ac55684e107492def79fa0a6e404f2ec10f3130bd0734d031ad9 guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/SHA256SUMS.part
cde5bf4c3b1880b81b887b1b13293c1e91aac3f4ca9895aba515675e3dc69d1a guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/bitcoin-6b9d53e1ff00-x86_64-apple-darwin-unsigned.dmg
906cebff955e514202a0d93fcf0782441f42c7592ade3205c908554086322440 guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/bitcoin-6b9d53e1ff00-x86_64-apple-darwin-unsigned.tar.gz
c8a4522380d5ff22c800d73968b4758ed5edde346fc6720558285ce02251dec0 guix-build-6b9d53e1ff00/output/x86_64-apple-darwin/bitcoin-6b9d53e1ff00-x86_64-apple-darwin.tar.gz
51c1c6f683896a23767af2a7c6afe07030b6d5ad5a136b65f31b7e1f685c0f28 guix-build-6b9d53e1ff00/output/x86_64-linux-gnu/SHA256SUMS.part
6276d1ee54575b16386866f4898033d4dce9ea5a4e4635f7ae65d5bddecba35b guix-build-6b9d53e1ff00/output/x86_64-linux-gnu/bitcoin-6b9d53e1ff00-x86_64-linux-gnu-debug.tar.gz
c553c0dfdd85f9af8e41741557c9eb5a6ee48a9f4a025df84eed21330927be89 guix-build-6b9d53e1ff00/output/x86_64-linux-gnu/bitcoin-6b9d53e1ff00-x86_64-linux-gnu.tar.gz
3dc586f08f454cfba3e8f66588a1017490fc6014bcd2aee0b0c5f557267aa961 guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/SHA256SUMS.part
bc5ed4302603fe2f574e83a0e5612cff306081f65c74d817bb0f977bef01fb7a guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64-debug.zip
6c4ce699bdc9cd0fd5b3626b7c740b0d9f381f126a6581b38d481bddca74c25d guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64-setup-unsigned.exe
f5ca2fc6988e9a90ed7c47bd05c120a8d5a2c2a0bc0abcc076739d27869779b7 guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64-unsigned.tar.gz
761c97a37473f91dee8630a1409597ee400a8c8c99937f0a111e4572f084bdd9 guix-build-6b9d53e1ff00/output/x86_64-w64-mingw32/bitcoin-6b9d53e1ff00-win64.zip
```
Closes #24701.
ACKs for top commit:
hebasto:
ACK 6b9d53e1ff0099a8d9abb3c389df96fa75eac3f5
Tree-SHA512: 128981d6ee68a9824bf9f19f90502b26e9d0fc5d55bf70b44c49fc8bdd25d4c6adf6fe2a5f6e48b35eb6e1b6ba55db59528cd53e75ddc34fc74f5d0ab0a33cb1
-rw-r--r-- | contrib/guix/manifest.scm | 33 | ||||
-rw-r--r-- | contrib/guix/patches/glibc-2.24-fcommon.patch | 32 | ||||
-rw-r--r-- | contrib/guix/patches/glibc-2.27-dont-redefine-nss-database.patch | 87 | ||||
-rw-r--r-- | contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch (renamed from contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch) | 6 |
4 files changed, 140 insertions, 18 deletions
diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index b61c2b8899..34a9c608db 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -148,9 +148,9 @@ chain for " target " development.")) (define* (make-bitcoin-cross-toolchain target #:key - (base-gcc-for-libc gcc-7) + (base-gcc-for-libc base-gcc) (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) @@ -534,7 +537,8 @@ inspecting signatures in Mach-O binaries.") (patches (search-our-patches "glibc-ldd-x86_64.patch" "glibc-versioned-locpath.patch" "glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch" - "glibc-2.24-no-build-time-cxx-header-run.patch")))))) + "glibc-2.24-no-build-time-cxx-header-run.patch" + "glibc-2.24-fcommon.patch")))))) (define-public glibc-2.27/bitcoin-patched (package @@ -550,7 +554,8 @@ inspecting signatures in Mach-O binaries.") (base32 "1b2n1gxv9f4fd5yy68qjbnarhf8mf4vmlxk10i3328c1w5pmp0ca")) (patches (search-our-patches "glibc-ldd-x86_64.patch" - "glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch")))))) + "glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch" + "glibc-2.27-dont-redefine-nss-database.patch")))))) (packages->manifest (append @@ -581,6 +586,9 @@ inspecting signatures in Mach-O binaries.") automake pkg-config bison + ;; Native GCC 10 toolchain + gcc-toolchain-10 + (list gcc-toolchain-10 "static") ;; Scripting perl python-3 @@ -591,26 +599,17 @@ inspecting signatures in Mach-O binaries.") (let ((target (getenv "HOST"))) (cond ((string-suffix? "-mingw32" target) ;; Windows - (list ;; Native GCC 10 toolchain - gcc-toolchain-10 - (list gcc-toolchain-10 "static") - zip + (list zip (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32") (make-nsis-for-gcc-10 nsis-x86_64) osslsigncode)) ((string-contains target "-linux-") - (list ;; Native GCC 7 toolchain - gcc-toolchain-7 - (list gcc-toolchain-7 "static") - (cond ((string-contains target "riscv64-") + (list (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))))) ((string-contains target "darwin") - (list ;; Native GCC 10 toolchain - gcc-toolchain-10 - (list gcc-toolchain-10 "static") - clang-toolchain-10 binutils cmake xorriso python-signapple)) + (list clang-toolchain-10 binutils cmake xorriso python-signapple)) (else '()))))) diff --git a/contrib/guix/patches/glibc-2.24-fcommon.patch b/contrib/guix/patches/glibc-2.24-fcommon.patch new file mode 100644 index 0000000000..2bc32ede90 --- /dev/null +++ b/contrib/guix/patches/glibc-2.24-fcommon.patch @@ -0,0 +1,32 @@ +commit 264a4a0dbe1f4369db315080034b500bed66016c +Author: fanquake <fanquake@gmail.com> +Date: Fri May 6 11:03:04 2022 +0100 + + build: use -fcommon to retain legacy behaviour with GCC 10 + + GCC 10 started using -fno-common by default, which causes issues with + the powerpc builds using gibc 2.24. A patch was commited to glibc to fix + the issue, 18363b4f010da9ba459b13310b113ac0647c2fcc but is non-trvial + to backport, and was broken in at least one way, see the followup in + commit 7650321ce037302bfc2f026aa19e0213b8d02fe6. + + For now, retain the legacy GCC behaviour by passing -fcommon when + building glibc. + + https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html. + https://sourceware.org/git/?p=glibc.git;a=commit;h=18363b4f010da9ba459b13310b113ac0647c2fcc + https://sourceware.org/git/?p=glibc.git;a=commit;h=7650321ce037302bfc2f026aa19e0213b8d02fe6 + +diff --git a/Makeconfig b/Makeconfig +index ee379f5852..63c4a2f234 100644 +--- a/Makeconfig ++++ b/Makeconfig +@@ -824,7 +824,7 @@ ifeq "$(strip $(+cflags))" "" + +cflags := $(default_cflags) + endif # $(+cflags) == "" + +-+cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) +++cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) -fcommon + +gcc-nowarn := -w + + # Don't duplicate options if we inherited variables from the parent. diff --git a/contrib/guix/patches/glibc-2.27-dont-redefine-nss-database.patch b/contrib/guix/patches/glibc-2.27-dont-redefine-nss-database.patch new file mode 100644 index 0000000000..16a595d613 --- /dev/null +++ b/contrib/guix/patches/glibc-2.27-dont-redefine-nss-database.patch @@ -0,0 +1,87 @@ +commit 78a90c2f74a2012dd3eff302189e47ff6779a757 +Author: Andreas Schwab <schwab@linux-m68k.org> +Date: Fri Mar 2 23:07:14 2018 +0100 + + Fix multiple definitions of __nss_*_database (bug 22918) + + (cherry picked from commit eaf6753f8aac33a36deb98c1031d1bad7b593d2d) + +diff --git a/nscd/gai.c b/nscd/gai.c +index d081747797..576fd0045b 100644 +--- a/nscd/gai.c ++++ b/nscd/gai.c +@@ -45,3 +45,6 @@ + #ifdef HAVE_LIBIDN + # include <libidn/idn-stub.c> + #endif ++ ++/* Some variables normally defined in libc. */ ++service_user *__nss_hosts_database attribute_hidden; +diff --git a/nss/nsswitch.c b/nss/nsswitch.c +index d5e655974f..b0f0c11a3e 100644 +--- a/nss/nsswitch.c ++++ b/nss/nsswitch.c +@@ -62,7 +62,7 @@ static service_library *nss_new_service (name_database *database, + + /* Declare external database variables. */ + #define DEFINE_DATABASE(name) \ +- extern service_user *__nss_##name##_database attribute_hidden; \ ++ service_user *__nss_##name##_database attribute_hidden; \ + weak_extern (__nss_##name##_database) + #include "databases.def" + #undef DEFINE_DATABASE +diff --git a/nss/nsswitch.h b/nss/nsswitch.h +index eccb535ef5..63573b9ebc 100644 +--- a/nss/nsswitch.h ++++ b/nss/nsswitch.h +@@ -226,10 +226,10 @@ libc_hidden_proto (__nss_hostname_digits_dots) + #define MAX_NR_ADDRS 48 + + /* Prototypes for __nss_*_lookup2 functions. */ +-#define DEFINE_DATABASE(arg) \ +- service_user *__nss_##arg##_database attribute_hidden; \ +- int __nss_##arg##_lookup2 (service_user **, const char *, \ +- const char *, void **); \ ++#define DEFINE_DATABASE(arg) \ ++ extern service_user *__nss_##arg##_database attribute_hidden; \ ++ int __nss_##arg##_lookup2 (service_user **, const char *, \ ++ const char *, void **); \ + libc_hidden_proto (__nss_##arg##_lookup2) + #include "databases.def" + #undef DEFINE_DATABASE +diff --git a/posix/tst-rfc3484-2.c b/posix/tst-rfc3484-2.c +index f509534ca9..8c64ac59ff 100644 +--- a/posix/tst-rfc3484-2.c ++++ b/posix/tst-rfc3484-2.c +@@ -58,6 +58,7 @@ _res_hconf_init (void) + #undef USE_NSCD + #include "../sysdeps/posix/getaddrinfo.c" + ++service_user *__nss_hosts_database attribute_hidden; + + /* This is the beginning of the real test code. The above defines + (among other things) the function rfc3484_sort. */ +diff --git a/posix/tst-rfc3484-3.c b/posix/tst-rfc3484-3.c +index ae44087a10..1c61aaf844 100644 +--- a/posix/tst-rfc3484-3.c ++++ b/posix/tst-rfc3484-3.c +@@ -58,6 +58,7 @@ _res_hconf_init (void) + #undef USE_NSCD + #include "../sysdeps/posix/getaddrinfo.c" + ++service_user *__nss_hosts_database attribute_hidden; + + /* This is the beginning of the real test code. The above defines + (among other things) the function rfc3484_sort. */ +diff --git a/posix/tst-rfc3484.c b/posix/tst-rfc3484.c +index 7f191abbbc..8f45848e44 100644 +--- a/posix/tst-rfc3484.c ++++ b/posix/tst-rfc3484.c +@@ -58,6 +58,7 @@ _res_hconf_init (void) + #undef USE_NSCD + #include "../sysdeps/posix/getaddrinfo.c" + ++service_user *__nss_hosts_database attribute_hidden; + + /* This is the beginning of the real test code. The above defines + (among other things) the function rfc3484_sort. */ diff --git a/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch b/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch index d6217157ee..c0f8495c41 100644 --- a/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch +++ b/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch @@ -1,3 +1,7 @@ +Note that this has been modified from the original commit, to use __has_include +instead of __has_include__, as the later was causing build failures with GCC 10. +See also: http://lists.busybox.net/pipermail/buildroot/2020-July/590376.html. + https://sourceware.org/git/?p=glibc.git;a=commit;h=0b9c84906f653978fb8768c7ebd0ee14a47e662e From 562c52cc81a4e456a62e6455feb32732049e9070 Mon Sep 17 00:00:00 2001 @@ -59,7 +63,7 @@ index d612ef4c6c..0b2042620b 100644 #include <atomic.h> #include <sys/cachectl.h> -#include <asm/syscalls.h> -+#if __has_include__ (<asm/syscalls.h>) ++#if __has_include (<asm/syscalls.h>) +# include <asm/syscalls.h> +#else +# include <asm/unistd.h> |