<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/simtrace2/+/23679">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">firmware: disable stack protector by default<br><br>Disable stack protector for all boards/apps by default, not only<br>qmod-dfu. Use 'make STACK_PROTECTOR=1' to enable.<br><br>This was recommened by Eric:<br>"I'd argue that we do not want this in general, since it adds canaries<br>to all functions that deal with buffers, and therefore impacts the<br>overall timing in a non determinstic way depending on inlining and<br>optimizations, while contributing nothing in non debug builds."<br><br>Related: OS#5081<br>Change-Id: I30ad97f231ea5b401def650bc9adc7e9f2770df0<br>---<br>M firmware/Makefile<br>1 file changed, 8 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/23679/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/Makefile b/firmware/Makefile</span><br><span>index b147b0d..684f223 100644</span><br><span>--- a/firmware/Makefile</span><br><span>+++ b/firmware/Makefile</span><br><span>@@ -59,11 +59,6 @@</span><br><span> BIN = bin</span><br><span> OBJ = obj/$(BOARD)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# Disable stack protector for code in small ROM regions (OS#5081)</span><br><span style="color: hsl(0, 100%, 40%);">-ifeq ($(BOARD)-$(APP), qmod-dfu)</span><br><span style="color: hsl(0, 100%, 40%);">-CFLAGS_EXTRA ?= -fno-stack-protector</span><br><span style="color: hsl(0, 100%, 40%);">-endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> #-------------------------------------------------------------------------------</span><br><span> #             Tools</span><br><span> #-------------------------------------------------------------------------------</span><br><span>@@ -183,7 +178,14 @@</span><br><span> CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"</span><br><span> CFLAGS += -DBOARD=\"$(BOARD)\" -DBOARD_$(BOARD)</span><br><span> CFLAGS += -DAPPLICATION=\"$(APP)\" -DAPPLICATION_$(APP)</span><br><span style="color: hsl(0, 100%, 40%);">-CFLAGS += $(CFLAGS_EXTRA)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Disable stack protector by default (OS#5081)</span><br><span style="color: hsl(120, 100%, 40%);">+ifeq ($(STACK_PROTECTOR), 1)</span><br><span style="color: hsl(120, 100%, 40%);">+CFLAGS += -fstack-protector</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+CFLAGS += -fno-stack-protector</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__</span><br><span> 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)</span><br><span> #LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/simtrace2/+/23679">change 23679</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/simtrace2/+/23679"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I30ad97f231ea5b401def650bc9adc7e9f2770df0 </div>
<div style="display:none"> Gerrit-Change-Number: 23679 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>