diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2007-11-12 14:14:19 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2007-11-12 15:02:20 -0500 |
commit | d746d647f31bd3664f4a23985b78654129ffc1db (patch) | |
tree | 6caa461f889220551adb460e2f74b00d51c0e076 /arch/x86 | |
parent | 2a113281f5cd2febbab21a93c8943f8d3eece4d3 (diff) |
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: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/Makefile | 10 | ||||
-rw-r--r-- | arch/x86/Makefile_32 | 8 | ||||
-rw-r--r-- | arch/x86/Makefile_64 | 8 | ||||
-rw-r--r-- | arch/x86/boot/Makefile | 6 | ||||
-rw-r--r-- | arch/x86/kernel/Makefile_32 | 3 | ||||
-rw-r--r-- | arch/x86/kernel/Makefile_64 | 2 | ||||
-rw-r--r-- | arch/x86/vdso/Makefile | 2 |
7 files changed, 23 insertions, 16 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 309597386a77..116b03a45636 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -1,12 +1,16 @@ | |||
1 | # Unified Makefile for i386 and x86_64 | 1 | # Unified Makefile for i386 and x86_64 |
2 | 2 | ||
3 | # select defconfig based on actual architecture | 3 | # select defconfig based on actual architecture |
4 | KBUILD_DEFCONFIG := $(ARCH)_defconfig | 4 | ifeq ($(ARCH),x86) |
5 | KBUILD_DEFCONFIG := i386_defconfig | ||
6 | else | ||
7 | KBUILD_DEFCONFIG := $(ARCH)_defconfig | ||
8 | endif | ||
5 | 9 | ||
6 | # # No need to remake these files | 10 | # No need to remake these files |
7 | $(srctree)/arch/x86/Makefile%: ; | 11 | $(srctree)/arch/x86/Makefile%: ; |
8 | 12 | ||
9 | ifeq ($(ARCH),i386) | 13 | ifeq ($(CONFIG_X86_32),y) |
10 | include $(srctree)/arch/x86/Makefile_32 | 14 | include $(srctree)/arch/x86/Makefile_32 |
11 | else | 15 | else |
12 | include $(srctree)/arch/x86/Makefile_64 | 16 | include $(srctree)/arch/x86/Makefile_64 |
diff --git a/arch/x86/Makefile_32 b/arch/x86/Makefile_32 index 346ac0766875..50394da2f6c1 100644 --- a/arch/x86/Makefile_32 +++ b/arch/x86/Makefile_32 | |||
@@ -160,7 +160,7 @@ archclean: | |||
160 | $(Q)$(MAKE) $(clean)=arch/x86/boot | 160 | $(Q)$(MAKE) $(clean)=arch/x86/boot |
161 | 161 | ||
162 | define archhelp | 162 | define archhelp |
163 | echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' | 163 | echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' |
164 | echo ' install - Install kernel using' | 164 | echo ' install - Install kernel using' |
165 | echo ' (your) ~/bin/installkernel or' | 165 | echo ' (your) ~/bin/installkernel or' |
166 | echo ' (distribution) /sbin/installkernel or' | 166 | echo ' (distribution) /sbin/installkernel or' |
@@ -170,6 +170,6 @@ define archhelp | |||
170 | echo ' isoimage - Create a boot CD-ROM image' | 170 | echo ' isoimage - Create a boot CD-ROM image' |
171 | endef | 171 | endef |
172 | 172 | ||
173 | CLEAN_FILES += arch/$(ARCH)/boot/fdimage \ | 173 | CLEAN_FILES += arch/x86/boot/fdimage \ |
174 | arch/$(ARCH)/boot/image.iso \ | 174 | arch/x86/boot/image.iso \ |
175 | arch/$(ARCH)/boot/mtools.conf | 175 | arch/x86/boot/mtools.conf |
diff --git a/arch/x86/Makefile_64 b/arch/x86/Makefile_64 index 57e714a47af7..a804860022e6 100644 --- a/arch/x86/Makefile_64 +++ b/arch/x86/Makefile_64 | |||
@@ -127,7 +127,7 @@ archclean: | |||
127 | $(Q)$(MAKE) $(clean)=$(boot) | 127 | $(Q)$(MAKE) $(clean)=$(boot) |
128 | 128 | ||
129 | define archhelp | 129 | define archhelp |
130 | echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' | 130 | echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' |
131 | echo ' install - Install kernel using' | 131 | echo ' install - Install kernel using' |
132 | echo ' (your) ~/bin/installkernel or' | 132 | echo ' (your) ~/bin/installkernel or' |
133 | echo ' (distribution) /sbin/installkernel or' | 133 | echo ' (distribution) /sbin/installkernel or' |
@@ -137,8 +137,8 @@ define archhelp | |||
137 | echo ' isoimage - Create a boot CD-ROM image' | 137 | echo ' isoimage - Create a boot CD-ROM image' |
138 | endef | 138 | endef |
139 | 139 | ||
140 | CLEAN_FILES += arch/$(ARCH)/boot/fdimage \ | 140 | CLEAN_FILES += arch/x86/boot/fdimage \ |
141 | arch/$(ARCH)/boot/image.iso \ | 141 | arch/x86/boot/image.iso \ |
142 | arch/$(ARCH)/boot/mtools.conf | 142 | arch/x86/boot/mtools.conf |
143 | 143 | ||
144 | 144 | ||
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 89dbf970e058..7a3116ccf387 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -49,10 +49,10 @@ 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. |
52 | cflags-i386 := | 52 | cflags-$(CONFIG_X86_32) := |
53 | cflags-x86_64 := -m32 | 53 | cflags-$(CONFIG_X86_64) := -m32 |
54 | KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ | 54 | KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ |
55 | $(cflags-$(ARCH)) \ | 55 | $(cflags-y) \ |
56 | -Wall -Wstrict-prototypes \ | 56 | -Wall -Wstrict-prototypes \ |
57 | -march=i386 -mregparm=3 \ | 57 | -march=i386 -mregparm=3 \ |
58 | -include $(srctree)/$(src)/code16gcc.h \ | 58 | -include $(srctree)/$(src)/code16gcc.h \ |
diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32 index b9d679820306..a7bc93c27662 100644 --- a/arch/x86/kernel/Makefile_32 +++ b/arch/x86/kernel/Makefile_32 | |||
@@ -3,6 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | extra-y := head_32.o init_task.o vmlinux.lds | 5 | extra-y := head_32.o init_task.o vmlinux.lds |
6 | CPPFLAGS_vmlinux.lds += -Ui386 | ||
6 | 7 | ||
7 | obj-y := process_32.o signal_32.o entry_32.o traps_32.o irq_32.o \ | 8 | obj-y := process_32.o signal_32.o entry_32.o traps_32.o irq_32.o \ |
8 | ptrace_32.o time_32.o ioport_32.o ldt_32.o setup_32.o i8259_32.o sys_i386_32.o \ | 9 | ptrace_32.o time_32.o ioport_32.o ldt_32.o setup_32.o i8259_32.o sys_i386_32.o \ |
@@ -60,7 +61,7 @@ quiet_cmd_syscall = SYSCALL $@ | |||
60 | cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \ | 61 | cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \ |
61 | -Wl,-T,$(filter-out FORCE,$^) -o $@ | 62 | -Wl,-T,$(filter-out FORCE,$^) -o $@ |
62 | 63 | ||
63 | export CPPFLAGS_vsyscall_32.lds += -P -C -U$(ARCH) | 64 | export CPPFLAGS_vsyscall_32.lds += -P -C -Ui386 |
64 | 65 | ||
65 | vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ | 66 | vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ |
66 | $(call ld-option, -Wl$(comma)--hash-style=sysv) | 67 | $(call ld-option, -Wl$(comma)--hash-style=sysv) |
diff --git a/arch/x86/kernel/Makefile_64 b/arch/x86/kernel/Makefile_64 index 24671c3838b3..5a88890d8ee9 100644 --- a/arch/x86/kernel/Makefile_64 +++ b/arch/x86/kernel/Makefile_64 | |||
@@ -3,7 +3,9 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | extra-y := head_64.o head64.o init_task.o vmlinux.lds | 5 | extra-y := head_64.o head64.o init_task.o vmlinux.lds |
6 | CPPFLAGS_vmlinux.lds += -Ux86_64 | ||
6 | EXTRA_AFLAGS := -traditional | 7 | EXTRA_AFLAGS := -traditional |
8 | |||
7 | obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \ | 9 | obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \ |
8 | ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \ | 10 | ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \ |
9 | x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \ | 11 | x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \ |
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile index 7a2ba4583939..e7bff0fbac23 100644 --- a/arch/x86/vdso/Makefile +++ b/arch/x86/vdso/Makefile | |||
@@ -20,7 +20,7 @@ quiet_cmd_syscall = SYSCALL $@ | |||
20 | cmd_syscall = $(CC) -m elf_x86_64 -nostdlib $(SYSCFLAGS_$(@F)) \ | 20 | cmd_syscall = $(CC) -m elf_x86_64 -nostdlib $(SYSCFLAGS_$(@F)) \ |
21 | -Wl,-T,$(filter-out FORCE,$^) -o $@ | 21 | -Wl,-T,$(filter-out FORCE,$^) -o $@ |
22 | 22 | ||
23 | export CPPFLAGS_vdso.lds += -P -C -U$(ARCH) | 23 | export CPPFLAGS_vdso.lds += -P -C |
24 | 24 | ||
25 | vdso-flags = -fPIC -shared -Wl,-soname=linux-vdso.so.1 \ | 25 | vdso-flags = -fPIC -shared -Wl,-soname=linux-vdso.so.1 \ |
26 | $(call ld-option, -Wl$(comma)--hash-style=sysv) \ | 26 | $(call ld-option, -Wl$(comma)--hash-style=sysv) \ |