Skip to content

Commit c49b040

Browse files
committed
Merge bitcoin/bitcoin#25558: guix: Make windows cross architecture reproducible
5bff18b guix: patch gcc 10 with pthreads to remap guix store paths (Andrew Chow) Pull request description: The only thing preventing windows from being cross architecture reproducible is a single guix store winpthreads path in the debug symbols. This can be removed by patching libgcc to use `-ffile-prefix-map` so that the debug symbol will be mapped to a fixed `/usr` instead of the guix store path which depends on the building architecture. x86_64 ``` 2e585c4a66e930b5e273e89b8aeddc9c3bd1c8375b19d988a6fff64f0d49edfd guix-build-5bff18bce5d9/output/dist-archive/bitcoin-5bff18bce5d9.tar.gz b9235dc1a8541e840231cfafd0d971bd5e8a3ea7d5331c4d7af9dbfdabc6905b guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/SHA256SUMS.part f82d861de60e22fc7dd731bef60a3e4399b5317eb16e41e92ded171490d1a578 guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64-debug.zip bfd59561c3cfce91b09d05b17cfc67cd70cb78eea39ea863119870260a8dbdec guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64-setup-unsigned.exe 3d049d98c6add13b0eb4c7adcf0d3ae59d1eab09799292a2c900de0ad067912a guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64-unsigned.tar.gz 7af4c34c47f349028ec1f4c2edea547bd9fa30d1c67977d482607a9c6bf2ddee guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64.zip ``` arm64 ``` 2e585c4a66e930b5e273e89b8aeddc9c3bd1c8375b19d988a6fff64f0d49edfd guix-build-5bff18bce5d9/output/dist-archive/bitcoin-5bff18bce5d9.tar.gz b9235dc1a8541e840231cfafd0d971bd5e8a3ea7d5331c4d7af9dbfdabc6905b guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/SHA256SUMS.part f82d861de60e22fc7dd731bef60a3e4399b5317eb16e41e92ded171490d1a578 guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64-debug.zip bfd59561c3cfce91b09d05b17cfc67cd70cb78eea39ea863119870260a8dbdec guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64-setup-unsigned.exe 3d049d98c6add13b0eb4c7adcf0d3ae59d1eab09799292a2c900de0ad067912a guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64-unsigned.tar.gz 7af4c34c47f349028ec1f4c2edea547bd9fa30d1c67977d482607a9c6bf2ddee guix-build-5bff18bce5d9/output/x86_64-w64-mingw32/bitcoin-5bff18bce5d9-win64.zip ``` ACKs for top commit: fanquake: ACK 5bff18b hebasto: ACK 5bff18b, I have reviewed the code and it looks OK. Confirming reproducibility for `x86_64` and `arm64` platforms. Tree-SHA512: 7cc34e6348e4cab847a7b8745179fceced0f37d639cf2ae81748dd73820809ea8f5e049b5b3ce2b912528491967e33fafd56e75aa47714e09b41859091433c5d
2 parents 8ef096d + 5bff18b commit c49b040

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

contrib/guix/manifest.scm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ desirable for building Bitcoin Core release binaries."
147147
base-gcc))
148148

149149
(define (make-gcc-with-pthreads gcc)
150-
(package-with-extra-configure-variable gcc "--enable-threads" "posix"))
150+
(package-with-extra-configure-variable
151+
(package-with-extra-patches gcc
152+
(search-our-patches "gcc-10-remap-guix-store.patch"))
153+
"--enable-threads" "posix"))
151154

152155
(define (make-mingw-w64-cross-gcc cross-gcc)
153156
(package-with-extra-patches cross-gcc
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From aad25427e74f387412e8bc9a9d7bbc6c496c792f Mon Sep 17 00:00:00 2001
2+
From: Andrew Chow <[email protected]>
3+
Date: Wed, 6 Jul 2022 16:49:41 -0400
4+
Subject: [PATCH] guix: remap guix store paths to /usr
5+
6+
---
7+
libgcc/Makefile.in | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
11+
index 851e7657d07..476c2becd1c 100644
12+
--- a/libgcc/Makefile.in
13+
+++ b/libgcc/Makefile.in
14+
@@ -854,7 +854,7 @@ endif
15+
# libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
16+
# LIB2ADDEHSHARED matter. (Usually all three are identical.)
17+
18+
-c_flags := -fexceptions
19+
+c_flags := -fexceptions $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
20+
21+
ifeq ($(enable_shared),yes)
22+
23+
--
24+
2.37.0
25+

0 commit comments

Comments
 (0)