diff options
author | Franck Bui-Huu <fbuihuu@gmail.com> | 2007-02-15 06:06:48 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 18:45:59 -0400 |
commit | adff90a9333004d5459823665e8bcf6cb9214f79 (patch) | |
tree | d4eadd84faed02ef8514cca0e22756efbbfe5d2f /arch/mips/Makefile | |
parent | 8c67316e706cabc2145d6c8e97f0bd8f2a86d8a1 (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/Makefile | 23 |
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 | |||
60 | vmlinux-64 = vmlinux | 60 | vmlinux-64 = vmlinux |
61 | 61 | ||
62 | cflags-y += -mabi=64 | 62 | cflags-y += -mabi=64 |
63 | ifndef CONFIG_BUILD_ELF64 | ||
64 | cflags-y += $(call cc-option,-msym32) | ||
65 | endif | ||
66 | endif | 63 | endif |
67 | 64 | ||
68 | all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) | 65 | all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) |
@@ -576,6 +573,26 @@ else | |||
576 | JIFFIES = jiffies_64 | 573 | JIFFIES = jiffies_64 |
577 | endif | 574 | endif |
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 | # | ||
582 | ifdef 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 | ||
594 | endif | ||
595 | |||
579 | AFLAGS += $(cflags-y) | 596 | AFLAGS += $(cflags-y) |
580 | CFLAGS += $(cflags-y) \ | 597 | CFLAGS += $(cflags-y) \ |
581 | -D"VMLINUX_LOAD_ADDRESS=$(load-y)" | 598 | -D"VMLINUX_LOAD_ADDRESS=$(load-y)" |