Commit 4ba7e5cd authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Ingo Molnar

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: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 25dfeeb7
...@@ -15,18 +15,15 @@ export BITS ...@@ -15,18 +15,15 @@ export BITS
ifeq ($(CONFIG_X86_32),y) ifeq ($(CONFIG_X86_32),y)
BITS := 32 BITS := 32
UTS_MACHINE := i386 UTS_MACHINE := i386
CHECKFLAGS += -D__i386__
HAS_BIARCH := $(call cc-option-yn, -m32) biarch := $(call cc-option,-m32)
ifeq ($(HAS_BIARCH),y) KBUILD_AFLAGS += $(biarch)
AS := $(AS) --32 KBUILD_CFLAGS += $(biarch)
LD := $(LD) -m elf_i386
CC := $(CC) -m32
endif
ifdef CONFIG_RELOCATABLE ifdef CONFIG_RELOCATABLE
LDFLAGS_vmlinux := --emit-relocs LDFLAGS_vmlinux := --emit-relocs
endif endif
CHECKFLAGS += -D__i386__
KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
......
...@@ -49,10 +49,7 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE) ...@@ -49,10 +49,7 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE)
# How to compile the 16-bit code. Note we always compile for -march=i386, # 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. # 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__ \ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
$(cflags-y) \
-Wall -Wstrict-prototypes \ -Wall -Wstrict-prototypes \
-march=i386 -mregparm=3 \ -march=i386 -mregparm=3 \
-include $(srctree)/$(src)/code16gcc.h \ -include $(srctree)/$(src)/code16gcc.h \
...@@ -62,6 +59,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ ...@@ -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-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \ $(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2) $(call cc-option, -mpreferred-stack-boundary=2)
KBUILD_CFLAGS += $(call cc-option,-m32)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
$(obj)/zImage: IMAGE_OFFSET := 0x1000 $(obj)/zImage: IMAGE_OFFSET := 0x1000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment