summaryrefslogtreecommitdiff
path: root/gnu/packages/embedded.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
committerEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
commitfcc39864dba82e14895afbe841091091366c96bc (patch)
tree6e0f05495fd6512051224dc85fd3ab495cbf1a24 /gnu/packages/embedded.scm
parent76fc36d0a7215979bb74c05840f5a4de4ab5ea93 (diff)
parent44f9432705d04c069a8acf9e37e3ad856ac0bf82 (diff)
downloadguix-patches-fcc39864dba82e14895afbe841091091366c96bc.tar
guix-patches-fcc39864dba82e14895afbe841091091366c96bc.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm
Diffstat (limited to 'gnu/packages/embedded.scm')
-rw-r--r--gnu/packages/embedded.scm47
1 files changed, 43 insertions, 4 deletions
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 413760ab72..480bbf7835 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -147,7 +148,9 @@
(files '("arm-none-eabi/include")))
(search-path-specification
(variable "CROSS_CPLUS_INCLUDE_PATH")
- (files '("arm-none-eabi/include")))
+ (files '("arm-none-eabi/include"
+ "arm-none-eabi/include/c++"
+ "arm-none-eabi/include/c++/arm-none-eabi")))
(search-path-specification
(variable "CROSS_LIBRARY_PATH")
(files '("arm-none-eabi/lib"))))))))
@@ -227,7 +230,41 @@ usable on embedded products.")
"--enable-lite-exit"
"--enable-newlib-global-atexit"
"--enable-newlib-nano-formatted-io"
- "--disable-nls"))))
+ "--disable-nls"))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; XXX: Most arm toolchains offer both *.a and *_nano.a as newlib
+ ;; and newlib-nano respectively. The headers are usually
+ ;; arm-none-eabi/include/newlib.h for newlib and
+ ;; arm-none-eabi/include/newlib-nano/newlib.h for newlib-nano. We
+ ;; have two different toolchain packages for each which works but
+ ;; is a little strange.
+ (add-after 'install 'hardlink-newlib
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; The nano.specs file says that newlib-nano files should end
+ ;; in "_nano.a" instead of just ".a". Note that this applies
+ ;; to all the multilib folders too.
+ (for-each
+ (lambda (file)
+ (link file
+ (string-append
+ ;; Strip ".a" off the end
+ (substring file 0 (- (string-length file) 2))
+ ;; Add "_nano.a" onto the end
+ "_nano.a")))
+ (find-files
+ out
+ "^(libc.a|libg.a|librdimon.a|libstdc\\+\\+.a|libsupc\\+\\+.a)$"))
+
+ ;; newlib.h is usually in this location instead so both
+ ;; newlib and newlib-nano can be in the toolchain at the same
+ ;; time
+ (mkdir (string-append out "/arm-none-eabi/include/newlib-nano"))
+ (symlink
+ "../newlib.h"
+ (string-append out "/arm-none-eabi/include/newlib-nano/newlib.h"))
+ #t)))))))
(synopsis "Newlib variant for small systems with limited memory")))
@@ -317,7 +354,9 @@ usable on embedded products.")
(files '("arm-none-eabi/include")))
(search-path-specification
(variable "CROSS_CPLUS_INCLUDE_PATH")
- (files '("arm-none-eabi/include")))
+ (files '("arm-none-eabi/include"
+ "arm-none-eabi/include/c++"
+ "arm-none-eabi/include/c++/arm-none-eabi")))
(search-path-specification
(variable "CROSS_LIBRARY_PATH")
(files '("arm-none-eabi/lib"))))))))
@@ -380,7 +419,7 @@ usable on embedded products.")
"--with-newlib"
,(string-append "--with-gxx-include-dir="
(assoc-ref %outputs "out")
- "/arm-none-eabi/include")))))
+ "/arm-none-eabi/include/c++")))))
(native-inputs
`(("newlib" ,newlib)
("xgcc" ,xgcc)