From: Sam Ravnborg Date: Wed, 30 Jan 2008 12:32:23 +0000 (+0100) Subject: x86: biarch support for 32 bit builds beautified X-Git-Tag: v2.6.25-rc1~1143^2~451 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ba7e5cd499a72983e6d011e76c1d8fad896d310;p=linux-2.6 x86: biarch support for 32 bit builds beautified There were no reason to mess around with CC, AS and LD. Fixing this up avoided duplicated option for ld. A small fixlet were needed in boot/Makefile which assumed that CC were modified. Signed-off-by: Sam Ravnborg Cc: "H. Peter Anvin" Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 0c5b4072d1..bfe061de8e 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -15,18 +15,15 @@ export BITS ifeq ($(CONFIG_X86_32),y) BITS := 32 UTS_MACHINE := i386 + CHECKFLAGS += -D__i386__ - HAS_BIARCH := $(call cc-option-yn, -m32) - ifeq ($(HAS_BIARCH),y) - AS := $(AS) --32 - LD := $(LD) -m elf_i386 - CC := $(CC) -m32 - endif + biarch := $(call cc-option,-m32) + KBUILD_AFLAGS += $(biarch) + KBUILD_CFLAGS += $(biarch) ifdef CONFIG_RELOCATABLE LDFLAGS_vmlinux := --emit-relocs endif - CHECKFLAGS += -D__i386__ KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 7a3116ccf3..dcad6507f1 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -49,10 +49,7 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE) # 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. -cflags-$(CONFIG_X86_32) := -cflags-$(CONFIG_X86_64) := -m32 KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ - $(cflags-y) \ -Wall -Wstrict-prototypes \ -march=i386 -mregparm=3 \ -include $(srctree)/$(src)/code16gcc.h \ @@ -62,6 +59,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ $(call cc-option, -fno-unit-at-a-time)) \ $(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__ $(obj)/zImage: IMAGE_OFFSET := 0x1000