Change in simtrace2[master]: firmware: do not allow undefined symbols
laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/23609 ) Change subject: firmware: do not allow undefined symbols .. 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 --- M firmware/Makefile M firmware/libboard/common/source/board_lowlevel.c 2 files changed, 7 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/firmware/Makefile b/firmware/Makefile index ccf5843..cc40673 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -164,14 +164,14 @@ # -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 diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c index b4d7d32..1ddbcba 100644 --- a/firmware/libboard/common/source/board_lowlevel.c +++ b/firmware/libboard/common/source/board_lowlevel.c @@ -218,3 +218,8 @@ do { } while ((jiffies - jiffies_start) < msecs); } + +void abort() { + NVIC_SystemReset(); + while(1) {}; +} -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/23609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5 Gerrit-Change-Number: 23609 Gerrit-PatchSet: 2 Gerrit-Owner: laforge Gerrit-Reviewer: Hoernchen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-MessageType: merged
Change in simtrace2[master]: firmware: do not allow undefined symbols
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/simtrace2/+/23609 ) Change subject: firmware: do not allow undefined symbols .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/23609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5 Gerrit-Change-Number: 23609 Gerrit-PatchSet: 1 Gerrit-Owner: laforge Gerrit-Reviewer: Hoernchen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Comment-Date: Sun, 04 Apr 2021 16:15:46 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in simtrace2[master]: firmware: do not allow undefined symbols
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/simtrace2/+/23609 ) Change subject: firmware: do not allow undefined symbols .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/23609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5 Gerrit-Change-Number: 23609 Gerrit-PatchSet: 1 Gerrit-Owner: laforge Gerrit-Reviewer: Hoernchen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Comment-Date: Sun, 04 Apr 2021 15:04:40 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in simtrace2[master]: firmware: do not allow undefined symbols
Hello Hoernchen, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/c/simtrace2/+/23609 to review the following change. Change subject: firmware: do not allow undefined symbols .. 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 --- M firmware/Makefile M firmware/libboard/common/source/board_lowlevel.c 2 files changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/09/23609/1 diff --git a/firmware/Makefile b/firmware/Makefile index ccf5843..cc40673 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -164,14 +164,14 @@ # -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 diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c index b4d7d32..1ddbcba 100644 --- a/firmware/libboard/common/source/board_lowlevel.c +++ b/firmware/libboard/common/source/board_lowlevel.c @@ -218,3 +218,8 @@ do { } while ((jiffies - jiffies_start) < msecs); } + +void abort() { + NVIC_SystemReset(); + while(1) {}; +} -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/23609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5 Gerrit-Change-Number: 23609 Gerrit-PatchSet: 1 Gerrit-Owner: laforge Gerrit-Reviewer: Hoernchen Gerrit-MessageType: newchange