Skip to content

Commit cbeb2c2

Browse files
committed
guix: patch /gnu/store paths out of winpthreads
At the same time, align the docs for all patches that do the same thing.
1 parent 1e8d689 commit cbeb2c2

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

contrib/guix/manifest.scm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,17 @@ desirable for building Bitcoin Core release binaries."
128128
(package-with-extra-patches binutils
129129
(search-our-patches "binutils-unaligned-default.patch")))
130130

131+
(define (winpthreads-patches mingw-w64-x86_64-winpthreads)
132+
(package-with-extra-patches mingw-w64-x86_64-winpthreads
133+
(search-our-patches "winpthreads-remap-guix-store.patch")))
134+
131135
(define (make-mingw-pthreads-cross-toolchain target)
132136
"Create a cross-compilation toolchain package for TARGET"
133137
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
134138
(machine (substring target 0 (string-index target #\-)))
135-
(pthreads-xlibc (make-mingw-w64 machine
139+
(pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine
136140
#:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc))
137-
#:with-winpthreads? #t))
141+
#:with-winpthreads? #t)))
138142
(pthreads-xgcc (cross-gcc target
139143
#:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
140144
#:xbinutils xbinutils

contrib/guix/patches/gcc-remap-guix-store.patch

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
From aad25427e74f387412e8bc9a9d7bbc6c496c792f Mon Sep 17 00:00:00 2001
2-
From: Andrew Chow <achow101-github@achow101.com>
3-
Date: Wed, 6 Jul 2022 16:49:41 -0400
4-
Subject: [PATCH] guix: remap guix store paths to /usr
1+
Without ffile-prefix-map, the debug symbols will contain paths for the
2+
guix store which will include the hashes of each package. However, the
3+
hash for the same package will differ when on different architectures.
4+
In order to be reproducible regardless of the architecture used to build
5+
the package, map all guix store prefixes to something fixed, e.g. /usr.
56

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
127
--- a/libgcc/Makefile.in
138
+++ b/libgcc/Makefile.in
149
@@ -854,7 +854,7 @@ endif
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Without ffile-prefix-map, the debug symbols will contain paths for the
2+
guix store which will include the hashes of each package. However, the
3+
hash for the same package will differ when on different architectures.
4+
In order to be reproducible regardless of the architecture used to build
5+
the package, map all guix store prefixes to something fixed, e.g. /usr.
6+
7+
--- a/mingw-w64-libraries/winpthreads/Makefile.in
8+
+++ b/mingw-w64-libraries/winpthreads/Makefile.in
9+
@@ -478,7 +478,7 @@ top_build_prefix = @top_build_prefix@
10+
top_builddir = @top_builddir@
11+
top_srcdir = @top_srcdir@
12+
SUBDIRS = . tests
13+
-AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1)
14+
+AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
15+
ACLOCAL_AMFLAGS = -I m4
16+
lib_LTLIBRARIES = libwinpthread.la
17+
include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h

0 commit comments

Comments
 (0)