~ruther/guix-exprs

f49fa0701e350cc3d46cd7ba6c3ccf33a41af544 — Rutherther 7 months ago 840ecca
fix: libstdc++ output lib path
1 files changed, 25 insertions(+), 7 deletions(-)

M ruther/packages/embedded.scm
M ruther/packages/embedded.scm => ruther/packages/embedded.scm +25 -7
@@ 138,6 138,30 @@
           ("xgcc" ,(make-gcc-arm-none-eabi-12.3.rel1))
           ("texinfo" ,texinfo)))))))

(define make-libstdc++-12.3.rel1
  (mlambda (xgcc newlib)
    (let* ((newlib-with-xgcc
            (package
              (inherit newlib)
              (native-inputs
               (alist-replace "xgcc" (list xgcc)
                              (package-native-inputs newlib)))))
           (base ((@@ (gnu packages embedded) make-libstdc++-arm-none-eabi) xgcc newlib-with-xgcc)))
      (package
        (inherit base)
        ;; TODO add back the debug phase after figuring out
        ;; how the Guix build system / gcc build phases create the
        ;; debug phase
        (outputs '("out"))
        (arguments (substitute-keyword-arguments (package-arguments base)
                     ((#:configure-flags flags)

                      #~(cons* "--with-target-subdir=yes"
                               (string-append "--libdir="
                                              #$output
                                              "/arm-none-eabi/lib")
                               #$flags))))))))

(define make-arm-none-eabi-toolchain
  (mlambda (xgcc newlib)
    "Produce a cross-compiler toolchain package with the compiler XGCC and the


@@ 169,13 193,7 @@ C library variant NEWLIB."
                             directories))))))
        (propagated-inputs
         `(("binutils" ,(cross-binutils "arm-none-eabi"))
           ("libstdc++" ,(let ((base ((@@ (gnu packages embedded) make-libstdc++-arm-none-eabi) xgcc newlib-with-xgcc)))
                           (package
                             (inherit base)
                             (arguments (substitute-keyword-arguments (package-arguments base)
                                          ((#:configure-flags flags)
                                           #~(cons* "--with-target-subdir=yes"
                                                    #$flags)))))))
           ("libstdc++" ,(make-libstdc++-12.3.rel1 xgcc newlib))
           ("gcc" ,xgcc)
           ("newlib" ,newlib-with-xgcc)))
        (synopsis "Complete GCC tool chain for ARM bare metal development")

Do not follow this link