commit:     a5d779212b266be96f87f91cd5d468f50f3377c7
Author:     Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 30 12:20:47 2017 +0000
Commit:     Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
CommitDate: Sat Dec 30 12:20:47 2017 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=a5d77921

Make sure -fstack-check isn't enabled bug #642268

 0000_README                                     |  4 ++
 2902_Make-sure-fstack-check-isn-t-enabled.patch | 50 +++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/0000_README b/0000_README
index 9111187..86c72af 100644
--- a/0000_README
+++ b/0000_README
@@ -119,6 +119,10 @@ Patch:  
2901_tools-objtool-makefile-dont-assume-sync-checksh-is-executable.patch
 From:   
http://www.ozlabs.org/~akpm/mmotm/broken-out/tools-objtool-makefile-dont-assume-sync-checksh-is-executable.patch
 Desc:   patch(1) loses the x bit. Kernel build breaks.
 
+Patch:  2902_Make-sure-fstack-check-isn-t-enabled.patch
+From:   https://lkml.org/lkml/2017/12/29/488
+Desc:   Make sure -fstack-check isn't enabled.
+
 Patch:  4200_fbcondecor.patch
 From:   http://www.mepiscommunity.org/fbcondecor
 Desc:   Bootsplash ported by Conrad Kostecki. (Bug #637434)

diff --git a/2902_Make-sure-fstack-check-isn-t-enabled.patch 
b/2902_Make-sure-fstack-check-isn-t-enabled.patch
new file mode 100644
index 0000000..50660b1
--- /dev/null
+++ b/2902_Make-sure-fstack-check-isn-t-enabled.patch
@@ -0,0 +1,50 @@
+From 4689f2971534dad4b6ce1a50aa9a616580272e07 Mon Sep 17 00:00:00 2001
+From: Alice Ferrazzi <ali...@gentoo.org>
+Date: Sat, 30 Dec 2017 12:11:39 +0000
+Subject: [PATCH] Make sure -fstack-check isn't enabled
+
+On Fri, Dec 29, 2017 at 5:00 PM, Linus Torvalds
+<torva...@linux-foundation.org> wrote:
+>
+> Good. I was not feeling so happy about this bug report, but now I can
+> firmly just blame the gentoo compiler for having some shit-for-brains
+> "feature".
+
+Looks like I can generate similar bad code with the F26 version of
+gcc, it's just not enabled by default.
+
+So all gentoo did was change the default options.
+
+I suspect we should just add a
+
+    KBUILD_CFLAGS  += $(call cc-option,-fno-stack-check,)
+
+    somewhere to the main Makefile, just to make sure.
+
+    Maybe like the appended?
+
+    Toralf, Alexander, does this make things JustWork(tm) for you?
+
+                    Linus
+
+---
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 9edfb78836a9..930fa93f397d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -802,6 +802,9 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
+ # disable invalid "can't wrap" optimizations for signed / pointers
+ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
+ 
++# Make sure -fstack-check isn't enabled (like gentoo apparently did)
++KBUILD_CFLAGS  += $(call cc-option,-fno-stack-check,)
++
+ # conserve stack if available
+ KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
+ 
+-- 
+2.13.6
+

Reply via email to