From: Greg Hackmann Date: Tue, 2 Dec 2014 00:13:30 +0000 (-0800) Subject: ANDROID: arch: force -fno-pic X-Git-Tag: MMI-PSA29.97-13-9~4388 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9709dab98eb1e1132dc89358cefbd10e424874eb;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ANDROID: arch: force -fno-pic The Android toolchains enable -fpic by default. -fpic isn't needed for the kernel and breaks CONFIG_JUMP_LABEL, so turn it off. Change-Id: I685da1dc60e4cf1e9abcfb56e03654675ac02a0c Signed-off-by: Greg Hackmann [AmitP: Folded following android-4.9 commit changes into this patch 5acb60f60a2c ("ANDROID: arch: x86: disable pic for Android toolchain")] Signed-off-by: Amit Pundir --- diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 939b310913cf..9dac763823c3 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -48,6 +48,7 @@ endif KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += $(call cc-option, -mpc-relative-literal-loads) +KBUILD_CFLAGS += -fno-pic KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index a20eacd9c7e9..02cac64e2495 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -111,6 +111,8 @@ else KBUILD_CFLAGS += $(call cc-option,-mno-80387) KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387) + KBUILD_CFLAGS += -fno-pic + # By default gcc and clang use a stack alignment of 16 bytes for x86. # However the standard kernel entry on x86-64 leaves the stack on an # 8-byte boundary. If the compiler isn't informed about the actual