From 6574baa7674e4c11fc590c72a3be1a6e7fda8c63 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 19 Jun 2012 19:45:45 +0000 Subject: 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 --- examples/stm32/f1/Makefile.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/stm32/f1/Makefile.include') diff --git a/examples/stm32/f1/Makefile.include b/examples/stm32/f1/Makefile.include index 92ad689..b63f3f0 100644 --- a/examples/stm32/f1/Makefile.include +++ b/examples/stm32/f1/Makefile.include @@ -28,13 +28,14 @@ GDB = $(PREFIX)-gdb # Uncomment this line if you want to use the installed (not local) library. #TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX) TOOLCHAIN_DIR = ../../../../.. +ARCH_FLAGS = -mthumb -mcpu=cortex-m3 -msoft-float 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 LDFLAGS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group \ -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32/f1 \ -T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \ - -mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float + $(ARCH_FLAGS) -mfix-cortex-m3-ldrd OBJS += $(BINARY).o OOCD ?= openocd -- cgit v1.2.3