]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[MIPS] Automatically set CONFIG_BUILD_ELF64
authorFranck Bui-Huu <fbuihuu@gmail.com>
Thu, 15 Feb 2007 11:06:48 +0000 (12:06 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 11 Oct 2007 22:45:59 +0000 (23:45 +0100)
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>
arch/mips/Kconfig
arch/mips/Makefile
include/asm-mips/page.h

index b09eee2281c514cbd46119fd1c19f333768285ff..492f581fe6baabab5c28515134f53caa4bf7f3bb 100644 (file)
@@ -1853,21 +1853,6 @@ source "fs/Kconfig.binfmt"
 config TRAD_SIGNALS
        bool
 
-config BUILD_ELF64
-       bool "Use 64-bit ELF format for building"
-       depends on 64BIT
-       help
-         A 64-bit kernel is usually built using the 64-bit ELF binary object
-         format as it's one that allows arbitrary 64-bit constructs.  For
-         kernels that are loaded within the KSEG compatibility segments the
-         32-bit ELF format can optionally be used resulting in a somewhat
-         smaller binary, but this option is not explicitly supported by the
-         toolchain and since binutils 2.14 it does not even work at all.
-
-         Say Y to use the 64-bit format or N to use the 32-bit one.
-
-         If unsure say Y.
-
 config BINFMT_IRIX
        bool "Include IRIX binary compatibility"
        depends on CPU_BIG_ENDIAN && 32BIT && BROKEN
index d5d5831b6e248990f31d2cb9db778ad0c947c1d7..4337c492ed1b2567b93594022a849f6b90945961 100644 (file)
@@ -60,9 +60,6 @@ vmlinux-32            = vmlinux.32
 vmlinux-64             = vmlinux
 
 cflags-y               += -mabi=64
-ifndef CONFIG_BUILD_ELF64
-cflags-y               += $(call cc-option,-msym32)
-endif
 endif
 
 all-$(CONFIG_BOOT_ELF32)       := $(vmlinux-32)
@@ -576,6 +573,26 @@ else
 JIFFIES                        = jiffies_64
 endif
 
+#
+# Automatically detect the build format. By default we choose
+# the elf format according to the load address.
+# We can always force a build with a 64-bits symbol format by
+# passing 'BUILD_ELF32=no' option to the make's command line.
+#
+ifdef CONFIG_64BIT
+  ifndef BUILD_ELF32
+    ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
+      BUILD_ELF32 = y
+    endif
+  endif
+
+  ifeq ($(BUILD_ELF32), y)
+    cflags-y += -msym32
+  else
+    cflags-y += -DCONFIG_BUILD_ELF64
+  endif
+endif
+
 AFLAGS         += $(cflags-y)
 CFLAGS         += $(cflags-y) \
                        -D"VMLINUX_LOAD_ADDRESS=$(load-y)"
index e3301e54d559c9586bf47c31b0486af12d9e2ab6..b92dd8c760da5d8a600f6abb33bd62b9bc6c1146 100644 (file)
@@ -142,7 +142,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 /*
  * __pa()/__va() should be used only during mem init.
  */
-#ifdef CONFIG_64BIT
+#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
 #define __pa(x)                                                                \
 ({                                                                     \
     unsigned long __x = (unsigned long)(x);                            \