mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 13:02:38 +02:00
Merge bitcoin/bitcoin#28324: guix: pre time-machine bump changes (Linux)
806b75b213
guix: consolidate Linux GCC package (fanquake)4415275f96
guix: consolidate glibc 2.27 package (fanquake) Pull request description: This is some refactoring to the Linux 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 Linux GCC build into `linux-base-gcc`. Now that we only use `building-on`, remove `explicit-cross-configure`. Split out of https://github.com/bitcoin/bitcoin/pull/27897. Most of the [[WIP] Linux commit](8335fc4775
), minus anything GCC 12 related. I'll also be splitting out the other changes we can do pre-timemachine bump, for easier review. Similar/followup to #28294. Requirement for #28328. Guix Build: ```bash 17463110d4b4721a7c188e71b1fc00c9b5b82227aa8342471390c17678e04a9a guix-build-806b75b21340/output/aarch64-linux-gnu/SHA256SUMS.part 0ca919ce568e7d4ffe44dda871d48963ca2988516068e75b1f30ca342d853d20 guix-build-806b75b21340/output/aarch64-linux-gnu/bitcoin-806b75b21340-aarch64-linux-gnu-debug.tar.gz 134afa263e4da6c8d7df79a7dd8e59911c1e643b53b7c285de9418d97fb06d5f guix-build-806b75b21340/output/aarch64-linux-gnu/bitcoin-806b75b21340-aarch64-linux-gnu.tar.gz 22ce318241084829e57f064bf47de57752151863aac545e643eea5dd8eee96fe guix-build-806b75b21340/output/arm-linux-gnueabihf/SHA256SUMS.part a26fecfeb821040704ca70ea056bff796789ed9500d9575d8fa13a85b32143f6 guix-build-806b75b21340/output/arm-linux-gnueabihf/bitcoin-806b75b21340-arm-linux-gnueabihf-debug.tar.gz 213c84494835c81a40ebc5d38a62bb19cbee5b214b2a8aaed6d28746b245108e guix-build-806b75b21340/output/arm-linux-gnueabihf/bitcoin-806b75b21340-arm-linux-gnueabihf.tar.gz ce1efcf6d3ca0e7422c5ce35f5e45e0770a3ae48173e061137daa7dc551e9d48 guix-build-806b75b21340/output/arm64-apple-darwin/SHA256SUMS.part fc01aaeb4e4722d21fd60c78f1b5322c9875ec6fb4d244f4547a354e91a33ed7 guix-build-806b75b21340/output/arm64-apple-darwin/bitcoin-806b75b21340-arm64-apple-darwin-unsigned.dmg 632e4a243d3e4144313f53047499f91b7c9380a1a50f5846e1635d0a00fd202a guix-build-806b75b21340/output/arm64-apple-darwin/bitcoin-806b75b21340-arm64-apple-darwin-unsigned.tar.gz 8e694e4cd1bf45e6a586a0d8c19b675014f168f342f881a9ae0c4fbbda796914 guix-build-806b75b21340/output/arm64-apple-darwin/bitcoin-806b75b21340-arm64-apple-darwin.tar.gz dad6e8475f13dac6c4f0b182f53dc330997e9e1e5cf4d46413655f319dcd9bff guix-build-806b75b21340/output/dist-archive/bitcoin-806b75b21340.tar.gz 32e8b6c7e7a7561e132c5f15e2151a51aad1c5004ab90a36a7e80f92c200ef6f guix-build-806b75b21340/output/powerpc64-linux-gnu/SHA256SUMS.part 9033e85e03bd12a3a19599735cfd44fcfdfb1bf1b632733341cec6a4f75ff86f guix-build-806b75b21340/output/powerpc64-linux-gnu/bitcoin-806b75b21340-powerpc64-linux-gnu-debug.tar.gz 72698691b27ec0ac17f21dce8551de0ca683dd00b5b9442ea7616fb56cca8c6b guix-build-806b75b21340/output/powerpc64-linux-gnu/bitcoin-806b75b21340-powerpc64-linux-gnu.tar.gz ef7c6d7184249eb59fa67d6df91d1a567570b9fb026dbb8682763029decaacca guix-build-806b75b21340/output/powerpc64le-linux-gnu/SHA256SUMS.part fc6bb5619ee76899a88c1dd62640b429ad8957bbdf821238038b41fc87d18eca guix-build-806b75b21340/output/powerpc64le-linux-gnu/bitcoin-806b75b21340-powerpc64le-linux-gnu-debug.tar.gz 0eceb969f41f6b8dba88f641e268590de7edf0008318c8051d9cb208fb15e7f7 guix-build-806b75b21340/output/powerpc64le-linux-gnu/bitcoin-806b75b21340-powerpc64le-linux-gnu.tar.gz 6f51a4791d87a610abd81cee83efa7f469e905829797bc2edac4fb95a2e0f3e4 guix-build-806b75b21340/output/riscv64-linux-gnu/SHA256SUMS.part c978706988f31e65a7991ff7582d79b3d1df44249c14d9807d93c01bf3f5080d guix-build-806b75b21340/output/riscv64-linux-gnu/bitcoin-806b75b21340-riscv64-linux-gnu-debug.tar.gz 93aefe058025067550692adae59ead14228ac252a9e7cf8b55c8fb4189ece545 guix-build-806b75b21340/output/riscv64-linux-gnu/bitcoin-806b75b21340-riscv64-linux-gnu.tar.gz 862a53f6023bd1ca98a078ea540bba8ca9bfa335a9560f3d8d62ac873c2d5848 guix-build-806b75b21340/output/x86_64-apple-darwin/SHA256SUMS.part 8f632b42c94d061fa30364087e75bb8b04eb2ac5a0a988eacc37c5983669f01b guix-build-806b75b21340/output/x86_64-apple-darwin/bitcoin-806b75b21340-x86_64-apple-darwin-unsigned.dmg ce62e76ca446a6316b31490e12463c0a641e15beef9bdae7acc8e5db057b433a guix-build-806b75b21340/output/x86_64-apple-darwin/bitcoin-806b75b21340-x86_64-apple-darwin-unsigned.tar.gz f57b014818e3b1ec07d27c8224ec4ac0e5786dacd00639513b599c6138790ece guix-build-806b75b21340/output/x86_64-apple-darwin/bitcoin-806b75b21340-x86_64-apple-darwin.tar.gz 70e75f6f13795f968f91719d221673b687bf747f90d77912cbcb2c1ee45ec623 guix-build-806b75b21340/output/x86_64-linux-gnu/SHA256SUMS.part 30dec525364bb21a26cfe8bfff061d013c4ce849165aa67b06eb154019444862 guix-build-806b75b21340/output/x86_64-linux-gnu/bitcoin-806b75b21340-x86_64-linux-gnu-debug.tar.gz d8b3a996f25fb948b3555d5750852aaf82f7051848586b9ba0f4d0d223226e4b guix-build-806b75b21340/output/x86_64-linux-gnu/bitcoin-806b75b21340-x86_64-linux-gnu.tar.gz 4259adec77912bab6494f71a2a95d98093b116c05fc9ad03069e92de4ce0248c guix-build-806b75b21340/output/x86_64-w64-mingw32/SHA256SUMS.part 0a2d5cab3fe94a86def0cc1b6efe9ac871839cbcdc05ad92686df1d2bdd154ea guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64-debug.zip d2a1876333bdb1cd5b8b1d4a52bccd756ea2e992c291dac233e65beeb0c905fd guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64-setup-unsigned.exe 192ea38d70e12c23327ff811ea930b50ac31c9fb2bc8dcc9391ad585112322ff guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64-unsigned.tar.gz 474f88a1f4cc8900a7d8967909336d4122e449ce98cacaf2cacec340780ede0b guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64.zip ``` ACKs for top commit: TheCharlatan: Nice cleanups, ACK806b75b213
Tree-SHA512: cede797c3b9b88cc1588d0ff7ff9b2908316a8ba384d9087b16466aceeb2e0c194aa56e3023f6b6ce7ca8896a1b87ef56b966db198cc1712cb6ddc37fe684567
This commit is contained in:
commit
f3cc29fc5f
@ -40,29 +40,8 @@ FILE-NAME found in ./patches relative to the current file."
|
||||
((%patch-path (list (string-append (dirname (current-filename)) "/patches"))))
|
||||
(list (search-patch file-name) ...)))
|
||||
|
||||
(define (make-gcc-rpath-link xgcc)
|
||||
"Given a XGCC package, return a modified package that replace each instance of
|
||||
-rpath in the default system spec that's inserted by Guix with -rpath-link"
|
||||
(package
|
||||
(inherit xgcc)
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments xgcc)
|
||||
((#:phases phases)
|
||||
`(modify-phases ,phases
|
||||
(add-after 'pre-configure 'replace-rpath-with-rpath-link
|
||||
(lambda _
|
||||
(substitute* (cons "gcc/config/rs6000/sysv4.h"
|
||||
(find-files "gcc/config"
|
||||
"^gnu-user.*\\.h$"))
|
||||
(("-rpath=") "-rpath-link="))
|
||||
#t))))))))
|
||||
|
||||
(define building-on (string-append "--build=" (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
|
||||
|
||||
(define (explicit-cross-configure package)
|
||||
(define building-on (string-append (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
|
||||
(package-with-extra-configure-variable package "--build" building-on))
|
||||
|
||||
(define (make-cross-toolchain target
|
||||
base-gcc-for-libc
|
||||
base-kernel-headers
|
||||
@ -72,9 +51,9 @@ FILE-NAME found in ./patches relative to the current file."
|
||||
(let* ((xbinutils (cross-binutils target))
|
||||
;; 1. Build a cross-compiling gcc without targeting any libc, derived
|
||||
;; from BASE-GCC-FOR-LIBC
|
||||
(xgcc-sans-libc (explicit-cross-configure (cross-gcc target
|
||||
#:xgcc base-gcc-for-libc
|
||||
#:xbinutils xbinutils)))
|
||||
(xgcc-sans-libc (cross-gcc target
|
||||
#:xgcc base-gcc-for-libc
|
||||
#:xbinutils xbinutils))
|
||||
;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived
|
||||
;; from BASE-KERNEL-HEADERS
|
||||
(xkernel (cross-kernel-headers target
|
||||
@ -83,17 +62,17 @@ FILE-NAME found in ./patches relative to the current file."
|
||||
xbinutils))
|
||||
;; 3. Build a cross-compiled libc with XGCC-SANS-LIBC and XKERNEL,
|
||||
;; derived from BASE-LIBC
|
||||
(xlibc (explicit-cross-configure (cross-libc target
|
||||
base-libc
|
||||
xgcc-sans-libc
|
||||
xbinutils
|
||||
xkernel)))
|
||||
(xlibc (cross-libc target
|
||||
base-libc
|
||||
xgcc-sans-libc
|
||||
xbinutils
|
||||
xkernel))
|
||||
;; 4. Build a cross-compiling gcc targeting XLIBC, derived from
|
||||
;; BASE-GCC
|
||||
(xgcc (explicit-cross-configure (cross-gcc target
|
||||
#:xgcc base-gcc
|
||||
#:xbinutils xbinutils
|
||||
#:libc xlibc))))
|
||||
(xgcc (cross-gcc target
|
||||
#:xgcc base-gcc
|
||||
#:xbinutils xbinutils
|
||||
#:libc xlibc)))
|
||||
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
|
||||
;; XGCC
|
||||
(package
|
||||
@ -117,21 +96,12 @@ chain for " target " development."))
|
||||
(define base-gcc gcc-10)
|
||||
(define base-linux-kernel-headers linux-libre-headers-5.15)
|
||||
|
||||
;; https://gcc.gnu.org/install/configure.html
|
||||
(define (hardened-gcc gcc)
|
||||
(package-with-extra-configure-variable (
|
||||
package-with-extra-configure-variable (
|
||||
package-with-extra-configure-variable gcc
|
||||
"--enable-initfini-array" "yes")
|
||||
"--enable-default-ssp" "yes")
|
||||
"--enable-default-pie" "yes"))
|
||||
|
||||
(define* (make-bitcoin-cross-toolchain target
|
||||
#:key
|
||||
(base-gcc-for-libc base-gcc)
|
||||
(base-gcc-for-libc linux-base-gcc)
|
||||
(base-kernel-headers base-linux-kernel-headers)
|
||||
(base-libc (hardened-glibc glibc-2.27))
|
||||
(base-gcc (make-gcc-rpath-link (hardened-gcc base-gcc))))
|
||||
(base-libc glibc-2.27)
|
||||
(base-gcc linux-base-gcc))
|
||||
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
|
||||
desirable for building Bitcoin Core release binaries."
|
||||
(make-cross-toolchain target
|
||||
@ -513,17 +483,6 @@ and endian independent.")
|
||||
inspecting signatures in Mach-O binaries.")
|
||||
(license license:expat))))
|
||||
|
||||
;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
|
||||
;; We don't use --disable-werror directly, as that would be passed through to bash,
|
||||
;; and cause it's build to fail.
|
||||
(define (hardened-glibc glibc)
|
||||
(package-with-extra-configure-variable (
|
||||
package-with-extra-configure-variable (
|
||||
package-with-extra-configure-variable glibc
|
||||
"enable_werror" "no")
|
||||
"--enable-stack-protector" "all")
|
||||
"--enable-bind-now" "yes"))
|
||||
|
||||
(define-public mingw-w64-base-gcc
|
||||
(package
|
||||
(inherit base-gcc)
|
||||
@ -540,6 +499,30 @@ inspecting signatures in Mach-O binaries.")
|
||||
;; and thus will ensure that this works properly.
|
||||
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
|
||||
|
||||
(define-public linux-base-gcc
|
||||
(package
|
||||
(inherit base-gcc)
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments base-gcc)
|
||||
((#:configure-flags flags)
|
||||
`(append ,flags
|
||||
;; https://gcc.gnu.org/install/configure.html
|
||||
(list "--enable-initfini-array=yes",
|
||||
"--enable-default-ssp=yes",
|
||||
"--enable-default-pie=yes",
|
||||
building-on)))
|
||||
((#:phases phases)
|
||||
`(modify-phases ,phases
|
||||
;; Given a XGCC package, return a modified package that replace each instance of
|
||||
;; -rpath in the default system spec that's inserted by Guix with -rpath-link
|
||||
(add-after 'pre-configure 'replace-rpath-with-rpath-link
|
||||
(lambda _
|
||||
(substitute* (cons "gcc/config/rs6000/sysv4.h"
|
||||
(find-files "gcc/config"
|
||||
"^gnu-user.*\\.h$"))
|
||||
(("-rpath=") "-rpath-link="))
|
||||
#t))))))))
|
||||
|
||||
(define-public glibc-2.27
|
||||
(package
|
||||
(inherit glibc-2.31)
|
||||
@ -556,7 +539,28 @@ inspecting signatures in Mach-O binaries.")
|
||||
(patches (search-our-patches "glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"
|
||||
"glibc-2.27-fcommon.patch"
|
||||
"glibc-2.27-guix-prefix.patch"
|
||||
"glibc-2.27-no-librt.patch"))))))
|
||||
"glibc-2.27-no-librt.patch"))))
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments glibc)
|
||||
((#:configure-flags flags)
|
||||
`(append ,flags
|
||||
;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
|
||||
(list "--enable-stack-protector=all",
|
||||
"--enable-bind-now",
|
||||
"--disable-werror",
|
||||
building-on)))
|
||||
((#:phases phases)
|
||||
`(modify-phases ,phases
|
||||
(add-before 'configure 'set-etc-rpc-installation-directory
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
;; Install the rpc data base file under `$out/etc/rpc'.
|
||||
;; Otherwise build will fail with "Permission denied."
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(substitute* "sunrpc/Makefile"
|
||||
(("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
|
||||
(string-append out "/etc/rpc" suffix "\n"))
|
||||
(("^install-others =.*$")
|
||||
(string-append "install-others = " out "/etc/rpc\n"))))))))))))
|
||||
|
||||
(packages->manifest
|
||||
(append
|
||||
|
Loading…
Reference in New Issue
Block a user