Skip to contentSkip to conversation

x86, build: Set -fno-pic for 32/64-bit kernels

PATCH Superseded Carlos Santa 1 participant 2 messages Aug 19, 2016 x86

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, build: Set -fno-pic for 32/64-bit kernels

Make the -fno-pic compiler flag common for both 32 and 64 bit kernels. The GCC toolchain in Android still enables -fpic by default causing the build to break.

---
 arch/x86/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/Makefile +4 -4
index 830ed39..17af5e1 100644
@@ -49,6 +49,10 @@ endif
 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
 KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 
+# Never want PIC in both 32/64-bit kernel, prevent breakage with GCC built
+# with nonstandard options
+KBUILD_CFLAGS += -fno-pic
+
 ifeq ($(CONFIG_X86_32),y)
         BITS := 32
         UTS_MACHINE := i386
@@ -60,10 +64,6 @@ ifeq ($(CONFIG_X86_32),y)
 
         KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
 
-        # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
-        # with nonstandard options
-        KBUILD_CFLAGS += -fno-pic
-
         # prevent gcc from keeping the stack 16 byte aligned
         KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 5 lines · Carlos Santa

Make the -fno-pic compiler flag common for both 32 and 64 bit kernels. The GCC toolchain in Android still enables -fpic by default causing the build to break.

Wrong version, please disregard this patch.

Quoted 20 lines
---
 arch/x86/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/Makefile +4 -0
index 830ed39..17af5e1 100644
@@ -49,6 +49,10 @@ endif
 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
 KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 
+# Never want PIC in both 32/64-bit kernel, prevent breakage with GCC built
+# with nonstandard options
+KBUILD_CFLAGS += -fno-pic
+
 ifeq ($(CONFIG_X86_32),y)
         BITS := 32
         UTS_MACHINE := i386

arch/x86/Makefile ifeq ($(CONFIG_X86_32),y) · line 69

Quoted 10 lines
arch/x86/Makefile +0 -4
@@ -60,10 +64,6 @@ ifeq ($(CONFIG_X86_32),y)
 
         KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
 
-        # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
-        # with nonstandard options
-        KBUILD_CFLAGS += -fno-pic
-
         # prevent gcc from keeping the stack 16 byte aligned
         KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
 

thanks,
Carlos Santa
Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx