aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
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 d5d5831b6e2..4337c492ed1 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)"