mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-24 15:56:49 +00:00
8b52a8906b
As usual these patches were extracted and rebased from the raspberry pi repo: https://github.com/raspberrypi/linux/tree/rpi-4.4.y - led1 can't be controlled on rpi-3 for linux 4.4, remove it. - Fix modules.mk typos. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
55 lines
1.9 KiB
Diff
55 lines
1.9 KiB
Diff
From e1c194ad704d298d6914e5b1efc4afee41a18a4c 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(-)
|
|
|
|
diff --git a/Makefile b/Makefile
|
|
index c17219e..1099371 100644
|
|
--- 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
|
|
--
|
|
2.1.4
|
|
|