aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
authorFranck Bui-Huu <fbuihuu@gmail.com>2007-02-15 06:06:48 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-10-11 18:45:59 -0400
commitadff90a9333004d5459823665e8bcf6cb9214f79 (patch)
treed4eadd84faed02ef8514cca0e22756efbbfe5d2f /arch/mips/Makefile
parent8c67316e706cabc2145d6c8e97f0bd8f2a86d8a1 (diff)
[MIPS] Automatically set CONFIG_BUILD_ELF64
We do not rely on user anymore to setup this config correctly. Instead we make our choice depending on the load address. If we want to force Kbuild to use ELF64 format whatever the load address we can still do: $ make BUILD_ELF32=no Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r--arch/mips/Makefile23
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index d5d5831b6e24..4337c492ed1b 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -60,9 +60,6 @@ vmlinux-32 = vmlinux.32
60vmlinux-64 = vmlinux 60vmlinux-64 = vmlinux
61 61
62cflags-y += -mabi=64 62cflags-y += -mabi=64
63ifndef CONFIG_BUILD_ELF64
64cflags-y += $(call cc-option,-msym32)
65endif
66endif 63endif
67 64
68all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) 65all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32)
@@ -576,6 +573,26 @@ else
576JIFFIES = jiffies_64 573JIFFIES = jiffies_64
577endif 574endif
578 575
576#
577# Automatically detect the build format. By default we choose
578# the elf format according to the load address.
579# We can always force a build with a 64-bits symbol format by
580# passing 'BUILD_ELF32=no' option to the make's command line.
581#
582ifdef CONFIG_64BIT
583 ifndef BUILD_ELF32
584 ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
585 BUILD_ELF32 = y
586 endif
587 endif
588
589 ifeq ($(BUILD_ELF32), y)
590 cflags-y += -msym32
591 else
592 cflags-y += -DCONFIG_BUILD_ELF64
593 endif
594endif
595
579AFLAGS += $(cflags-y) 596AFLAGS += $(cflags-y)
580CFLAGS += $(cflags-y) \ 597CFLAGS += $(cflags-y) \
581 -D"VMLINUX_LOAD_ADDRESS=$(load-y)" 598 -D"VMLINUX_LOAD_ADDRESS=$(load-y)"