Skip to content

Commit 51324c9

Browse files
committed
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).
1 parent 7bf078f commit 51324c9

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)