Disable stack protection code emission
When building natively within a QEMU environment, stack protection
code is emitted by default. However, because the bootloader's libc
implementation doesn't support this, it needs to be disabled.
Change-Id: I2f612ecdd773b8c4455813b3e5acba5ca713ebe6
diff --git a/makefile b/makefile
index 80fafd7..d6687da 100644
--- a/makefile
+++ b/makefile
@@ -40,6 +40,11 @@
ifeq ($(EMMC_BOOT),1)
CFLAGS += -D_EMMC_BOOT=1
endif
+# When the host arch is ARM, ensure stack protection code is not emitted since
+# it's not supported by the bootloader's libc
+ifneq ($(shell uname -m | grep "arm.*"),)
+ CFLAGS += -fno-stack-protector
+endif
CPPFLAGS := -fno-exceptions -fno-rtti -fno-threadsafe-statics
#CPPFLAGS += -Weffc++
ASMFLAGS := -DASSEMBLY