aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2017-02-06 17:12:09 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2017-02-06 22:24:42 +0100
commitdab5a4406799633a319381b0127e1fda82b15c02 (patch)
tree7d100dfd99914c1195ccada0f62387d4fced8563 /target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch
parent6b01f0f196c0c1ff43c362e9aef4433eacbbb8c6 (diff)
downloadupstream-dab5a4406799633a319381b0127e1fda82b15c02.tar.gz
upstream-dab5a4406799633a319381b0127e1fda82b15c02.tar.bz2
upstream-dab5a4406799633a319381b0127e1fda82b15c02.zip
brcm2708: update linux 4.4 patches to latest version
n As usual these patches were extracted and rebased from the raspberry pi repo: https://github.com/raspberrypi/linux/tree/rpi-4.4.y Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch')
-rw-r--r--target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch b/target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch
new file mode 100644
index 0000000000..36aafe8e19
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0552-kbuild-Steal-gcc-s-pie-from-the-very-beginning.patch
@@ -0,0 +1,49 @@
+From 8bb4bc0ec8fac19cc635e16d2e5a63dee2cd7f7b Mon Sep 17 00:00:00 2001
+From: Borislav Petkov <bp@suse.de>
+Date: Mon, 14 Nov 2016 19:41:31 +0100
+Subject: [PATCH] kbuild: Steal gcc's pie from the very beginning
+
+commit c6a385539175ebc603da53aafb7753d39089f32e upstream.
+
+So Sebastian turned off the PIE for kernel builds but that was too late
+- Kbuild.include already uses KBUILD_CFLAGS and trying to disable gcc
+options with, say cc-disable-warning, fails:
+
+ gcc -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
+ ...
+ -Wno-sign-compare -fno-asynchronous-unwind-tables -Wframe-address -c -x c /dev/null -o .31392.tmp
+ /dev/null:1:0: error: code model kernel does not support PIC mode
+
+because that returns an error and we can't disable the warning. For
+example in this case:
+
+KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
+
+which leads to gcc issuing all those warnings again.
+
+So let's turn off PIE/PIC at the earliest possible moment, when we
+declare KBUILD_CFLAGS so that cc-disable-warning picks it up too.
+
+Also, we need the $(call cc-option ...) because -fno-PIE is supported
+since gcc v3.4 and our lowest supported gcc version is 3.2 right now.
+
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Cc: Ben Hutchings <ben@decadent.org.uk>
+Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -619,8 +619,6 @@ include arch/$(SRCARCH)/Makefile
+ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
+ KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
+ KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
+-KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+-KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
+
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+ KBUILD_CFLAGS += -Os $(EXTRA_OPTIMIZATION)