[linux] 02/03: kbuild: add -fno-PIE (Closes: #841368)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Thu Nov 3 19:34:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 586b6ef20b51f842fa2e5b98a662f01f2ce16103
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Thu Nov 3 13:31:44 2016 -0600

    kbuild: add -fno-PIE (Closes: #841368)
---
 debian/changelog                                   |  1 +
 debian/patches/bugfix/all/kbuild-add-fno-pie.patch | 37 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 39 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index cdfe595..07c9859 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 at 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 0000000..b284510
--- /dev/null
+++ b/debian/patches/bugfix/all/kbuild-add-fno-pie.patch
@@ -0,0 +1,37 @@
+From: Sebastian Andrzej Siewior <bigeasy at 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 at 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 8d78ed4..c5d0919 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
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list