Skip to contentSkip to conversation

x86/build change for v3.6

GIT PULL Ingo Molnar 4 participants 8 messages Jul 22, 2012 – Jul 29, 2012

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-build-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-build-for-linus

HEAD: d9b0cde91c60da0ed5f92cdc3ac878142e6b5f27 x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

Thanks,

Ingo

------------------>
H.J. Lu (1):
x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

 arch/x86/Makefile |    3 +++
 1 file changed, 3 insertions(+)
arch/x86/Makefile +3 -0
index 1f25214..b0c5276 100644
@@ -49,6 +49,9 @@ else
         KBUILD_AFLAGS += -m64
         KBUILD_CFLAGS += -m64
 
+	# Use -mpreferred-stack-boundary=3 if supported.
+	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
+
         # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
         cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
         cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
#1 lore raw
Quoted 25 lines · Ingo Molnar

Linus,

Please pull the latest x86-build-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-build-for-linus

HEAD: d9b0cde91c60da0ed5f92cdc3ac878142e6b5f27 x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

Thanks,

Ingo

------------------>
H.J. Lu (1):
x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

 arch/x86/Makefile |    3 +++
 1 file changed, 3 insertions(+)
arch/x86/Makefile +0 -0
index 1f25214..b0c5276 100644

arch/x86/Makefile else · line 54

Quoted 6 lines
arch/x86/Makefile +3 -0
@@ -49,6 +49,9 @@ else
         KBUILD_AFLAGS += -m64
         KBUILD_CFLAGS += -m64
 
+	# Use -mpreferred-stack-boundary=3 if supported.
+	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
+

Broken indent?

Quoted 8 lines
arch/x86/Makefile +0 -1
         # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
         cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
         cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 1 line
 Kirill A. Shutemov
#2 lore raw
Quoted 29 lines · Kirill A. Shutemov
Quoted 28 lines · Ingo Molnar

Linus,

Please pull the latest x86-build-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-build-for-linus

HEAD: d9b0cde91c60da0ed5f92cdc3ac878142e6b5f27 x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

Thanks,

Ingo

------------------>
H.J. Lu (1):
x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

 arch/x86/Makefile |    3 +++
 1 file changed, 3 insertions(+)
arch/x86/Makefile +0 -0
index 1f25214..b0c5276 100644
@@ -49,6 +49,9 @@ else
         KBUILD_AFLAGS += -m64
         KBUILD_CFLAGS += -m64
 
Quoted 5 lines

arch/x86/Makefile else · line 54

Quoted 3 lines
arch/x86/Makefile +3 -0
+	# Use -mpreferred-stack-boundary=3 if supported.
+	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
+

Broken indent?

No, the reason for the odd looking diff is that lots of lines in arch/x86/Makefile have 8-space tabs for histerical reasons but new code (such as this one) has proper tabs.

Wanna send a (tested) cleanup patch to make it all look tidy?

Thanks,

Ingo

#3 lore raw
Quoted 38 lines · Ingo Molnar
Quoted 29 lines · Kirill A. Shutemov
Quoted 28 lines · Ingo Molnar

Linus,

Please pull the latest x86-build-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-build-for-linus

HEAD: d9b0cde91c60da0ed5f92cdc3ac878142e6b5f27 x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

Thanks,

Ingo

------------------>
H.J. Lu (1):
x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported

 arch/x86/Makefile |    3 +++
 1 file changed, 3 insertions(+)
arch/x86/Makefile +0 -0
index 1f25214..b0c5276 100644
@@ -49,6 +49,9 @@ else
         KBUILD_AFLAGS += -m64
         KBUILD_CFLAGS += -m64
 
Quoted 5 lines

arch/x86/Makefile else · line 54

Quoted 3 lines
arch/x86/Makefile +3 -0
+	# Use -mpreferred-stack-boundary=3 if supported.
+	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
+

Broken indent?

Quoted 7 lines

No, the reason for the odd looking diff is that lots of lines in arch/x86/Makefile have 8-space tabs for histerical reasons but new code (such as this one) has proper tabs.

Wanna send a (tested) cleanup patch to make it all look tidy?

From 1b5d73179f8fe26480c57a8f069300fe56304756 Mon Sep 17 00:00:00 2001

From: "Kirill A. Shutemov" <[email protected]>
Date: Mon, 23 Jul 2012 12:30:24 +0300
Subject: [PATCH] x86: whitespace cleanup in makefiles

Buildtested: defconfig, allnoconfig, allmodconfig, allyesconfig for both 32- and 64-bit.

---
 arch/x86/Makefile                   | 124 ++++++++++++++++++------------------
 arch/x86/Makefile.um                |   2 +-
 arch/x86/Makefile_32.cpu            |   2 +-
 arch/x86/boot/Makefile              |  20 +++---
 arch/x86/crypto/Makefile            |  74 ++++++++++-----------
 arch/x86/ia32/Makefile              |  10 +--
 arch/x86/kernel/Makefile            |  14 ++--
 arch/x86/kernel/cpu/mcheck/Makefile |   2 +-
 arch/x86/lib/Makefile               |  26 ++++----
 arch/x86/math-emu/Makefile          |   2 +-
 arch/x86/oprofile/Makefile          |   2 +-
 arch/x86/pci/Makefile               |   4 +-
 arch/x86/platform/efi/Makefile      |   2 +-
 arch/x86/platform/olpc/Makefile     |   2 +-
 arch/x86/realmode/Makefile          |   6 +-
 arch/x86/realmode/rm/Makefile       |   2 +-
 arch/x86/tools/Makefile             |   8 +--
 arch/x86/um/os-Linux/Makefile       |   4 +-
 arch/x86/um/vdso/Makefile           |  16 ++---
 arch/x86/vdso/Makefile              |  12 ++--
 arch/x86/video/Makefile             |   2 +-
 arch/x86/xen/Makefile               |   2 +-
 22 files changed, 169 insertions(+), 169 deletions(-)
arch/x86/Makefile +62 -62
index b0c5276..c6897b2 100644
@@ -2,9 +2,9 @@
 
 # select defconfig based on actual architecture
 ifeq ($(ARCH),x86)
-        KBUILD_DEFCONFIG := i386_defconfig
+	KBUILD_DEFCONFIG := i386_defconfig
 else
-        KBUILD_DEFCONFIG := $(ARCH)_defconfig
+	KBUILD_DEFCONFIG := $(ARCH)_defconfig
 endif
 
 # BITS is used as extension for files which are available in a 32 bit
@@ -13,76 +13,76 @@ endif
 export BITS
 
 ifeq ($(CONFIG_X86_32),y)
-        BITS := 32
-        UTS_MACHINE := i386
-        CHECKFLAGS += -D__i386__
+	BITS := 32
+	UTS_MACHINE := i386
+	CHECKFLAGS += -D__i386__
 
-        biarch := $(call cc-option,-m32)
-        KBUILD_AFLAGS += $(biarch)
-        KBUILD_CFLAGS += $(biarch)
+	biarch := $(call cc-option,-m32)
+	KBUILD_AFLAGS += $(biarch)
+	KBUILD_CFLAGS += $(biarch)
 
-        ifdef CONFIG_RELOCATABLE
-                LDFLAGS_vmlinux := --emit-relocs
-        endif
+	ifdef CONFIG_RELOCATABLE
+		LDFLAGS_vmlinux := --emit-relocs
+	endif
 
-        KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
+	KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
 
-        # prevent gcc from keeping the stack 16 byte aligned
-        KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
+	# prevent gcc from keeping the stack 16 byte aligned
+	KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
 
-        # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
-        # a lot more stack due to the lack of sharing of stacklots:
-        KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0400, \
+	# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
+	# a lot more stack due to the lack of sharing of stacklots:
+	KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0400, \
 				$(call cc-option,-fno-unit-at-a-time))
 
-        # CPU-specific tuning. Anything which can be shared with UML should go here.
-        include $(srctree)/arch/x86/Makefile_32.cpu
-        KBUILD_CFLAGS += $(cflags-y)
+	# CPU-specific tuning. Anything which can be shared with UML should go here.
+	include $(srctree)/arch/x86/Makefile_32.cpu
+	KBUILD_CFLAGS += $(cflags-y)
 
-        # temporary until string.h is fixed
-        KBUILD_CFLAGS += -ffreestanding
+	# temporary until string.h is fixed
+	KBUILD_CFLAGS += -ffreestanding
 else
-        BITS := 64
-        UTS_MACHINE := x86_64
-        CHECKFLAGS += -D__x86_64__ -m64
+	BITS := 64
+	UTS_MACHINE := x86_64
+	CHECKFLAGS += -D__x86_64__ -m64
 
-        KBUILD_AFLAGS += -m64
-        KBUILD_CFLAGS += -m64
+	KBUILD_AFLAGS += -m64
+	KBUILD_CFLAGS += -m64
 
 	# Use -mpreferred-stack-boundary=3 if supported.
 	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
 
-        # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
-        cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
-        cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
+	# FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
+	cflags-$(CONFIG_MK8)	+= $(call cc-option,-march=k8)
+	cflags-$(CONFIG_MPSC)	+= $(call cc-option,-march=nocona)
 
-        cflags-$(CONFIG_MCORE2) += \
-                $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
-	cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
+	cflags-$(CONFIG_MCORE2)	+= \
+		$(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
+	cflags-$(CONFIG_MATOM)	+= $(call cc-option,-march=atom) \
 		$(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
-        cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
-        KBUILD_CFLAGS += $(cflags-y)
+	cflags-$(CONFIG_GENERIC_CPU)	+= $(call cc-option,-mtune=generic)
+	KBUILD_CFLAGS += $(cflags-y)
 
-        KBUILD_CFLAGS += -mno-red-zone
-        KBUILD_CFLAGS += -mcmodel=kernel
+	KBUILD_CFLAGS += -mno-red-zone
+	KBUILD_CFLAGS += -mcmodel=kernel
 
-        # -funit-at-a-time shrinks the kernel .text considerably
-        # unfortunately it makes reading oopses harder.
-        KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
+	# -funit-at-a-time shrinks the kernel .text considerably
+	# unfortunately it makes reading oopses harder.
+	KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
 
-        # this works around some issues with generating unwind tables in older gccs
-        # newer gccs do it by default
-        KBUILD_CFLAGS += -maccumulate-outgoing-args
+	# this works around some issues with generating unwind tables in older gccs
+	# newer gccs do it by default
+	KBUILD_CFLAGS += -maccumulate-outgoing-args
 endif
 
 ifdef CONFIG_CC_STACKPROTECTOR
 	cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
-        ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(KBUILD_CPPFLAGS) $(biarch)),y)
-                stackp-y := -fstack-protector
-                KBUILD_CFLAGS += $(stackp-y)
-        else
-                $(warning stack protector enabled but no compiler support)
-        endif
+	ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(KBUILD_CPPFLAGS) $(biarch)),y)
+		stackp-y := -fstack-protector
+		KBUILD_CFLAGS += $(stackp-y)
+	else
+		$(warning stack protector enabled but no compiler support)
+	endif
 endif
 
 ifdef CONFIG_X86_X32
@@ -91,13 +91,13 @@ ifdef CONFIG_X86_X32
 			$(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" - && \
 			$(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMPO" && \
 			$(LD) -m elf32_x86_64 "$$TMPO" -o "$$TMP",y,n)
-        ifeq ($(x32_ld_ok),y)
-                CONFIG_X86_X32_ABI := y
-                KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
-                KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
-        else
-                $(warning CONFIG_X86_X32 enabled but no binutils support)
-        endif
+	ifeq ($(x32_ld_ok),y)
+		CONFIG_X86_X32_ABI := y
+		KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
+		KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
+	else
+		$(warning CONFIG_X86_X32 enabled but no binutils support)
+	endif
 endif
 export CONFIG_X86_X32_ABI
 
@@ -154,22 +154,22 @@ head-y := arch/x86/kernel/head_$(BITS).o
 head-y += arch/x86/kernel/head$(BITS).o
 head-y += arch/x86/kernel/head.o
 
-libs-y  += arch/x86/lib/
+libs-y += arch/x86/lib/
 
 # See arch/x86/Kbuild for content of core part of the kernel
 core-y += arch/x86/
 
 # drivers-y are linked after core-y
-drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
-drivers-$(CONFIG_PCI)            += arch/x86/pci/
+drivers-$(CONFIG_MATH_EMULATION)	+= arch/x86/math-emu/
+drivers-$(CONFIG_PCI)			+= arch/x86/pci/
 
 # must be linked after kernel/
-drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
+drivers-$(CONFIG_OPROFILE)	+= arch/x86/oprofile/
 
 # suspend and hibernation support
-drivers-$(CONFIG_PM) += arch/x86/power/
+drivers-$(CONFIG_PM)	+= arch/x86/power/
 
-drivers-$(CONFIG_FB) += arch/x86/video/
+drivers-$(CONFIG_FB)	+= arch/x86/video/
 
 ####
 # boot loader support. Several targets are kept for legacy purposes
arch/x86/Makefile.um +1 -1
index 36b62bc..586f4b0 100644
@@ -5,7 +5,7 @@ START := 0x8048000
 
 LDFLAGS			+= -m elf_i386
 ELF_ARCH		:= i386
-ELF_FORMAT 		:= elf32-i386
+ELF_FORMAT		:= elf32-i386
 CHECKFLAGS	+= -D__i386__
 
 KBUILD_CFLAGS		+= $(call cc-option,-m32)
arch/x86/Makefile_32.cpu +1 -1
index 86cee7b..5afa477 100644
@@ -44,7 +44,7 @@ cflags-$(CONFIG_MGEODEGX1)	+= -march=pentium-mmx
 cflags-$(CONFIG_MGEODE_LX)	+= $(call cc-option,-march=geode,-march=pentium-mmx)
 # add at the end to overwrite eventual tuning options from earlier
 # cpu entries
-cflags-$(CONFIG_X86_GENERIC) 	+= $(call tune,generic,$(call tune,i686))
+cflags-$(CONFIG_X86_GENERIC)	+= $(call tune,generic,$(call tune,i686))
 
 # Work around the pentium-mmx code generator madness of gcc4.4.x which
 # does stack alignment by generating horrible code _before_ the mcount
arch/x86/boot/Makefile +10 -10
index 5a747dd..debb43a 100644
@@ -38,7 +38,7 @@ targets		+= $(setup-y)
 hostprogs-y	:= mkcpustr tools/build
 
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include $(LINUXINCLUDE) \
-	            -D__EXPORTED_HEADERS__
+			-D__EXPORTED_HEADERS__
 
 $(obj)/cpu.o: $(obj)/cpustr.h
 
@@ -53,16 +53,16 @@ $(obj)/cpustr.h: $(obj)/mkcpustr FORCE
 # How to compile the 16-bit code.  Note we always compile for -march=i386,
 # that way we can complain to the user if the CPU is insufficient.
 KBUILD_CFLAGS	:= $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
-		   -DDISABLE_BRANCH_PROFILING \
-		   -Wall -Wstrict-prototypes \
-		   -march=i386 -mregparm=3 \
-		   -include $(srctree)/$(src)/code16gcc.h \
-		   -fno-strict-aliasing -fomit-frame-pointer \
-		   $(call cc-option, -ffreestanding) \
-		   $(call cc-option, -fno-toplevel-reorder,\
+			-DDISABLE_BRANCH_PROFILING \
+			-Wall -Wstrict-prototypes \
+			-march=i386 -mregparm=3 \
+			-include $(srctree)/$(src)/code16gcc.h \
+			-fno-strict-aliasing -fomit-frame-pointer \
+			$(call cc-option, -ffreestanding) \
+			$(call cc-option, -fno-toplevel-reorder,\
 			$(call cc-option, -fno-unit-at-a-time)) \
-		   $(call cc-option, -fno-stack-protector) \
-		   $(call cc-option, -mpreferred-stack-boundary=2)
+			$(call cc-option, -fno-stack-protector) \
+			$(call cc-option, -mpreferred-stack-boundary=2)
 KBUILD_CFLAGS	+= $(call cc-option, -m32)
 KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
 GCOV_PROFILE := n
arch/x86/crypto/Makefile +37 -37

81 lines not on this page · raw message

arch/x86/ia32/Makefile +5 -5
index 455646e..8357fd4 100644
@@ -5,10 +5,10 @@
 obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o
 obj-$(CONFIG_IA32_EMULATION) += nosyscall.o syscall_ia32.o
 
-sysv-$(CONFIG_SYSVIPC) := ipc32.o
-obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
+sysv-$(CONFIG_SYSVIPC)		:= ipc32.o
+obj-$(CONFIG_IA32_EMULATION)	+= $(sysv-y)
 
-obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
+obj-$(CONFIG_IA32_AOUT)		+= ia32_aout.o
 
-audit-class-$(CONFIG_AUDIT) := audit.o
-obj-$(CONFIG_IA32_EMULATION) += $(audit-class-y)
+audit-class-$(CONFIG_AUDIT)	:= audit.o
+obj-$(CONFIG_IA32_EMULATION)	+= $(audit-class-y)
arch/x86/kernel/Makefile +7 -7
index 8215e56..18fa410 100644
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-extra-y                := head_$(BITS).o head$(BITS).o head.o vmlinux.lds
+extra-y := head_$(BITS).o head$(BITS).o head.o vmlinux.lds
 
 CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
 
@@ -21,7 +21,7 @@ obj-y			:= process_$(BITS).o signal.o entry_$(BITS).o
 obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y			+= time.o ioport.o ldt.o dumpstack.o nmi.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o jump_label.o
-obj-$(CONFIG_IRQ_WORK)  += irq_work.o
+obj-$(CONFIG_IRQ_WORK)	+= irq_work.o
 obj-y			+= probe_roms.o
 obj-$(CONFIG_X86_32)	+= sys_i386_32.o i386_ksyms_32.o
 obj-$(CONFIG_X86_64)	+= sys_x86_64.o x8664_ksyms_64.o
@@ -76,10 +76,10 @@ obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
 obj-$(CONFIG_APB_TIMER)		+= apb_timer.o
 
-obj-$(CONFIG_AMD_NB)		+= amd_nb.o
-obj-$(CONFIG_DEBUG_RODATA_TEST)	+= test_rodata.o
-obj-$(CONFIG_DEBUG_NX_TEST)	+= test_nx.o
-obj-$(CONFIG_DEBUG_NMI_SELFTEST) += nmi_selftest.o
+obj-$(CONFIG_AMD_NB)			+= amd_nb.o
+obj-$(CONFIG_DEBUG_RODATA_TEST)		+= test_rodata.o
+obj-$(CONFIG_DEBUG_NX_TEST)		+= test_nx.o
+obj-$(CONFIG_DEBUG_NMI_SELFTEST)	+= nmi_selftest.o
 
 obj-$(CONFIG_KVM_GUEST)		+= kvm.o
 obj-$(CONFIG_KVM_CLOCK)		+= kvmclock.o
@@ -94,7 +94,7 @@ microcode-$(CONFIG_MICROCODE_INTEL)	+= microcode_intel.o
 microcode-$(CONFIG_MICROCODE_AMD)	+= microcode_amd.o
 obj-$(CONFIG_MICROCODE)			+= microcode.o
 
-obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
+obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION)	+= check.o
 
 obj-$(CONFIG_SWIOTLB)			+= pci-swiotlb.o
 obj-$(CONFIG_OF)			+= devicetree.o
arch/x86/kernel/cpu/mcheck/Makefile +1 -1
index bb34b03..c8dc62c 100644
@@ -3,7 +3,7 @@ obj-y				=  mce.o mce-severity.o
 obj-$(CONFIG_X86_ANCIENT_MCE)	+= winchip.o p5.o
 obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o
-obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
+obj-$(CONFIG_X86_MCE_THRESHOLD)	+= threshold.o
 obj-$(CONFIG_X86_MCE_INJECT)	+= mce-inject.o
 
 obj-$(CONFIG_X86_THERMAL_VECTOR) += therm_throt.o
arch/x86/lib/Makefile +13 -13
index b00f678..3591f40 100644
@@ -27,21 +27,21 @@ lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o
 obj-y += msr.o msr-reg.o msr-reg-export.o
 
 ifeq ($(CONFIG_X86_32),y)
-        obj-y += atomic64_32.o
-        lib-y += atomic64_cx8_32.o
-        lib-y += checksum_32.o
-        lib-y += strstr_32.o
-        lib-y += string_32.o
-        lib-y += cmpxchg.o
+	obj-y += atomic64_32.o
+	lib-y += atomic64_cx8_32.o
+	lib-y += checksum_32.o
+	lib-y += strstr_32.o
+	lib-y += string_32.o
+	lib-y += cmpxchg.o
 ifneq ($(CONFIG_X86_CMPXCHG64),y)
-        lib-y += cmpxchg8b_emu.o atomic64_386_32.o
+	lib-y += cmpxchg8b_emu.o atomic64_386_32.o
 endif
-        lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
+	lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
-        obj-y += iomap_copy_64.o
-        lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
-        lib-y += thunk_64.o clear_page_64.o copy_page_64.o
-        lib-y += memmove_64.o memset_64.o
-        lib-y += copy_user_64.o copy_user_nocache_64.o
+	obj-y += iomap_copy_64.o
+	lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
+	lib-y += thunk_64.o clear_page_64.o copy_page_64.o
+	lib-y += memmove_64.o memset_64.o
+	lib-y += copy_user_64.o copy_user_nocache_64.o
 	lib-y += cmpxchg16b_emu.o
 endif
arch/x86/math-emu/Makefile +1 -1
index 9b0c63b..b66a055 100644
@@ -1,5 +1,5 @@
 #
-#               Makefile for wm-FPU-emu
+#		Makefile for wm-FPU-emu
 #
 
 #DEBUG	= -DDEBUGGING
arch/x86/oprofile/Makefile +1 -1
index 1599f56..871d7fb 100644
@@ -7,5 +7,5 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 		timer_int.o nmi_timer_int.o )
 
 oprofile-y				:= $(DRIVER_OBJS) init.o backtrace.o
-oprofile-$(CONFIG_X86_LOCAL_APIC) 	+= nmi_int.o op_model_amd.o \
+oprofile-$(CONFIG_X86_LOCAL_APIC)	+= nmi_int.o op_model_amd.o \
 					   op_model_ppro.o op_model_p4.o
arch/x86/pci/Makefile +2 -2
index 3af5a1e..18ae3da 100644
@@ -7,11 +7,11 @@ obj-$(CONFIG_PCI_OLPC)		+= olpc.o
 obj-$(CONFIG_PCI_XEN)		+= xen.o
 
 obj-y				+= fixup.o
-obj-$(CONFIG_X86_INTEL_CE)      += ce4100.o
+obj-$(CONFIG_X86_INTEL_CE)	+= ce4100.o
 obj-$(CONFIG_ACPI)		+= acpi.o
 obj-y				+= legacy.o irq.o
 
-obj-$(CONFIG_STA2X11)           += sta2x11-fixup.o
+obj-$(CONFIG_STA2X11)		+= sta2x11-fixup.o
 
 obj-$(CONFIG_X86_VISWS)		+= visws.o
 
arch/x86/platform/efi/Makefile +1 -1
index 73b8be0..709de1f 100644
@@ -1 +1 @@
-obj-$(CONFIG_EFI) 		+= efi.o efi_$(BITS).o efi_stub_$(BITS).o
+obj-$(CONFIG_EFI)		+= efi.o efi_$(BITS).o efi_stub_$(BITS).o
arch/x86/platform/olpc/Makefile +1 -1
index fd332c5..bb26fdc 100644
@@ -1,5 +1,5 @@
 obj-$(CONFIG_OLPC)		+= olpc.o olpc_ofw.o olpc_dt.o
-obj-$(CONFIG_OLPC_XO1_PM)		+= olpc-xo1-pm.o xo1-wakeup.o
+obj-$(CONFIG_OLPC_XO1_PM)	+= olpc-xo1-pm.o xo1-wakeup.o
 obj-$(CONFIG_OLPC_XO1_RTC)	+= olpc-xo1-rtc.o
 obj-$(CONFIG_OLPC_XO1_SCI)	+= olpc-xo1-sci.o
 obj-$(CONFIG_OLPC_XO15_SCI)	+= olpc-xo15-sci.o
arch/x86/realmode/Makefile +3 -3
index 94f7fbe..6eb6b0c 100644
@@ -7,10 +7,10 @@
 #
 #
 
-subdir- := rm
+subdir-	:= rm
 
-obj-y += init.o
-obj-y += rmpiggy.o
+obj-y	+= init.o
+obj-y	+= rmpiggy.o
 
 $(obj)/rmpiggy.o: $(obj)/rm/realmode.bin
 
arch/x86/realmode/rm/Makefile +1 -1
index 5b84a2d..ee67afb 100644
@@ -79,4 +79,4 @@ KBUILD_CFLAGS	:= $(LINUXINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ -D_WAKEUP \
 		   $(call cc-option, -fno-stack-protector) \
 		   $(call cc-option, -mpreferred-stack-boundary=2)
 KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
-GCOV_PROFILE := n
+GCOV_PROFILE	:= n
arch/x86/tools/Makefile +4 -4
index 733057b..d559bf8 100644
@@ -1,15 +1,15 @@
 PHONY += posttest
 
 ifeq ($(KBUILD_VERBOSE),1)
-  posttest_verbose = -v
+	posttest_verbose = -v
 else
-  posttest_verbose =
+	posttest_verbose =
 endif
 
 ifeq ($(CONFIG_64BIT),y)
-  posttest_64bit = -y
+	posttest_64bit = -y
 else
-  posttest_64bit = -n
+	posttest_64bit = -n
 endif
 
 distill_awk = $(srctree)/arch/x86/tools/distill.awk
arch/x86/um/os-Linux/Makefile +2 -2
index 253bfb8..97beee9 100644
@@ -5,8 +5,8 @@
 
 obj-y = registers.o task_size.o mcontext.o
 
-obj-$(CONFIG_X86_32) += tls.o
-obj-$(CONFIG_64BIT) += prctl.o
+obj-$(CONFIG_X86_32)	+= tls.o
+obj-$(CONFIG_64BIT)	+= prctl.o
 
 USER_OBJS := $(obj-y)
 
arch/x86/um/vdso/Makefile +8 -8
index 6c803ca..38c0c2c 100644
@@ -22,7 +22,7 @@ targets += vdso.so vdso.so.dbg vdso.lds $(vobjs-y)
 export CPPFLAGS_vdso.lds += -P -C
 
 VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
-       -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
+	-Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
 
 $(obj)/vdso.o: $(src)/vdso.S $(obj)/vdso.so
 
@@ -38,8 +38,8 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 # optimize sibling calls.
 #
 CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
-       $(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
-       -fno-omit-frame-pointer -foptimize-sibling-calls
+	$(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
+	-fno-omit-frame-pointer -foptimize-sibling-calls
 
 $(vobjs): KBUILD_CFLAGS += $(CFL)
 
@@ -49,8 +49,8 @@ $(vobjs): KBUILD_CFLAGS += $(CFL)
 CFLAGS_REMOVE_vdso-note.o = -pg -fprofile-arcs -ftest-coverage
 CFLAGS_REMOVE_um_vdso.o = -pg -fprofile-arcs -ftest-coverage
 
-targets += vdso-syms.lds
-obj-$(VDSO64-y)			+= vdso-syms.lds
+targets		+= vdso-syms.lds
+obj-$(VDSO64-y)	+= vdso-syms.lds
 
 #
 # Match symbols in the DSO that look like VDSO*; produce a file of constants.
@@ -70,9 +70,9 @@ $(obj)/%-syms.lds: $(obj)/%.so.dbg FORCE
 #
 quiet_cmd_vdso = VDSO    $@
       cmd_vdso = $(CC) -nostdlib -o $@ \
-		       $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-		       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
-		 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
+		$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
+		-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
+		sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
 
 VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
 GCOV_PROFILE := n
arch/x86/vdso/Makefile +6 -6
index fd14be1..8a301bc 100644
@@ -35,7 +35,7 @@ export CPPFLAGS_vdso.lds += -P -C
 
 VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
 			-Wl,--no-undefined \
-		      	-Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
+			-Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
 
 $(obj)/vdso.o: $(src)/vdso.S $(obj)/vdso.so
 
@@ -51,8 +51,8 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 # optimize sibling calls.
 #
 CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
-       $(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
-       -fno-omit-frame-pointer -foptimize-sibling-calls
+	$(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
+	-fno-omit-frame-pointer -foptimize-sibling-calls
 
 $(vobjs): KBUILD_CFLAGS += $(CFL)
 
@@ -133,9 +133,9 @@ VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-soname=linux-gate.so.1
 # is not a kbuild sub-make subdirectory.
 override obj-dirs = $(dir $(obj)) $(obj)/vdso32/
 
-targets += vdso32/vdso32.lds
-targets += $(vdso32-images) $(vdso32-images:=.dbg)
-targets += vdso32/note.o $(vdso32.so-y:%=vdso32/%.o)
+targets	+= vdso32/vdso32.lds
+targets	+= $(vdso32-images) $(vdso32-images:=.dbg)
+targets	+= vdso32/note.o $(vdso32.so-y:%=vdso32/%.o)
 
 extra-y	+= $(vdso32-images)
 
arch/x86/video/Makefile +1 -1
index 2c447c9..0d63a4a 100644
@@ -1 +1 @@
-obj-$(CONFIG_FB)               += fbdev.o
+obj-$(CONFIG_FB)	+= fbdev.o
arch/x86/xen/Makefile +1 -1
index 96ab2c0..f1333c3 100644
@@ -15,7 +15,7 @@ obj-y		:= enlighten.o setup.o multicalls.o mmu.o irq.o \
 			grant-table.o suspend.o platform-pci-unplug.o \
 			p2m.o
 
-obj-$(CONFIG_EVENT_TRACING) += trace.o
+obj-$(CONFIG_EVENT_TRACING)	+= trace.o
 
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
Signature · 1 line
 Kirill A. Shutemov
#4 lore raw
In reply to Ingo Molnar
Quoted 4 lines

No, the reason for the odd looking diff is that lots of lines in arch/x86/Makefile have 8-space tabs for histerical reasons but new code (such as this one) has proper tabs.

Use of tabs for indent in a Makefile is just asking for trouble. Consider following simple Makefile:

$ cat Makefile
bar:
#bla bla
        foo = war

love:

	@echo make love, not $(foo)

If you execute:
$make love
make love, not war

But if you replace the 8 spaces in front of the assignment with a tab then suddenly the output looks like this:
$make love
make love, not

This is not as expected....
In this silly example it is maybe obvious but I have lost hours tracking down bugs due to this.
You add a new target and suddenly someting unrelated breaks.

What happens is that make consider the assignment a command due to the leading tab - and because is follows a target (or other commands).

I hope this makes it clear why many makefiles in the kernel uses tabs for indent.

Sam

#5 lore raw
Quoted 11 lines · Sam Ravnborg

This is not as expected....
In this silly example it is maybe obvious but I have lost hours tracking down bugs due to this.
You add a new target and suddenly someting unrelated breaks.

What happens is that make consider the assignment a command due to the leading tab - and because is follows a target (or other commands).

I hope this makes it clear why many makefiles in the kernel uses tabs for indent.

This is also a good reason why not to indent assignments in Makefiles by full tab stops. A smaller indent can't be scrambled this way.

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#6 lore raw
In reply to Sam Ravnborg
Quoted 7 lines · Sam Ravnborg
Quoted 4 lines

No, the reason for the odd looking diff is that lots of lines in arch/x86/Makefile have 8-space tabs for histerical reasons but new code (such as this one) has proper tabs.

Use of tabs for indent in a Makefile is just asking for trouble.

Ok, I guess you are right - see the patch below which was another type of bug that could be introduced via not using spaces properly.

We could do it the other way around: turn all tabs into spaces and add Makefile checking in kbuild so that the build fails if a tab is added to a Makefile?

Alternatively, is there perhaps some way to teach make to not be so broken to depend on whitespace details that are *invisible* to humans?

Thanks,

Ingo

arch/x86/Makefile +1 -1
Index: linux/arch/x86/Makefile
===================================================================
@@ -96,7 +96,7 @@ ifdef CONFIG_X86_X32
 		KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
 		KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
 	else
-		$(warning CONFIG_X86_X32 enabled but no binutils support)
+ 		$(warning CONFIG_X86_X32 enabled but no binutils support)
 	endif
 endif
 export CONFIG_X86_X32_ABI
#7 lore raw
Quoted 15 lines · Ingo Molnar
Quoted 7 lines · Sam Ravnborg
Quoted 4 lines

No, the reason for the odd looking diff is that lots of lines in arch/x86/Makefile have 8-space tabs for histerical reasons but new code (such as this one) has proper tabs.

Use of tabs for indent in a Makefile is just asking for trouble.

Ok, I guess you are right - see the patch below which was another type of bug that could be introduced via not using spaces properly.

Quoted 7 lines

We could do it the other way around: turn all tabs into spaces and add Makefile checking in kbuild so that the build fails if a tab is added to a Makefile?

Alternatively, is there perhaps some way to teach make to not be so broken to depend on whitespace details that are *invisible* to humans?

We can teach make to use something else - say "€" - as the command idicator. But that would confuse people a lot.

If we follow hpa's suggestion to use 4 spaces as indent then it more obvious that we do not use tabs for indent.
For that matter we could consider 3 spaces - so two indents is not the same as one tab.

If we one day use a tool for parsing up all the kbuild files then we could always add checks in that tool.
but today make does not allow us to do so.

At least not that I know.

Sam