ANDROID: arch: force -fno-pic
authorGreg Hackmann <ghackmann@google.com>
Tue, 2 Dec 2014 00:13:30 +0000 (16:13 -0800)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 18 Dec 2017 15:41:22 +0000 (21:11 +0530)
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 <ghackmann@google.com>
[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 <amit.pundir@linaro.org>
arch/arm64/Makefile
arch/x86/Makefile

index 939b310913cf38cd7ca3136128fb5440340d7d12..9dac763823c3a46d09a8b86950e203b45ac71c55 100644 (file)
@@ -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)
index a20eacd9c7e9a73867dcaa06503b690b188fffc5..02cac64e2495f285f08ebd52d4a0da03d3dabf6c 100644 (file)
@@ -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