aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/Makefile
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-11-25 14:21:36 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-12-22 04:43:49 -0500
commit5dd614761f05f56b93c94541aa92e6449920516c (patch)
tree2cd59165b427209ad31c85cf6e091bc3a69438a5 /arch/sh/Makefile
parent624c6a6750c502981d92de4579647fe2549451dd (diff)
sh: Re-add support for best fit ISA tuning if none is available.
This was removed in the libgcc integration, but there are still some compilers that need this. We also relax the rules on the ISA tuning in the cases where there are no matches for the CPU tuning and adopt the -any default, which matches the intent of the isa-y target list. This compensates for mismatches where binutils supports a wide array of targets whilst the compiler is much more restricted. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r--arch/sh/Makefile25
1 files changed, 20 insertions, 5 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index fac1567b2afb..ad0096151781 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -35,11 +35,21 @@ cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
35cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) 35cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
36cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) 36cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
37 37
38cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb 38ifeq ($(cflags-y),)
39cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml 39#
40 40# In the case where we are stuck with a compiler that has been uselessly
41cflags-y += $(call cc-option,-mno-fdpic) 41# restricted to a particular ISA, a favourite default of newer GCCs when
42 42# extensive multilib targets are not provided, ensure we get the best fit
43# regarding FP generation. This is intentionally stupid (albeit many
44# orders of magnitude less than GCC's default behaviour), as anything
45# with a large number of multilib targets better have been built
46# correctly for the target in mind.
47#
48cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \
49 grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//')
50# At this point, anything goes.
51isaflags-y := $(call as-option,-Wa$(comma)-isa=any,)
52else
43# 53#
44# -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that 54# -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that
45# support it, while -Wa,-dsp by itself limits the range of usable opcodes 55# support it, while -Wa,-dsp by itself limits the range of usable opcodes
@@ -52,7 +62,12 @@ isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),)
52 62
53isaflags-$(CONFIG_SH_DSP) := \ 63isaflags-$(CONFIG_SH_DSP) := \
54 $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) 64 $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp)
65endif
66
67cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
68cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
55 69
70cflags-y += $(call cc-option,-mno-fdpic)
56cflags-y += $(isaflags-y) -ffreestanding 71cflags-y += $(isaflags-y) -ffreestanding
57 72
58cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ 73cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \