From afbde05cd3d4fb4a38b57e53c1c998e86fe1f2ab Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Mon, 23 Sep 2019 18:00:26 +0200 Subject: [PATCH] Linker: Recent libopencm3 linker already sets the stack. Thanks to Sid Price for noticing #520. --- src/platforms/f4discovery/Makefile.inc | 2 +- src/platforms/hydrabus/Makefile.inc | 2 +- src/platforms/native/Makefile.inc | 3 +-- src/platforms/stlink/Makefile.inc | 3 +-- src/platforms/swlink/Makefile.inc | 3 +-- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/platforms/f4discovery/Makefile.inc b/src/platforms/f4discovery/Makefile.inc index b04cf41..b36bf8f 100644 --- a/src/platforms/f4discovery/Makefile.inc +++ b/src/platforms/f4discovery/Makefile.inc @@ -7,7 +7,7 @@ CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ -DSTM32F4 -DF4DISCOVERY -I../libopencm3/include \ -Iplatforms/stm32 -LDFLAGS = -lopencm3_stm32f4 -Wl,--defsym,_stack=0x20010000 \ +LDFLAGS = -lopencm3_stm32f4 \ -Wl,-T,platforms/stm32/f4discovery.ld -nostartfiles -lc -lnosys \ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ diff --git a/src/platforms/hydrabus/Makefile.inc b/src/platforms/hydrabus/Makefile.inc index 36973e0..1c2bf7d 100644 --- a/src/platforms/hydrabus/Makefile.inc +++ b/src/platforms/hydrabus/Makefile.inc @@ -7,7 +7,7 @@ CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ -DSTM32F4 -DHYDRABUS -I../libopencm3/include \ -Iplatforms/stm32 -LDFLAGS = -lopencm3_stm32f4 -Wl,--defsym,_stack=0x20006000 \ +LDFLAGS = -lopencm3_stm32f4 \ -Wl,-T,platforms/stm32/f4discovery.ld -nostartfiles -lc -lnosys \ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ diff --git a/src/platforms/native/Makefile.inc b/src/platforms/native/Makefile.inc index 48baca3..1055570 100644 --- a/src/platforms/native/Makefile.inc +++ b/src/platforms/native/Makefile.inc @@ -6,8 +6,7 @@ CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb \ -DSTM32F1 -DBLACKMAGIC -I../libopencm3/include \ -Iplatforms/stm32 -LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs \ - -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \ +LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs -lopencm3_stm32f1 \ -Wl,-T,platforms/stm32/blackmagic.ld -nostartfiles -lc \ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ -L../libopencm3/lib diff --git a/src/platforms/stlink/Makefile.inc b/src/platforms/stlink/Makefile.inc index 4bde36c..9dc971a 100644 --- a/src/platforms/stlink/Makefile.inc +++ b/src/platforms/stlink/Makefile.inc @@ -6,8 +6,7 @@ OPT_FLAGS = -Os CFLAGS += -mcpu=cortex-m3 -mthumb \ -DSTM32F1 -DDISCOVERY_STLINK -I../libopencm3/include \ -I platforms/stm32 -LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs \ - -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \ +LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs -lopencm3_stm32f1 \ -Wl,-T,platforms/stm32/stlink.ld -nostartfiles -lc \ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ -L../libopencm3/lib diff --git a/src/platforms/swlink/Makefile.inc b/src/platforms/swlink/Makefile.inc index 19941ab..9c4394d 100644 --- a/src/platforms/swlink/Makefile.inc +++ b/src/platforms/swlink/Makefile.inc @@ -6,8 +6,7 @@ OPT_FLAGS = -Os CFLAGS += -mcpu=cortex-m3 -mthumb \ -DSTM32F1 -DDISCOVERY_SWLINK -I../libopencm3/include \ -I platforms/stm32 -LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs \ - -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \ +LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs -lopencm3_stm32f1 \ -Wl,-T,platforms/stm32/stlink.ld -nostartfiles -lc\ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ -L../libopencm3/lib