package/am33x-cm3: disable SSP
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sun, 10 Nov 2019 21:09:19 +0000 (22:09 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Thu, 28 Nov 2019 19:08:33 +0000 (20:08 +0100)
Fixes:
 - http://autobuild.buildroot.net/results/3a3a21f3c35ea025e9b93e09c2454aed0ad31034

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/am33x-cm3/0002-Makefile-unconditionally-disable-SSP.patch [new file with mode: 0644]

diff --git a/package/am33x-cm3/0002-Makefile-unconditionally-disable-SSP.patch b/package/am33x-cm3/0002-Makefile-unconditionally-disable-SSP.patch
new file mode 100644 (file)
index 0000000..ed333bf
--- /dev/null
@@ -0,0 +1,35 @@
+From 6c3b05b74ccd49d8ba246bfef0c2e549b9f2bf7b Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 29 Oct 2019 16:14:18 +0100
+Subject: [PATCH] Makefile: unconditionally disable SSP
+
+Though -nostdlib is passed in $(CFLAGS), -fno-stack-protector must also be
+passed to avoid linking errors related to undefined references to
+'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
+-fstack-protector.
+
+Fixes:
+ - http://autobuild.buildroot.net/results/3a3a21f3c35ea025e9b93e09c2454aed0ad31034
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c3ec071..5226006 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,7 +16,8 @@ INCLUDES = $(SRCDIR)/include
+ CFLAGS =-march=armv7-m -mcpu=cortex-m3 -mthumb -nostdlib -Wall -Wundef \
+       -Werror-implicit-function-declaration -Wstrict-prototypes \
+       -Wdeclaration-after-statement -fno-delete-null-pointer-checks \
+-      -Wempty-body -fno-strict-overflow  -g -I$(INCLUDES) -O2
++      -Wempty-body -fno-strict-overflow -fno-stack-protector \
++      -g -I$(INCLUDES) -O2
+ LDFLAGS =-nostartfiles -fno-exceptions -Tfirmware.ld
+ EXECUTABLE=am335x-pm-firmware.elf
+-- 
+2.23.0
+