kbuild: add -fno-PIE (Closes: #841368)

This commit is contained in:
Ben Hutchings 2016-11-03 13:31:44 -06:00
parent c6318ee2ee
commit 586b6ef20b
3 changed files with 39 additions and 0 deletions

1
debian/changelog vendored
View File

@ -4,6 +4,7 @@ linux (4.9~rc3-1~exp1) UNRELEASED; urgency=medium
[ Ben Hutchings ]
* [rt] Disable until it is updated for 4.9 or later
* kbuild: add -fno-PIE (Closes: #841368)
-- Ben Hutchings <ben@decadent.org.uk> Sat, 29 Oct 2016 00:08:55 +0100

View File

@ -0,0 +1,37 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 2 Nov 2016 18:20:58 +0100
Subject: kbuild: add -fno-PIE
Origin: https://www.spinics.net/lists/linux-kbuild/msg13608.html
Bug-Debian: https://bugs.debian.org/841368
Debian started to build the gcc with -fPIE by default so the kernel
build ends before it starts properly with:
|kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
Also add to KBUILD_AFLAGSi due to:
|gcc -Wp,-MD,arch/x86/entry/vdso/vdso32/.note.o.d … -mfentry -DCC_USING_FENTRY … vdso/vdso32/note.S
|arch/x86/entry/vdso/vdso32/note.S:1:0: sorry, unimplemented: -mfentry isnt supported for 32-bit in c ombination with -fpic
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -400,12 +400,12 @@ KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
- -Wno-format-security \
+ -Wno-format-security -fno-PIE \
-std=gnu89
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
-KBUILD_AFLAGS := -D__ASSEMBLY__
+KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds

View File

@ -63,6 +63,7 @@ bugfix/all/kbuild-do-not-use-hyphen-in-exported-variable-name.patch
bugfix/all/ext4-fix-bug-838544.patch
bugfix/all/mm-memcontrol-use-special-workqueue-for-creating-per-memcg-caches.patch
bugfix/all/netfilter-xt_nflog-fix-unexpected-truncated-packet.patch
bugfix/all/kbuild-add-fno-pie.patch
# Miscellaneous features