diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-08-21 03:56:56 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-08-21 03:56:56 -0400 |
commit | da2f5f7bf4a39f9613fc04d7030cffb63e435e1d (patch) | |
tree | 6f650eb49cb3d308a28fdda38dc79ae82935c0ac | |
parent | 8eb891fc809b2300137bcd247025628c06c95a63 (diff) |
sh: Fix DSP opcode regression for SH3-DSP parts.
Older versions of binutils do not support -Wa,-isa= tuning, which is
something we rely on for enabling DSP opcode support on the newer
parts. SH3-DSP parts can still be handled with -Wa,-dsp even if the
newer parts require the newer versions of binutils for supporting the
new opcodes.
This was broken in -rc1 when the SH4AL-DSP support was being reworked,
and is needed to get SH3-DSP working with older toolchains again.
Reported-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/Makefile | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 3d211aa33cd8..97ac58682d0f 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -34,6 +34,8 @@ isa-y := $(isa-y)-nofpu | |||
34 | endif | 34 | endif |
35 | endif | 35 | endif |
36 | 36 | ||
37 | isa-y := $(isa-y)-up | ||
38 | |||
37 | cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) | 39 | cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) |
38 | cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ | 40 | cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ |
39 | $(call cc-option,-m2a-nofpu,) | 41 | $(call cc-option,-m2a-nofpu,) |
@@ -46,7 +48,20 @@ cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ | |||
46 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | 48 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb |
47 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | 49 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml |
48 | 50 | ||
49 | cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) -ffreestanding | 51 | # |
52 | # -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that | ||
53 | # support it, while -Wa,-dsp by itself limits the range of usable opcodes | ||
54 | # on certain CPU subtypes. Try the ISA variant first, and if that fails, | ||
55 | # fall back on -Wa,-dsp for the old binutils versions. Even without DSP | ||
56 | # opcodes, we always want the best ISA tuning the version of binutils | ||
57 | # will provide. | ||
58 | # | ||
59 | isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),) | ||
60 | |||
61 | isaflags-$(CONFIG_SH_DSP) := \ | ||
62 | $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) | ||
63 | |||
64 | cflags-y += $(isaflags-y) -ffreestanding | ||
50 | 65 | ||
51 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | 66 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ |
52 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') | 67 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') |