[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/23: gnu: cross-gcc: Enable multilib for AVR.
From: |
guix-commits |
Subject: |
07/23: gnu: cross-gcc: Enable multilib for AVR. |
Date: |
Mon, 11 Dec 2023 06:57:41 -0500 (EST) |
efraim pushed a commit to branch master
in repository guix.
commit 9095e10620c775145666f88ff4b0bfdc06645665
Author: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
AuthorDate: Tue Nov 28 12:34:50 2023 +0100
gnu: cross-gcc: Enable multilib for AVR.
* gnu/build/cross-toolchain.scm (patch-multilib-shebang): New procedure.
* gnu/packages/avr.scm (make-avr-gcc): Remove uneeded phases and flags
for multilib.
* gnu/packages/cross-base (cross-gcc-arguments) <#:configure-flags>
[target-avr?]: Remove --disable-multilib and add --enable-multilib.
Change-Id: Id68d803057ac898f0a670f10487b08bf0891ab0b
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
---
gnu/build/cross-toolchain.scm | 8 ++++++++
gnu/packages/avr.scm | 13 +------------
gnu/packages/cross-base.scm | 15 +++++++++++----
3 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/gnu/build/cross-toolchain.scm b/gnu/build/cross-toolchain.scm
index 9746be3e50..1933b3e49a 100644
--- a/gnu/build/cross-toolchain.scm
+++ b/gnu/build/cross-toolchain.scm
@@ -48,6 +48,12 @@
;; Search path for target headers when cross-compiling.
(map (cut string-append "CROSS_" <>) %gcc-include-paths))
+(define* (patch-genmultilib-shebang #:key inputs native-inputs
#:allow-other-keys)
+ "Patch-shebang in the gcc/genmultilib file doesn't work as it contains
several
+scripts inside, each with a #!/bin/sh that needs patching."
+ (substitute* "gcc/genmultilib"
+ (("#!/bin/sh") (string-append "#!" (which "sh")))))
+
(define* (make-cross-binutils-visible #:key outputs inputs target
#:allow-other-keys)
"Create symlinks for 'as', 'nm', and 'ld' in the \"out\" output, under
@@ -173,6 +179,8 @@ C_*INCLUDE_PATH."
"Modify PHASES to include everything needed to build a cross-GCC for TARGET,
a target triplet."
(modify-phases phases
+ (add-after 'unpack 'patch-genmultilib-shebang
+ patch-genmultilib-shebang)
(add-before 'configure 'set-cross-path
;; This mingw32 target checking logic should match that of target-mingw?
;; in (guix utils), but (guix utils) is too large too copy over to the
diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 23401cd249..e3671399c1 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -77,18 +77,7 @@
(format #t
"environment variable `CPLUS_INCLUDE_PATH' \
changed to ~a~%"
- (getenv "CPLUS_INCLUDE_PATH")))))
- ;; Without a working multilib build, the resulting GCC lacks
- ;; support for nearly every AVR chip.
- (add-after 'unpack 'fix-genmultilib
- (lambda _
- ;; patch-shebang doesn't work here because there are
- ;; actually several scripts inside this script, each with
- ;; a #!/bin/sh that needs patching.
- (substitute* "gcc/genmultilib"
- (("#!/bin/sh") (string-append "#!" (which "sh"))))))))
- ((#:configure-flags flags)
- #~(delete "--disable-multilib" #$flags))))
+ (getenv "CPLUS_INCLUDE_PATH")))))))))
(native-search-paths
(list (search-path-specification
(variable "CROSS_C_INCLUDE_PATH")
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 6de1306279..777b5d8761 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -197,12 +197,19 @@ base compiler and using LIBC (which may be either a libc
package or #f.)"
#~((string-append "--with-toolexeclibdir="
(assoc-ref %outputs "lib")
"/" #$target "/lib"))
+ #~())
+
+ #$@(if (target-avr? target)
+ #~("--enable-multilib")
#~()))
- #$(if libc
- flags
- #~(remove (cut string-match "--enable-languages.*" <>)
- #$flags))))
+ (remove
+ (lambda (flag)
+ (or (and #$libc
+ (string-prefix? "--enable-languages" flag))
+ (and #$(target-avr? target)
+ (string=? flag "--disable-multilib"))))
+ #$flags)))
((#:make-flags flags)
(if libc
#~(let ((libc (assoc-ref %build-inputs "libc")))
- 02/23: guix: gnu-build-system: Handle missing libc., (continued)
- 02/23: guix: gnu-build-system: Handle missing libc., guix-commits, 2023/12/11
- 06/23: gnu: make-avr-libc: Fix synopsis., guix-commits, 2023/12/11
- 10/23: gnu: cross-gcc: Handle AVR inputs., guix-commits, 2023/12/11
- 09/23: gnu: cross-libc: Add AVR Libc support., guix-commits, 2023/12/11
- 12/23: gnu: cross-gcc: Find AVR Libc files., guix-commits, 2023/12/11
- 11/23: gnu: cross-toolchain: Add set-cross-path for AVR., guix-commits, 2023/12/11
- 13/23: gnu: cross-gcc: Only C and C++ for AVR., guix-commits, 2023/12/11
- 17/23: gnu: Add gcc-cross-avr-toolchain., guix-commits, 2023/12/11
- 20/23: gnu: lufa: Use AVR target., guix-commits, 2023/12/11
- 04/23: guix: Add target-avr?., guix-commits, 2023/12/11
- 07/23: gnu: cross-gcc: Enable multilib for AVR.,
guix-commits <=
- 03/23: guix: Add avr platform., guix-commits, 2023/12/11
- 08/23: gnu: cross-gcc: Handle target include paths., guix-commits, 2023/12/11
- 15/23: guix: meson-build-system: Disable PIC for AVR., guix-commits, 2023/12/11
- 22/23: gnu: Add gcc-cross-x86_64-w64-mingw32-toolchain., guix-commits, 2023/12/11
- 05/23: gnu: microscheme: Move to avr-xyz., guix-commits, 2023/12/11
- 19/23: gnu: make-qmk-firmware: Use AVR target., guix-commits, 2023/12/11
- 14/23: guix: meson-build-system: Support AVR., guix-commits, 2023/12/11
- 21/23: gnu: Add gcc-cross-i686-w64-mingw32-toolchain., guix-commits, 2023/12/11
- 16/23: gnu: Add cross-gcc-toolchain procedure., guix-commits, 2023/12/11
- 18/23: gnu: make-ergodox-firmware: Use AVR target., guix-commits, 2023/12/11