summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2021-03-15 09:30:46 +0100
committerDamien George <damien@micropython.org>2021-03-16 12:54:16 +1100
commitd53a6d58b04e524e4ec5ee937a15cc3932f8ee2f (patch)
tree9961ae209545ceb01802fd0150b9dcb10567dd77
parent914380cb89d7cf5e9c186055753ff12bbcf6296a (diff)
stm32/Makefile: Fix C++ linker flags when toolchain has spaces in path.
The GNU Make dir command uses spaces as item separator so it does not work for e.g building the STM32 port on Cygwin with a default Arm installation in "c:/program files (x86)/GNU Arm Embedded Toolchain". Fix by using POSIX dirname on a quoted path instead.
-rw-r--r--ports/stm32/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index 6e5fc1536..9a66d3c10 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -145,7 +145,8 @@ endif
CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99,$(CFLAGS))
CXXFLAGS += $(CXXFLAGS_MOD)
ifneq ($(SRC_CXX)$(SRC_MOD_CXX),)
-LDFLAGS += -L$(dir $(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a))
+LIBSTDCPP_FILE_NAME = "$(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)"
+LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME))"
endif
# Options for mpy-cross