From f49fa0701e350cc3d46cd7ba6c3ccf33a41af544 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 6 Sep 2024 10:26:31 +0200 Subject: [PATCH] fix: libstdc++ output lib path --- ruther/packages/embedded.scm | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ruther/packages/embedded.scm b/ruther/packages/embedded.scm index a86cf89..b405e89 100644 --- a/ruther/packages/embedded.scm +++ b/ruther/packages/embedded.scm @@ -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") -- 2.48.1