aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson2012-06-19 19:45:45 +0000
committerPiotr Esden-Tempski2012-06-29 02:09:50 -0700
commit6574baa7674e4c11fc590c72a3be1a6e7fda8c63 (patch)
treeca1a10af8afb46b851cfad171725c14a149c0917
parent450c3e00a16c3d8bf1a9282d2ca4b45e8b4d9045 (diff)
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
-rw-r--r--examples/stm32/f1/Makefile.include5
1 files changed, 3 insertions, 2 deletions
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