Skip to content

Commit 56e79fe

Browse files
committed
guix: use --build={arch}-guix-linux-gnu in cross toolchain
Technically we are always cross-compiling, so make that explicit. Fixes: #22458.
1 parent 01e1627 commit 56e79fe

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

contrib/guix/manifest.scm

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
7878
(("-rpath=") "-rpath-link="))
7979
#t))))))))
8080

81+
(define building-on (string-append (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
82+
83+
(define (explicit-cross-configure package)
84+
(package-with-extra-configure-variable package "--build" building-on))
85+
8186
(define (make-cross-toolchain target
8287
base-gcc-for-libc
8388
base-kernel-headers
@@ -87,9 +92,9 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
8792
(let* ((xbinutils (cross-binutils target))
8893
;; 1. Build a cross-compiling gcc without targeting any libc, derived
8994
;; from BASE-GCC-FOR-LIBC
90-
(xgcc-sans-libc (cross-gcc target
91-
#:xgcc base-gcc-for-libc
92-
#:xbinutils xbinutils))
95+
(xgcc-sans-libc (explicit-cross-configure (cross-gcc target
96+
#:xgcc base-gcc-for-libc
97+
#:xbinutils xbinutils)))
9398
;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived
9499
;; from BASE-KERNEL-HEADERS
95100
(xkernel (cross-kernel-headers target
@@ -98,17 +103,17 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
98103
xbinutils))
99104
;; 3. Build a cross-compiled libc with XGCC-SANS-LIBC and XKERNEL,
100105
;; derived from BASE-LIBC
101-
(xlibc (cross-libc target
102-
base-libc
103-
xgcc-sans-libc
104-
xbinutils
105-
xkernel))
106+
(xlibc (explicit-cross-configure (cross-libc target
107+
base-libc
108+
xgcc-sans-libc
109+
xbinutils
110+
xkernel)))
106111
;; 4. Build a cross-compiling gcc targeting XLIBC, derived from
107112
;; BASE-GCC
108-
(xgcc (cross-gcc target
109-
#:xgcc base-gcc
110-
#:xbinutils xbinutils
111-
#:libc xlibc)))
113+
(xgcc (explicit-cross-configure (cross-gcc target
114+
#:xgcc base-gcc
115+
#:xbinutils xbinutils
116+
#:libc xlibc))))
112117
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
113118
;; XGCC
114119
(package

0 commit comments

Comments
 (0)