kbuild: Fix accidental revert in commit fe04ddf
[pandora-kernel.git] / arch / x86 / Makefile
index b0c5276..05afcca 100644 (file)
@@ -27,6 +27,10 @@ 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)
 
@@ -88,7 +92,7 @@ endif
 ifdef CONFIG_X86_X32
        x32_ld_ok := $(call try-run,\
                        /bin/echo -e '1: .quad 1b' | \
-                       $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" - && \
+                       $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" - && \
                        $(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMPO" && \
                        $(LD) -m elf32_x86_64 "$$TMPO" -o "$$TMP",y,n)
         ifeq ($(x32_ld_ok),y)
@@ -138,7 +142,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
 
-archscripts:
+archscripts: scripts_basic
        $(Q)$(MAKE) $(build)=arch/x86/tools relocs
 
 ###