* gnu/packages/embedded.scm
(gcc-arm-none-eabi-4.9)[phases]: Add expand-version-string phase
(gcc-arm-none-eabi-7-2018-q2-update): Inherit from gcc-arm-none-eabi-4.9 and
remove all the redundant bits.
Is this the appropriate time to tell you I also have a very eerily similar
patch set read to go for a riscv cross compiler? Maybe trying to make this
stuff reusable is a good thing to do. First step is to clean up the arm stuff I
I pretty sure this patch doesn't really change the packages at all in any
meaningful way. Adding the DEV-PHASE version thing means that now when people
type 'arm-none-eabi-gcc --version' they'll see in brackets the guix version
number beside the actual version number. Also
gcc-arm-none-eabi-7-2018-q2-update now has the 'with-multilib-list' configure
flag set twice but it's pretty clear it just uses the latter value as it won't
even compile with the inherited flag value.
There seems to be a weird glitch when you inherit a phase the uses
`this-package' but you also specify arguments. I found a work around though.
To test this patch I compiled gcc-arm-none-eabi-4.9, gcc-arm-none-eabi-6, and
gcc-arm-none-eabi-7-2018-q2-update successfully. Than I installed
arm-none-eabi-toolchain and made sure it could successfully compile the arm
stuff I'm working on. Everything seems to work great.
gnu/packages/embedded.scm | 144 +++++++++++++-------------------------
1 file changed, 48 insertions(+), 96 deletions(-)
Toggle diff (174 lines)
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index f388c11c3d..809708187f 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
- (getenv "CPLUS_INCLUDE_PATH"))
+ (getenv "CPLUS_INCLUDE_PATH")))))
(add-after 'unpack 'fix-genmultilib
(substitute* "gcc/genmultilib"
- (("#!/bin/sh") (string-append "#!" (which "sh"))))
+ (("#!/bin/sh") (string-append "#!" (which "sh"))))))
+ (add-after 'unpack 'expand-version-string
+ (make-file-writable "gcc/DEV-PHASE")
+ (with-output-to-file "gcc/DEV-PHASE"
+ (display ,(package-version this-package))))))))
((#:configure-flags flags)
;; The configure flags are largely identical to the flags used by the
;; "GCC ARM embedded" project.
(search-patches "gcc-6-cross-environment-variables.patch"
"gcc-6-arm-none-eabi-multilib.patch")))))))
+;;; The following definitions are for the "7-2018-q2-update" variant of the
+;;; ARM cross toolchain as offered on https://developer.arm.com
+(define-public gcc-arm-none-eabi-7-2018-q2-update
+ (package (inherit gcc-arm-none-eabi-6)
+ (version (string-append "7-2018-q2-update-"
+ revision "." (number->string svn-revision)))
+ (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch/")
+ (revision svn-revision)))
+ (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
+ "192ggs63bixf3irpijgfkjks73yx1r3a4i6grk1y0i0iny76pmx5"))
+ (origin-patches (package-source gcc-7))
+ (search-patches "gcc-7-cross-environment-variables.patch")))))
+ (substitute-keyword-arguments (package-arguments gcc-arm-none-eabi-4.9)
+ ((#:configure-flags flags)
+ ;; I add this flag on the end so it overrides the previously set value
+ `(append ,flags (list "--with-multilib-list=rmprofile")))
+ `(modify-phases ,phases
+ ;; XXX: I replicated this phase just so that the version is
+ ;; correct. This phase automatically gets the correct version if
+ ;; I don't specify any arguments for a package for some reason
+ ;; (see gcc-arm-none-eabi-6)
+ (replace 'expand-version-string
+ (make-file-writable "gcc/DEV-PHASE")
+ (with-output-to-file "gcc/DEV-PHASE"
+ (display ,(package-version this-package)))))))))))))
(define-public newlib-arm-none-eabi
@@ -268,98 +312,6 @@ usable on embedded products.")
(synopsis "Newlib variant for small systems with limited memory")))
-;;; The following definitions are for the "7-2018-q2-update" variant of the
-;;; ARM cross toolchain as offered on https://developer.arm.com
-(define-public gcc-arm-none-eabi-7-2018-q2-update
- (let ((xgcc (cross-gcc "arm-none-eabi"
- #:xbinutils (cross-binutils "arm-none-eabi")))
- (package (inherit xgcc)
- (version (string-append "7-2018-q2-update-"
- revision "." (number->string svn-revision)))
- (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch/")
- (revision svn-revision)))
- (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
- "192ggs63bixf3irpijgfkjks73yx1r3a4i6grk1y0i0iny76pmx5"))
- (origin-patches (package-source gcc-7))
- (search-patches "gcc-7-cross-environment-variables.patch")))))
- ,@(alist-delete "isl" (package-native-inputs xgcc))))
- (substitute-keyword-arguments (package-arguments xgcc)
- `(modify-phases ,phases
- (add-after 'unpack 'expand-version-string
- (make-file-writable "gcc/DEV-PHASE")
- (with-output-to-file "gcc/DEV-PHASE"
- (display "7-2018-q2-update")))
- (add-after 'unpack 'fix-genmultilib
- (substitute* "gcc/genmultilib"
- (("#!/bin/sh") (string-append "#!" (which "sh"))))
- (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((gcc (assoc-ref inputs "gcc")))
- ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
- ;; prevent header conflict with the GCC from native-inputs.
- (setenv "CPLUS_INCLUDE_PATH"
- (delete (string-append gcc "/include/c++")
- (string-split (getenv "CPLUS_INCLUDE_PATH")
- "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
- (getenv "CPLUS_INCLUDE_PATH"))
- ((#:configure-flags flags)
- ;; The configure flags are largely identical to the flags used by the
- ;; "GCC ARM embedded" project.
- `(append (list "--enable-multilib"
- "--with-multilib-list=rmprofile"
- "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
- "--disable-decimal-float"
- "--disable-libquadmath"
- "--disable-libstdcxx-pch"
- (delete "--disable-multilib" ,flags)))))
- (list (search-path-specification
- (variable "CROSS_C_INCLUDE_PATH")
- (files '("arm-none-eabi/include")))
- (search-path-specification
- (variable "CROSS_CPLUS_INCLUDE_PATH")
- (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"))))))))
(define-public newlib-arm-none-eabi-7-2018-q2-update
;; This is the same commit as used for the 7-2018-q2-update release