[RHEL7,COMMIT] ms/kbuild: add -fno-PIE

Submitted by Konstantin Khorenko on Jan. 31, 2018, 1:18 p.m.


Message ID 201801311318.w0VDI0IW015988@finist_ce7.work
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Jan. 31, 2018, 1:18 p.m.
The commit is pushed to "branch-rh7-3.10.0-693.11.6.vz7.42.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.11.6.vz7.42.3
commit f5139e5070bc0805de5c6b37d187aa854dd32ebb
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Wed Jan 31 16:18:00 2018 +0300

    ms/kbuild: add -fno-PIE
    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_AFLAGS 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 combination with -fpic
    Tagging it stable so it is possible to compile recent stable kernels as
    Cc: stable@vger.kernel.org
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Michal Marek <mmarek@suse.com>
    ms commit: 90944e40ba18 ("x86/kexec: add -fno-PIE")
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/Makefile b/Makefile
index 9fa0217d93c1..92eb03f4885d 100644
--- a/Makefile
+++ b/Makefile
@@ -623,6 +623,9 @@  endif # $(dot-config)
 # Defaults to vmlinux, but the arch makefile usually adds further targets
 all: vmlinux
+KBUILD_CFLAGS	+= $(call cc-option,-fno-PIE)
+KBUILD_AFLAGS	+= $(call cc-option,-fno-PIE)
 KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)