aboutsummaryrefslogtreecommitdiff
path: root/contrib/guix/manifest.scm
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-07-24 14:38:26 +0100
committerfanquake <fanquake@gmail.com>2023-08-18 12:02:26 +0100
commit51324c9517a21471916ab722c33f9925c6071c55 (patch)
treea44d8f72f0b2dccd0c1a0072fac9a190e25c0b76 /contrib/guix/manifest.scm
parent7bf078f2b7d4a0339d053144b4fb35fe020dac25 (diff)
downloadbitcoin-51324c9517a21471916ab722c33f9925c6071c55.tar.xz
guix: pre time-machine bump changes (Windows)
Split out of #27897. 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).
Diffstat (limited to 'contrib/guix/manifest.scm')
-rw-r--r--contrib/guix/manifest.scm53
1 files changed, 25 insertions, 28 deletions
diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
index 31ac44f8e2..c7f471cc60 100644
--- a/contrib/guix/manifest.scm
+++ b/contrib/guix/manifest.scm
@@ -40,20 +40,6 @@ 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-ssp-fixed-gcc xgcc)
- "Given a XGCC package, return a modified package that uses the SSP function
-from glibc instead of from libssp.so. Our `symbol-check' script will complain if
-we link against libssp.so, and thus will ensure that this works properly.
-
-Taken from:
-http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
- (package
- (inherit xgcc)
- (arguments
- (substitute-keyword-arguments (package-arguments xgcc)
- ((#:make-flags flags)
- `(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
-
(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"
@@ -71,9 +57,10 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
(("-rpath=") "-rpath-link="))
#t))))))))
-(define building-on (string-append (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
+(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
@@ -153,26 +140,20 @@ desirable for building Bitcoin Core release binaries."
base-libc
base-gcc))
-(define (make-gcc-with-pthreads gcc)
- (package-with-extra-configure-variable
- (package-with-extra-patches gcc
- (search-our-patches "gcc-10-remap-guix-store.patch"))
- "--enable-threads" "posix"))
-
-(define (make-mingw-w64-cross-gcc cross-gcc)
- (package-with-extra-patches cross-gcc
- (search-our-patches "vmov-alignment.patch"
+(define (gcc-mingw-patches gcc)
+ (package-with-extra-patches gcc
+ (search-our-patches "gcc-remap-guix-store.patch"
+ "vmov-alignment.patch"
"gcc-broken-longjmp.patch")))
(define (make-mingw-pthreads-cross-toolchain target)
"Create a cross-compilation toolchain package for TARGET"
(let* ((xbinutils (cross-binutils target))
(pthreads-xlibc mingw-w64-x86_64-winpthreads)
- (pthreads-xgcc (make-gcc-with-pthreads
- (cross-gcc target
- #:xgcc (make-ssp-fixed-gcc (make-mingw-w64-cross-gcc base-gcc))
+ (pthreads-xgcc (cross-gcc target
+ #:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
#:xbinutils xbinutils
- #:libc pthreads-xlibc))))
+ #:libc pthreads-xlibc)))
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
;; XGCC
(package
@@ -543,6 +524,22 @@ inspecting signatures in Mach-O binaries.")
"--enable-stack-protector" "all")
"--enable-bind-now" "yes"))
+(define-public mingw-w64-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-threads=posix",
+ building-on)))
+ ((#:make-flags flags)
+ ;; Uses the SSP functions from glibc instead of from libssp.so.
+ ;; Our 'symbol-check' script will complain if we link against libssp.so,
+ ;; and thus will ensure that this works properly.
+ `(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
+
(define-public glibc-2.27
(package
(inherit glibc-2.31)