diff options
author | Damien George <damien@micropython.org> | 2020-06-23 14:00:16 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-06-23 14:00:16 +1000 |
commit | b4dc4c5b9a1e6df620a14d85f18721a0bcb17d83 (patch) | |
tree | 312db55eb069941518d5b719e6e39a8fee5b3470 | |
parent | 81a7293ed63bb39e05e4303f7ad297807748c7ea (diff) | |
download | micropython-b4dc4c5b9a1e6df620a14d85f18721a0bcb17d83.tar.gz micropython-b4dc4c5b9a1e6df620a14d85f18721a0bcb17d83.zip |
stm32/mboot: Use additional CFLAGS to compile string0.c.
This is the same as a902b69dd51de0e3fe3bb6955296591d6a93abab but applied to
mboot's Makefile.
Signed-off-by: Damien George <damien@micropython.org>
-rwxr-xr-x | ports/stm32/mboot/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/mboot/Makefile b/ports/stm32/mboot/Makefile index 79aa3316f9..a72b752ac9 100755 --- a/ports/stm32/mboot/Makefile +++ b/ports/stm32/mboot/Makefile @@ -57,6 +57,10 @@ CFLAGS_MCU_h7 = $(CFLAGS_CORTEX_M) -mtune=cortex-m7 -mcpu=cortex-m7 CFLAGS_MCU_l4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 CFLAGS_MCU_wb = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 +# Standard C functions like memset need to be compiled with special flags so +# the compiler does not optimise these functions in terms of themselves. +CFLAGS_BUILTIN ?= -ffreestanding -fno-builtin -fno-lto + CFLAGS = $(INC) -Wall -Wpointer-arith -Wdouble-promotion -Wfloat-conversion -Werror -std=gnu99 -nostdlib $(CFLAGS_MOD) $(CFLAGS_EXTRA) CFLAGS += -D$(CMSIS_MCU) CFLAGS += $(CFLAGS_MCU_$(MCU_SERIES)) @@ -84,6 +88,7 @@ else COPT += -Os -DNDEBUG endif +$(BUILD)/lib/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN) LIB_SRC_C = \ lib/libc/string0.c \ lib/oofatfs/ff.c \ |