aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-12-21 18:26:32 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-12-22 13:52:36 +1100
commitf51848680915eae487fefb74e2eca008b8649745 (patch)
treec4ae1ad8071bd14ead62f7096be56f6468c9fb71
parent635cb0ec9d6907803b9fbfc29872c38a44afe906 (diff)
downloadskiboot-f51848680915eae487fefb74e2eca008b8649745.zip
skiboot-f51848680915eae487fefb74e2eca008b8649745.tar.gz
skiboot-f51848680915eae487fefb74e2eca008b8649745.tar.bz2
Makefile: Disable stack protector due to gcc problems
Depending on how it was built, gcc will use the canary from a global (works for us) or from the TLS (doesn't work for us and accesses random stuff instead). Fixing that would be tricky. There are talks of adding a gcc option to force use of globals, but in the meantime, disable the stack protector Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add -fno-stack-protector] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit fe6f1f982b562ba855bb68fb51545f104078f546) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--Makefile.main12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile.main b/Makefile.main
index 6b011d7..f6d9a43 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -78,12 +78,18 @@ ifeq ($(SKIBOOT_GCOV),1)
CFLAGS += -fprofile-arcs -ftest-coverage -DSKIBOOT_GCOV=1
endif
+# Stack protector disabled for now. gcc tends to use the TLS to
+# access the canary (depending on how gcc was built), and this won't
+# work for us.
+#
ifeq ($(STACK_CHECK),1)
-CFLAGS += -fstack-protector-all -pg
+#CFLAGS += -fstack-protector-all -pg
+CFLAGS += -fno-stack-protector -pg
CPPFLAGS += -DSTACK_CHECK_ENABLED
else
-CFLAGS += -fstack-protector
-CFLAGS += $(call try-cflag,$(CC),-fstack-protector-strong)
+CFLAGS += -fno-stack-protector
+#CFLAGS += -fstack-protector
+#CFLAGS += $(call try-cflag,$(CC),-fstack-protector-strong)
endif
CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \