Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d746d647 authored by Sam Ravnborg's avatar Sam Ravnborg
Browse files

x86: do not use $(ARCH) when not needed



For x86 ARCH may say i386 or x86_64 and soon x86.
Rely on CONFIG_X64_32 to select between 32/64 or just
hardcode the value as appropriate.

Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
parent 2a113281
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -197,8 +197,13 @@ CROSS_COMPILE ?=
UTS_MACHINE 	:= $(ARCH)
SRCARCH 	:= $(ARCH)

# for i386 and x86_64 we use SRCARCH equal to x86
SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH))
# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
        SRCARCH := x86
endif
ifeq ($(ARCH),x86_64)
        SRCARCH := x86
endif

KCONFIG_CONFIG	?= .config

+7 −3
Original line number Diff line number Diff line
# Unified Makefile for i386 and x86_64

# select defconfig based on actual architecture
ifeq ($(ARCH),x86)
        KBUILD_DEFCONFIG := i386_defconfig
else
        KBUILD_DEFCONFIG := $(ARCH)_defconfig
endif

# # No need to remake these files
# No need to remake these files
$(srctree)/arch/x86/Makefile%: ;

ifeq ($(ARCH),i386)
ifeq ($(CONFIG_X86_32),y)
        include $(srctree)/arch/x86/Makefile_32
else
        include $(srctree)/arch/x86/Makefile_64
+4 −4
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ archclean:
	$(Q)$(MAKE) $(clean)=arch/x86/boot

define archhelp
  echo  '* bzImage	- Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
  echo  '* bzImage	- Compressed kernel image (arch/x86/boot/bzImage)'
  echo  '  install	- Install kernel using'
  echo  '		   (your) ~/bin/installkernel or'
  echo  '		   (distribution) /sbin/installkernel or'
@@ -170,6 +170,6 @@ define archhelp
  echo  '  isoimage     - Create a boot CD-ROM image'
endef

CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
	       arch/$(ARCH)/boot/image.iso \
	       arch/$(ARCH)/boot/mtools.conf
CLEAN_FILES += arch/x86/boot/fdimage \
	       arch/x86/boot/image.iso \
	       arch/x86/boot/mtools.conf
+4 −4
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ archclean:
	$(Q)$(MAKE) $(clean)=$(boot)

define archhelp
  echo  '* bzImage	- Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
  echo  '* bzImage	- Compressed kernel image (arch/x86/boot/bzImage)'
  echo  '  install	- Install kernel using'
  echo  '		   (your) ~/bin/installkernel or'
  echo  '		   (distribution) /sbin/installkernel or'
@@ -137,8 +137,8 @@ define archhelp
  echo  '  isoimage     - Create a boot CD-ROM image'
endef

CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
	       arch/$(ARCH)/boot/image.iso \
	       arch/$(ARCH)/boot/mtools.conf
CLEAN_FILES += arch/x86/boot/fdimage \
	       arch/x86/boot/image.iso \
	       arch/x86/boot/mtools.conf

+3 −3
Original line number Diff line number Diff line
@@ -49,10 +49,10 @@ 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-i386   := 
cflags-x86_64 := -m32
cflags-$(CONFIG_X86_32) :=
cflags-$(CONFIG_X86_64) := -m32
KBUILD_CFLAGS	:= $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
		   $(cflags-$(ARCH)) \
		   $(cflags-y) \
		   -Wall -Wstrict-prototypes \
		   -march=i386 -mregparm=3 \
		   -include $(srctree)/$(src)/code16gcc.h \
Loading