summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2016-11-03 13:31:44 -0600
committerBen Hutchings <ben@decadent.org.uk>2016-11-03 13:32:07 -0600
commit586b6ef20b51f842fa2e5b98a662f01f2ce16103 (patch)
treeb6a4d447b887c8f7f504450b3e684b55915467c5
parentc6318ee2ee5de97d76a81c43e36ca85bba2c4974 (diff)
kbuild: add -fno-PIE (Closes: #841368)
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/bugfix/all/kbuild-add-fno-pie.patch37
-rw-r--r--debian/patches/series1
3 files changed, 39 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index cdfe59566..07c985986 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/debian/patches/bugfix/all/kbuild-add-fno-pie.patch b/debian/patches/bugfix/all/kbuild-add-fno-pie.patch
new file mode 100644
index 000000000..b284510ba
--- /dev/null
+++ b/debian/patches/bugfix/all/kbuild-add-fno-pie.patch
@@ -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 isn’t 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
diff --git a/debian/patches/series b/debian/patches/series
index 8d78ed427..c5d0919e8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -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