aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-01-30 07:32:23 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:23 -0500
commit4ba7e5cd499a72983e6d011e76c1d8fad896d310 (patch)
treec6b92e1a5556e31f840cfff6d5b86f02421f04da /arch/x86
parent25dfeeb757bdf06521d65973676b21dac1d26d20 (diff)
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 <sam@ravnborg.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Makefile11
-rw-r--r--arch/x86/boot/Makefile4
2 files changed, 5 insertions, 10 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 0c5b4072d134..bfe061de8ed6 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -15,18 +15,15 @@ export BITS
15ifeq ($(CONFIG_X86_32),y) 15ifeq ($(CONFIG_X86_32),y)
16 BITS := 32 16 BITS := 32
17 UTS_MACHINE := i386 17 UTS_MACHINE := i386
18 CHECKFLAGS += -D__i386__
18 19
19 HAS_BIARCH := $(call cc-option-yn, -m32) 20 biarch := $(call cc-option,-m32)
20 ifeq ($(HAS_BIARCH),y) 21 KBUILD_AFLAGS += $(biarch)
21 AS := $(AS) --32 22 KBUILD_CFLAGS += $(biarch)
22 LD := $(LD) -m elf_i386
23 CC := $(CC) -m32
24 endif
25 23
26 ifdef CONFIG_RELOCATABLE 24 ifdef CONFIG_RELOCATABLE
27 LDFLAGS_vmlinux := --emit-relocs 25 LDFLAGS_vmlinux := --emit-relocs
28 endif 26 endif
29 CHECKFLAGS += -D__i386__
30 27
31 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return 28 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
32 29
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index 7a3116ccf387..dcad6507f196 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -49,10 +49,7 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE)
49 49
50# How to compile the 16-bit code. Note we always compile for -march=i386, 50# How to compile the 16-bit code. Note we always compile for -march=i386,
51# that way we can complain to the user if the CPU is insufficient. 51# that way we can complain to the user if the CPU is insufficient.
52cflags-$(CONFIG_X86_32) :=
53cflags-$(CONFIG_X86_64) := -m32
54KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ 52KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
55 $(cflags-y) \
56 -Wall -Wstrict-prototypes \ 53 -Wall -Wstrict-prototypes \
57 -march=i386 -mregparm=3 \ 54 -march=i386 -mregparm=3 \
58 -include $(srctree)/$(src)/code16gcc.h \ 55 -include $(srctree)/$(src)/code16gcc.h \
@@ -62,6 +59,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
62 $(call cc-option, -fno-unit-at-a-time)) \ 59 $(call cc-option, -fno-unit-at-a-time)) \
63 $(call cc-option, -fno-stack-protector) \ 60 $(call cc-option, -fno-stack-protector) \
64 $(call cc-option, -mpreferred-stack-boundary=2) 61 $(call cc-option, -mpreferred-stack-boundary=2)
62KBUILD_CFLAGS += $(call cc-option,-m32)
65KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ 63KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
66 64
67$(obj)/zImage: IMAGE_OFFSET := 0x1000 65$(obj)/zImage: IMAGE_OFFSET := 0x1000