gnu: binutils: Update to 2.41.

* gnu/packages/base.scm (binutils): Update to 2.41.
[properties]: Remove.
[native-inputs]: New field.
(binutils+documentation): Remove.
(binutils-2.33)[native-inputs]: New field.
(binutils-gold): Inherit from BINUTILS.
[native-inputs]: Use ‘modify-inputs’ to preserve BISON.
* gnu/packages/commencement.scm (binutils-boot0)[arguments]: Pass
‘--disable-gprofng’.
[native-inputs]: New field.
(binutils-final): Move below ‘libstdc++’.
[native-inputs]: New field.
[arguments]: Add libstdc++ to #:allowed-references.
Extend #:configure-flags to libstdc++ is found.

Change-Id: I72750ca46ffd484d26608c4cec2931edb06b19a5
This commit is contained in:
Ludovic Courtès 2024-01-10 22:59:10 +01:00
parent 8224555802
commit e7fdcffc73
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 48 additions and 48 deletions

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2019 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
@ -634,14 +634,14 @@ (define-public gnu-make-4.2
(define-public binutils
(package
(name "binutils")
(version "2.38")
(version "2.41")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://gnu/binutils/binutils-"
version ".tar.bz2"))
(sha256
(base32 "1y0fb4qgxaxfyf81x9fqq9w5609mkah0b7wm1f7ab9kpy0fcf3h7"))
(base32 "02xkm9xgcrqhln742636nm43yzrpjkhqj0z64h03gf7pab0bxi54"))
(patches (search-patches "binutils-loongson-workaround.patch"))))
(build-system gnu-build-system)
(arguments
@ -672,16 +672,11 @@ (define-public binutils
"--enable-lto"
"--enable-separate-code"
"--enable-threads")
;; XXX: binutils 2.38 was released without generated manuals:
;; <https://sourceware.org/bugzilla/show_bug.cgi?id=28909>. To avoid
;; a circular dependency on texinfo, prevent the build system from
;; creating the manuals by calling "true" instead of "makeinfo" ...
;; For some reason, the build machinery insists on rebuilding .info
;; files, even though they're already provided by the tarball.
#:make-flags '("MAKEINFO=true")))
;; ... and "hide" this package such that users who install binutils get
;; the version with documentation defined below.
(properties '((hidden? . #t)))
(native-inputs (list bison)) ;needed to build 'gprofng'
(synopsis "Binary utilities: bfd gas gprof ld")
(description
"GNU Binutils is a collection of tools for working with binary files.
@ -693,16 +688,6 @@ (define-public binutils
(license gpl3+)
(home-page "https://www.gnu.org/software/binutils/")))
(define-public binutils+documentation
(package/inherit binutils
(native-inputs
(list texinfo))
(arguments
(substitute-keyword-arguments (package-arguments binutils)
((#:make-flags flags ''())
''())))
(properties '())))
;; FIXME: ath9k-firmware-htc-binutils.patch do not apply on 2.34 because of a
;; big refactoring of xtensa-modules.c (commit 567607c11fbf7105 upstream).
;; Keep this version around until the patch is updated.
@ -721,10 +706,11 @@ (define-public binutils-2.33
(arguments
(substitute-keyword-arguments (package-arguments binutils)
((#:make-flags _ ''()) ''())))
(native-inputs '())
(properties '())))
(define-public binutils-gold
(package/inherit binutils+documentation
(package/inherit binutils
(name "binutils-gold")
(arguments
(substitute-keyword-arguments (package-arguments binutils)
@ -745,7 +731,8 @@ (define-public binutils-gold
(substitute* "gold/Makefile.in"
((" testsuite") " ")))))
'())))))
(native-inputs (list bc))))
(native-inputs (modify-inputs (package-native-inputs binutils)
(append bc)))))
(define* (make-ld-wrapper name #:key
(target (const #f))

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
@ -2273,8 +2273,10 @@ (define (remove-triplet-prefix name)
,@(substitute-keyword-arguments (package-arguments binutils)
((#:configure-flags cf)
`(cons ,(string-append "--target=" (boot-triplet))
,cf)))))
`(append (list ,(string-append "--target=" (boot-triplet))
"--disable-gprofng") ;requires Bison
,cf)))))
(native-inputs '()) ;no Bison
(inputs (%boot0-inputs))))
(define libstdc++-boot0
@ -3146,27 +3148,6 @@ (define (%boot2-inputs)
("gcc" ,gcc-boot0-wrapped)
,@(fold alist-delete (%boot1-inputs) '("libc" "gcc" "linux-libre-headers"))))
(define binutils-final
(package
(inherit binutils)
(source (bootstrap-origin (package-source binutils)))
(arguments
`(#:guile ,%bootstrap-guile
#:implicit-inputs? #f
#:allowed-references
,@(match (%current-system)
((? target-powerpc?)
`(("out" ,glibc-final ,static-bash-for-glibc)))
(_
`(("out" ,glibc-final))))
,@(package-arguments binutils)))
(inputs
(match (%current-system)
((? target-powerpc?)
`(("bash" ,static-bash-for-glibc)
,@(%boot2-inputs)))
(_ (%boot2-inputs))))))
(define libstdc++
;; Intermediate libstdc++ that will allow us to build the final GCC
;; (remember that GCC-BOOT0 cannot build libstdc++.)
@ -3196,6 +3177,38 @@ (define libstdc++
(inputs (%boot2-inputs))
(synopsis "GNU C++ standard library (intermediate)"))))
(define binutils-final
(package
(inherit binutils)
(source (bootstrap-origin (package-source binutils)))
(arguments
`(#:guile ,%bootstrap-guile
#:implicit-inputs? #f
#:allowed-references
("out"
,glibc-final
,(this-package-native-input "libstdc++")
,@(if (target-powerpc? (%current-system))
(list static-bash-for-glibc)
'()))
,@(substitute-keyword-arguments (package-arguments binutils)
((#:configure-flags flags #~'())
;; For gprofng, tell the build system where to look for libstdc++.
#~(append #$flags
(list (string-append
"LDFLAGS=-L"
#$(this-package-native-input "libstdc++")
"/lib")))))))
(native-inputs (list bison-boot0
libstdc++)) ;for gprofng
(inputs
(match (%current-system)
((? target-powerpc?)
`(("bash" ,static-bash-for-glibc)
,@(%boot2-inputs)))
(_ (%boot2-inputs))))))
(define zlib-final
;; Zlib used by GCC-FINAL.
(package