Fix link flags to specify cpu instead of (wrong) arch.
-march=armv7 is NOT right for cortex-m3, and results in unexpected arm code being linked in when using multilib toolchains
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
450c3e00a1
commit
6574baa767
@@ -28,13 +28,14 @@ GDB = $(PREFIX)-gdb
|
|||||||
# Uncomment this line if you want to use the installed (not local) library.
|
# Uncomment this line if you want to use the installed (not local) library.
|
||||||
#TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
#TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||||
TOOLCHAIN_DIR = ../../../../..
|
TOOLCHAIN_DIR = ../../../../..
|
||||||
|
ARCH_FLAGS = -mthumb -mcpu=cortex-m3 -msoft-float
|
||||||
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
|
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
|
||||||
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD -DSTM32F1
|
-fno-common $(ARCH_FLAGS) -MD -DSTM32F1
|
||||||
LDSCRIPT ?= $(BINARY).ld
|
LDSCRIPT ?= $(BINARY).ld
|
||||||
LDFLAGS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group \
|
LDFLAGS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group \
|
||||||
-L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32/f1 \
|
-L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32/f1 \
|
||||||
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
|
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
|
||||||
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
|
$(ARCH_FLAGS) -mfix-cortex-m3-ldrd
|
||||||
OBJS += $(BINARY).o
|
OBJS += $(BINARY).o
|
||||||
|
|
||||||
OOCD ?= openocd
|
OOCD ?= openocd
|
||||||
|
|||||||
Reference in New Issue
Block a user