1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-16 20:10:39 +02:00

gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Update comment on where
to find shared linker name.
(make-raw-bag): Also use raw-build-guile3 when building for the 64bit Hurd.
* gnu/packages/cross-base.scm (cross-kernel-headers*): Use target-hurd?
instead of custom "i586..."  matching to also use xhurd-core-headers for
target-hurd64.
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc)
[native-inputs]: Move final-inputs before cross-packages.
(%binutils-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes", "lt_cv_prog_compiler_static_works_CXX=yes"
to #:make-flags to convince to actually link the binaries statically.
(make-guile-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes" to #:configure-flags to convince
libtool to actually link guile statically.
* guix/platforms/x86.scm (x86_64-gnu): New exported variable.
* guix/utils.scm (target-hurd64? system-hurd64?): New procedures.
This commit is contained in:
Janneke Nieuwenhuizen 2024-11-02 18:27:51 +01:00
parent ae2213ed98
commit 94dfb68d43
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
5 changed files with 46 additions and 13 deletions

View file

@ -558,7 +558,8 @@ $out/bin/guile --version~%"
(name name) (name name)
(system system) (system system)
(build-inputs inputs) (build-inputs inputs)
(build (cond ((target-riscv64?) (build (cond ((or (target-riscv64?)
(target-hurd64?))
raw-build-guile3) raw-build-guile3)
(else raw-build))))) (else raw-build)))))

View file

@ -641,9 +641,9 @@ the base compiler. Use XBINUTILS as the associated cross-Binutils."
("hurd-headers" ,xhurd-headers) ("hurd-headers" ,xhurd-headers)
("hurd-minimal" ,xhurd-minimal))))) ("hurd-minimal" ,xhurd-minimal)))))
(match target (if (target-hurd? target)
((or "i586-pc-gnu" "i586-gnu") xhurd-core-headers) xhurd-core-headers
(_ xlinux-headers))) xlinux-headers))
(define* (cross-libc . args) (define* (cross-libc . args)
(if (or (= (length args) 1) (contains-keyword? args)) (if (or (= (length args) 1) (contains-keyword? args))

View file

@ -145,7 +145,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
target target
#:xbinutils (cross-binutils target) #:xbinutils (cross-binutils target)
#:libc (cross-bootstrap-libc target)))) #:libc (cross-bootstrap-libc target))))
`(("cross-gcc" ,(package `(,@(%final-inputs)
;; As versions for gcc and cross-gcc can differ, make sure to have
;; cross-gcc behind gcc in CPLUS_INCLUDE_PATH.
("cross-gcc" ,(package
(inherit xgcc) (inherit xgcc)
(search-paths (search-paths
;; Ensure the cross libc headers appears on the ;; Ensure the cross libc headers appears on the
@ -154,8 +157,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(variable "CROSS_CPLUS_INCLUDE_PATH") (variable "CROSS_CPLUS_INCLUDE_PATH")
(files '("include"))) (files '("include")))
(package-search-paths gcc))))) (package-search-paths gcc)))))
("cross-binutils" ,(cross-binutils target)) ("cross-binutils" ,(cross-binutils target))))
,@(%final-inputs)))
`(("libc" ,(glibc-for-bootstrap glibc)) `(("libc" ,(glibc-for-bootstrap glibc))
("libc:static" ,(glibc-for-bootstrap glibc) "static") ("libc:static" ,(glibc-for-bootstrap glibc) "static")
("gcc" ,(gcc-for-bootstrap glibc)) ("gcc" ,(gcc-for-bootstrap glibc))
@ -395,10 +397,15 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
((#:configure-flags flags _ ...) ((#:configure-flags flags _ ...)
flags))) flags)))
#:make-flags #:make-flags
(match (memq #:make-flags (package-arguments binutils)) #~(append
#$(if (target-hurd64?)
#~'("lt_cv_prog_compiler_static_works=yes"
"lt_cv_prog_compiler_static_works_CXX=yes")
#~'())
#$(match (memq #:make-flags (package-arguments binutils))
((#:make-flags flags _ ...) ((#:make-flags flags _ ...)
flags) flags)
(_ #~'())) (_ #~'())))
#:strip-flags #~'("--strip-all") #:strip-flags #~'("--strip-all")
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
@ -642,6 +649,9 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
#$@(if (target-hurd?) #$@(if (target-hurd?)
#~("--disable-jit") #~("--disable-jit")
#~())
#$@(if (target-hurd64?)
#~("lt_cv_prog_compiler_static_works=yes")
#~()))) #~())))
((#:phases phases '%standard-phases) ((#:phases phases '%standard-phases)
#~(modify-phases #$phases #~(modify-phases #$phases

View file

@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org> ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -25,7 +26,8 @@
x86_64-linux-x32 x86_64-linux-x32
i686-mingw i686-mingw
x86_64-mingw x86_64-mingw
i586-gnu)) i586-gnu
x86_64-gnu))
(define i686-linux (define i686-linux
(platform (platform
@ -71,3 +73,10 @@
(system "i586-gnu") (system "i586-gnu")
(rust-target "i686-unknown-hurd-gnu") (rust-target "i686-unknown-hurd-gnu")
(glibc-dynamic-linker "/lib/ld.so.1"))) (glibc-dynamic-linker "/lib/ld.so.1")))
(define x86_64-gnu
(platform
(target "x86_64-pc-gnu")
(system "x86_64-gnu")
(rust-target "x86_64-unknown-hurd-gnu")
(glibc-dynamic-linker "/lib/ld-x86-64.so.1")))

View file

@ -17,7 +17,7 @@
;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
;;; Copyright © 2022 Antero Mejr <antero@mailbox.org> ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com> ;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com> ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
;;; Copyright © 2024 Herman Rimm <herman@rimm.ee> ;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
@ -94,6 +94,8 @@
target-linux? target-linux?
target-hurd? target-hurd?
system-hurd? system-hurd?
target-hurd64?
system-hurd64?
target-mingw? target-mingw?
target-x86-32? target-x86-32?
target-x86-64? target-x86-64?
@ -716,6 +718,17 @@ a character other than '@'."
"Is the current system the GNU(/Hurd) system?" "Is the current system the GNU(/Hurd) system?"
(and=> (%current-system) target-hurd?)) (and=> (%current-system) target-hurd?))
(define* (target-hurd64? #:optional (target (or (%current-target-system)
(%current-system))))
"Does TARGET represent the 64bit GNU(/Hurd) system?"
(and (target-hurd?)
(target-64bit? target)))
(define* (system-hurd64?)
"Is the current system the 64bit GNU(/Hurd) system?"
(and (system-hurd?)
(target-64bit? (%current-system))))
(define* (target-mingw? #:optional (target (%current-target-system))) (define* (target-mingw? #:optional (target (%current-target-system)))
"Is the operating system of TARGET Windows?" "Is the operating system of TARGET Windows?"
(and target (and target