aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
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
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')
-rw-r--r--arch/mips/Kconfig15
-rw-r--r--arch/mips/Makefile23
2 files changed, 20 insertions, 18 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b09eee2281c5..492f581fe6ba 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1853,21 +1853,6 @@ source "fs/Kconfig.binfmt"
1853config TRAD_SIGNALS 1853config TRAD_SIGNALS
1854 bool 1854 bool
1855 1855
1856config BUILD_ELF64
1857 bool "Use 64-bit ELF format for building"
1858 depends on 64BIT
1859 help
1860 A 64-bit kernel is usually built using the 64-bit ELF binary object
1861 format as it's one that allows arbitrary 64-bit constructs. For
1862 kernels that are loaded within the KSEG compatibility segments the
1863 32-bit ELF format can optionally be used resulting in a somewhat
1864 smaller binary, but this option is not explicitly supported by the
1865 toolchain and since binutils 2.14 it does not even work at all.
1866
1867 Say Y to use the 64-bit format or N to use the 32-bit one.
1868
1869 If unsure say Y.
1870
1871config BINFMT_IRIX 1856config BINFMT_IRIX
1872 bool "Include IRIX binary compatibility" 1857 bool "Include IRIX binary compatibility"
1873 depends on CPU_BIG_ENDIAN && 32BIT && BROKEN 1858 depends on CPU_BIG_ENDIAN && 32BIT && BROKEN
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)"