Skip to content

Commit 8372ab0

Browse files
committed
Merge bitcoin/bitcoin#28294: guix: pre time-machine bump changes (Windows)
51324c9 guix: pre time-machine bump changes (Windows) (fanquake) Pull request description: This is some refactoring to the Windows Guix build that facilitates bumping our Guix time-machine. Namely, avoiding `package-with-extra-configure-variable`, which is non-functional in the newer time-machine, see https://issues.guix.gnu.org/64436. At the same time, consolidate our Windows GCC build into `mingw-w64-base-gcc`. Rename `gcc-10-remap-guix-store.patch` to avoid changing it whenever GCC changes. We move the old `building-on` inside `explicit-cross-configure`, so that non-windows builds continue to work. Note that `explicit-cross-configure` will be going away entirely (see #27897), so this is only temporary duplication. Split out of #27897. Most of the [[WIP] Windows commit](bitcoin/bitcoin@e50d5f8), minus the gcov change, as it's not-yet needed, and any gexp changes, which need the newer time-machine. I'll also be splitting out the other changes we can do pre-timemachine bump, for easier review. Guix Build: ```bash 9cff4df245df0b8e92d102bda786eb13a1f10be58940b98a16e119d9d4859d7f guix-build-51324c9517a2/output/aarch64-linux-gnu/SHA256SUMS.part dbe6a5fe2e6152cd114b1d549a383384cd3325ed4625ad93f8d824ba457ae9cd guix-build-51324c9517a2/output/aarch64-linux-gnu/bitcoin-51324c9517a2-aarch64-linux-gnu-debug.tar.gz e36409cd7287e4da62806168ee21ef764e607a11685bb36b7642381060291789 guix-build-51324c9517a2/output/aarch64-linux-gnu/bitcoin-51324c9517a2-aarch64-linux-gnu.tar.gz 0721a4b61ad991ec97d09281eda223ed7bad32cb2b4812e05bc5e64772756be7 guix-build-51324c9517a2/output/arm-linux-gnueabihf/SHA256SUMS.part f2aa9412ff77bfc3092404533ec669a610c3fa95711b514abd6cd8ae6918aca1 guix-build-51324c9517a2/output/arm-linux-gnueabihf/bitcoin-51324c9517a2-arm-linux-gnueabihf-debug.tar.gz cda70b7df940dcc1fdeb25e2d3cc6ecce45732fdd741881e2b0384e35897b6d5 guix-build-51324c9517a2/output/arm-linux-gnueabihf/bitcoin-51324c9517a2-arm-linux-gnueabihf.tar.gz 15b5d30336bcaf75db4138c59716af93b9660511222c5f1ad814fc9d7c48c852 guix-build-51324c9517a2/output/arm64-apple-darwin/SHA256SUMS.part a29b327e4d869629af3625d6b7fe44e029e98ac4fedb265133e0d88e045ef933 guix-build-51324c9517a2/output/arm64-apple-darwin/bitcoin-51324c9517a2-arm64-apple-darwin-unsigned.dmg b1af35290051da64462987e32f215464c5e2376afbe5b5bff272f74f160a3461 guix-build-51324c9517a2/output/arm64-apple-darwin/bitcoin-51324c9517a2-arm64-apple-darwin-unsigned.tar.gz 6c3815392377a8497cab15f534cfdb749dbe31e39ca2ae7e53a55b37acfe069d guix-build-51324c9517a2/output/arm64-apple-darwin/bitcoin-51324c9517a2-arm64-apple-darwin.tar.gz efff276305c36ccf2e6eeca56928e6284965d0d08b05565b0bfc94a3dc30cec4 guix-build-51324c9517a2/output/dist-archive/bitcoin-51324c9517a2.tar.gz 0d70106907ac873bd31603b58183ef2cd3b0820ce20b27e3a8d00044b876835c guix-build-51324c9517a2/output/powerpc64-linux-gnu/SHA256SUMS.part 9a6cbc010d08c26c5bc587ed9c42383a6d004ac20426508e67364848aa099154 guix-build-51324c9517a2/output/powerpc64-linux-gnu/bitcoin-51324c9517a2-powerpc64-linux-gnu-debug.tar.gz e39ca22d186bad00119a740279b046a0040628847bea76db0b5d5345efa2312d guix-build-51324c9517a2/output/powerpc64-linux-gnu/bitcoin-51324c9517a2-powerpc64-linux-gnu.tar.gz 945ab751f65d5333b259fd169b280a5fabd35cae89a8f777bc6019f2ac011073 guix-build-51324c9517a2/output/powerpc64le-linux-gnu/SHA256SUMS.part 1c33b4385d5759e4a38cd42e6af99c1224788d03e15b8abd3df48caef3ebcb0a guix-build-51324c9517a2/output/powerpc64le-linux-gnu/bitcoin-51324c9517a2-powerpc64le-linux-gnu-debug.tar.gz 3b4d0f6d874d600095b90eb19ad568ab08c105762c4ba285c6b1a4dc8d9fc2db guix-build-51324c9517a2/output/powerpc64le-linux-gnu/bitcoin-51324c9517a2-powerpc64le-linux-gnu.tar.gz 6d4f508256747841f9b099370cc7da2a97687f7b182683fce0369b524388e952 guix-build-51324c9517a2/output/riscv64-linux-gnu/SHA256SUMS.part 34a474abaf833664448f3643d572eef284037535685af3f3928d9f859e7353e6 guix-build-51324c9517a2/output/riscv64-linux-gnu/bitcoin-51324c9517a2-riscv64-linux-gnu-debug.tar.gz b91a2209d360fe97d3d04cee4ff52271d45c2e47044e4f196dde4585cf61a273 guix-build-51324c9517a2/output/riscv64-linux-gnu/bitcoin-51324c9517a2-riscv64-linux-gnu.tar.gz 88a40ee878a6340a4c5dd4bb82effaff814328e6b6f1345c5824170ba7498279 guix-build-51324c9517a2/output/x86_64-apple-darwin/SHA256SUMS.part 0714092f76e32a1e8484651aed349ccdb5acc38f54dc2ac3ae3031111b5050eb guix-build-51324c9517a2/output/x86_64-apple-darwin/bitcoin-51324c9517a2-x86_64-apple-darwin-unsigned.dmg ab66d04ea3e9304155e66b0e2899b8325fd609c3fed27c74fe1b53f1b9efea15 guix-build-51324c9517a2/output/x86_64-apple-darwin/bitcoin-51324c9517a2-x86_64-apple-darwin-unsigned.tar.gz 222b688ef72b657c0701c8b4660240833e7c516fbbdcc4df8e9a006f5aa9b3bb guix-build-51324c9517a2/output/x86_64-apple-darwin/bitcoin-51324c9517a2-x86_64-apple-darwin.tar.gz 340e73e1697ae5cc1984771ce6e5caf22361ba4d063cbc4073236b210f1754dc guix-build-51324c9517a2/output/x86_64-linux-gnu/SHA256SUMS.part a967753c192b8cb28cc644ce9d239da88ef8faaebc2094e21b7580616a0b8415 guix-build-51324c9517a2/output/x86_64-linux-gnu/bitcoin-51324c9517a2-x86_64-linux-gnu-debug.tar.gz 7d77b14a2c94091a2d68dd9cdb0d878348da323c67eeeb5600273814db1b0e10 guix-build-51324c9517a2/output/x86_64-linux-gnu/bitcoin-51324c9517a2-x86_64-linux-gnu.tar.gz fbfb10b13b7bc5a1ed33578dcdd9483360cad47fd744ac99a9aecdf2a8ac14c2 guix-build-51324c9517a2/output/x86_64-w64-mingw32/SHA256SUMS.part 925bf5f88e907ddc4567acecfc634ef3570b0576499c6427225a52e1f6209d1e guix-build-51324c9517a2/output/x86_64-w64-mingw32/bitcoin-51324c9517a2-win64-debug.zip b3d19a25df2dbd913814e74471da585e629187a19a6afede5890a7df2dd0101f guix-build-51324c9517a2/output/x86_64-w64-mingw32/bitcoin-51324c9517a2-win64-setup-unsigned.exe 96b03fa66e294e95c0cee5d4c9869ac377e739d2da2e87c0c9d35eddd25e6ceb guix-build-51324c9517a2/output/x86_64-w64-mingw32/bitcoin-51324c9517a2-win64-unsigned.tar.gz 95d7f52622c534e40dceb89f150b3f2e0061c56768bcf7399aac3f24b937983b guix-build-51324c9517a2/output/x86_64-w64-mingw32/bitcoin-51324c9517a2-win64.zip ``` ACKs for top commit: TheCharlatan: ACK 51324c9 Tree-SHA512: 4d26ea2b587e4ea2bf76861925437b178376cda7373012f4a6d48ccb3606c20b035b94cba6248ac8d9e0c9e974e9eace818043d312c67d5c5e5771300a839c44
2 parents 03a536f + 51324c9 commit 8372ab0

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

contrib/guix/manifest.scm

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,6 @@ FILE-NAME found in ./patches relative to the current file."
4040
((%patch-path (list (string-append (dirname (current-filename)) "/patches"))))
4141
(list (search-patch file-name) ...)))
4242

43-
(define (make-ssp-fixed-gcc xgcc)
44-
"Given a XGCC package, return a modified package that uses the SSP function
45-
from glibc instead of from libssp.so. Our `symbol-check' script will complain if
46-
we link against libssp.so, and thus will ensure that this works properly.
47-
48-
Taken from:
49-
http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
50-
(package
51-
(inherit xgcc)
52-
(arguments
53-
(substitute-keyword-arguments (package-arguments xgcc)
54-
((#:make-flags flags)
55-
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
56-
5743
(define (make-gcc-rpath-link xgcc)
5844
"Given a XGCC package, return a modified package that replace each instance of
5945
-rpath in the default system spec that's inserted by Guix with -rpath-link"
@@ -71,9 +57,10 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
7157
(("-rpath=") "-rpath-link="))
7258
#t))))))))
7359

74-
(define building-on (string-append (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
60+
(define building-on (string-append "--build=" (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
7561

7662
(define (explicit-cross-configure package)
63+
(define building-on (string-append (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
7764
(package-with-extra-configure-variable package "--build" building-on))
7865

7966
(define (make-cross-toolchain target
@@ -153,26 +140,20 @@ desirable for building Bitcoin Core release binaries."
153140
base-libc
154141
base-gcc))
155142

156-
(define (make-gcc-with-pthreads gcc)
157-
(package-with-extra-configure-variable
158-
(package-with-extra-patches gcc
159-
(search-our-patches "gcc-10-remap-guix-store.patch"))
160-
"--enable-threads" "posix"))
161-
162-
(define (make-mingw-w64-cross-gcc cross-gcc)
163-
(package-with-extra-patches cross-gcc
164-
(search-our-patches "vmov-alignment.patch"
143+
(define (gcc-mingw-patches gcc)
144+
(package-with-extra-patches gcc
145+
(search-our-patches "gcc-remap-guix-store.patch"
146+
"vmov-alignment.patch"
165147
"gcc-broken-longjmp.patch")))
166148

167149
(define (make-mingw-pthreads-cross-toolchain target)
168150
"Create a cross-compilation toolchain package for TARGET"
169151
(let* ((xbinutils (cross-binutils target))
170152
(pthreads-xlibc mingw-w64-x86_64-winpthreads)
171-
(pthreads-xgcc (make-gcc-with-pthreads
172-
(cross-gcc target
173-
#:xgcc (make-ssp-fixed-gcc (make-mingw-w64-cross-gcc base-gcc))
153+
(pthreads-xgcc (cross-gcc target
154+
#:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
174155
#:xbinutils xbinutils
175-
#:libc pthreads-xlibc))))
156+
#:libc pthreads-xlibc)))
176157
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
177158
;; XGCC
178159
(package
@@ -543,6 +524,22 @@ inspecting signatures in Mach-O binaries.")
543524
"--enable-stack-protector" "all")
544525
"--enable-bind-now" "yes"))
545526

527+
(define-public mingw-w64-base-gcc
528+
(package
529+
(inherit base-gcc)
530+
(arguments
531+
(substitute-keyword-arguments (package-arguments base-gcc)
532+
((#:configure-flags flags)
533+
`(append ,flags
534+
;; https://gcc.gnu.org/install/configure.html
535+
(list "--enable-threads=posix",
536+
building-on)))
537+
((#:make-flags flags)
538+
;; Uses the SSP functions from glibc instead of from libssp.so.
539+
;; Our 'symbol-check' script will complain if we link against libssp.so,
540+
;; and thus will ensure that this works properly.
541+
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
542+
546543
(define-public glibc-2.27
547544
(package
548545
(inherit glibc-2.31)

0 commit comments

Comments
 (0)