diff options
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)" |