diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2016-12-21 18:26:32 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-12-22 13:49:42 +1100 |
commit | 41cace5f87d95664e91f38ee767e01b6737c8299 (patch) | |
tree | 78a3af017bfe7d9f93e6babe387090597874f962 | |
parent | 9b35d974cc62df3796c80b9fff0c07fe18912e65 (diff) | |
download | skiboot-41cace5f87d95664e91f38ee767e01b6737c8299.zip skiboot-41cace5f87d95664e91f38ee767e01b6737c8299.tar.gz skiboot-41cace5f87d95664e91f38ee767e01b6737c8299.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.main | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.main b/Makefile.main index ec5a3c4..c88aabc 100644 --- a/Makefile.main +++ b/Makefile.main @@ -70,12 +70,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 # XXX Add -fstack-protector-strong on gcc 4.9 -CFLAGS += -fstack-protector +#CFLAGS += -fstack-protector +CFLAGS += -fno-stack-protector endif CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \ |