summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-05-04 15:53:51 +1000
committerDamien George <damien.p.george@gmail.com>2018-05-04 15:53:51 +1000
commitaea71dbde0d7bc31d9ac40ee1905c884fbf7b0de (patch)
tree489be8a87be60f751931e1a6d7c39251032b3bb0
parentcb3456ddfe330c562b7d7dde64df933ab7d987f1 (diff)
stm32/Makefile: Use -O2 to optimise compilation of lib/libc/string0.c.
-rw-r--r--ports/stm32/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index 7daf4df4a..99e2995ff 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -350,6 +350,11 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_USBDEV:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
OBJ += $(BUILD)/pins_$(BOARD).o
+# This file contains performance critical functions so turn up the optimisation
+# level. It doesn't add much to the code size and improves performance a bit.
+# Don't use -O3 with this file because gcc tries to optimise memset in terms of itself.
+$(BUILD)/lib/libc/string0.o: COPT += -O2
+
# We put several files into the first 16K section with the ISRs.
# If we compile these using -O0 then it won't fit. So if you really want these
# to be compiled with -O0, then edit boards/common.ld (in the .isr_vector section)