From fd6ca65ea4220ec0ce78e0db5e35779f6412390b Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 6 Sep 2024 22:28:36 +0200 Subject: [PATCH] fix: add libstdc++ CXXFLAGS, document with target subdir hack --- ruther/packages/embedded.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ruther/packages/embedded.scm b/ruther/packages/embedded.scm index c1bbcd0e11120b2abc5aa4c45e5170a1fe66e360..59c54d9448370c51f0400dc29f028a115fae3450 100644 --- a/ruther/packages/embedded.scm +++ b/ruther/packages/embedded.scm @@ -174,8 +174,13 @@ (outputs '("out")) (arguments (substitute-keyword-arguments (package-arguments base) ((#:configure-flags flags) - #~(cons* "--with-target-subdir=yes" + ; This is more of a hack. This option doesn't really seem + ; to change what subdir is used eventually, but without it there is + ; error: Link tests are not allowed after GCC_NO_EXECUTABLES. + #~(cons* "--with-target-subdir=\".\"" "CFLAGS=-ffunction-sections -fdata-sections" + "CXXFLAGS=-ffunction-sections -fdata-sections" + ; Only the arm-none-eabi/lib is added to CROSS_LIBRARY_PATH (string-append "--libdir=" #$output "/arm-none-eabi/lib") @@ -190,9 +195,11 @@ (arguments (substitute-keyword-arguments (package-arguments base) ((#:configure-flags flags) #~(cons* "CFLAGS=-ffunction-sections -fdata-sections -fno-exceptions" + "CXXFLAGS=-ffunction-sections -fdata-sections -fno-exceptions" (filter (lambda (flag) - (not (string-prefix? "CFLAGS=" flag))) + (not (or (string-prefix? "CFLAGS=" flag) + (string-prefix? "CXXFLAGS=")))) #$flags))) ((#:phases phases) #~(modify-phases #$phases