1 parent cb3456d commit aea71dbCopy full SHA for aea71db
1 file changed
ports/stm32/Makefile
@@ -350,6 +350,11 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_USBDEV:.c=.o))
350
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
351
OBJ += $(BUILD)/pins_$(BOARD).o
352
353
+# This file contains performance critical functions so turn up the optimisation
354
+# level. It doesn't add much to the code size and improves performance a bit.
355
+# Don't use -O3 with this file because gcc tries to optimise memset in terms of itself.
356
+$(BUILD)/lib/libc/string0.o: COPT += -O2
357
+
358
# We put several files into the first 16K section with the ISRs.
359
# If we compile these using -O0 then it won't fit. So if you really want these
360
# to be compiled with -O0, then edit boards/common.ld (in the .isr_vector section)
0 commit comments