firmware: do not allow undefined symbols

For some reason undefined symbols were downgraded to warnings, which
means building a firmware that calls missing functions  (= address zero)
was perfectly fine, which of course made development more exciting....

This applies to builtins, too, printf of one char gets downgraded to
putchar, which we don't have, so disable builtins.

Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
This commit is contained in:
Eric Wild
2020-04-03 21:33:30 +02:00
committed by laforge
parent a1579ff4b0
commit 19cd3b0f71
2 changed files with 7 additions and 2 deletions

View File

@@ -164,14 +164,14 @@ CFLAGS += -Wno-suggest-attribute=noreturn
# -mlong-calls -Wall
#CFLAGS += -save-temps -fverbose-asm
#CFLAGS += -Wa,-a,-ad
CFLAGS += -D__ARM
CFLAGS += -D__ARM -fno-builtin
CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb # -mfix-cortex-m3-ldrd
CFLAGS += -ffunction-sections -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL) -DALLOW_PEER_ERASE=$(ALLOW_PEER_ERASE)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CFLAGS += -DBOARD=\"$(BOARD)\" -DBOARD_$(BOARD)
CFLAGS += -DAPPLICATION=\"$(APP)\" -DAPPLICATION_$(APP)
ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=ResetException -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--print-memory-usage $(LIB)
LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=ResetException -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--print-memory-usage -Wl,--no-undefined $(LIB)
#LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats
# Append BIN directories to output filename

View File

@@ -218,3 +218,8 @@ void mdelay(unsigned int msecs)
do {
} while ((jiffies - jiffies_start) < msecs);
}
void abort() {
NVIC_SystemReset();
while(1) {};
}