diff --git a/platforms/chibios/platform.mk b/platforms/chibios/platform.mk index 26a2166a4fa0..1c8d430074e1 100644 --- a/platforms/chibios/platform.mk +++ b/platforms/chibios/platform.mk @@ -316,7 +316,7 @@ endif # # Use defined stack sizes of the main thread in linker scripts -LDSYMBOLS =--defsym=__process_stack_size__=$(USE_PROCESS_STACKSIZE),--defsym=__main_stack_size__=$(USE_EXCEPTIONS_STACKSIZE) +SHARED_LDSYMBOLS = -Wl,--defsym=__process_stack_size__=$(USE_PROCESS_STACKSIZE),--defsym=__main_stack_size__=$(USE_EXCEPTIONS_STACKSIZE) # Shared Compiler flags for all toolchains SHARED_CFLAGS = -fomit-frame-pointer \ @@ -327,7 +327,6 @@ SHARED_CFLAGS = -fomit-frame-pointer \ # Shared Linker flags for all toolchains SHARED_LDFLAGS = -T $(LDSCRIPT) \ - -Wl,$(LDSYMBOLS) \ -Wl,--gc-sections \ -nostartfiles @@ -349,11 +348,15 @@ ifeq ($(strip $(MCU)), risc-v) # Default to compiling with picolibc for RISC-V targets if available, which # is available by default on distributions based on Debian 11+. ifeq ($(shell $(TOOLCHAIN)gcc --specs=picolibc.specs -E - 2>/dev/null >/dev/null