From: Paul M. <le...@li...> - 2007-08-20 15:56:35
|
On Mon, Aug 20, 2007 at 05:42:30PM +0200, EXTERNAL Brunner Markus (Praktikant; ST-FIR/Eng) wrote: > From: Paul Mundt [mailto:le...@li...] > > It was meant to be applied without the -Wa,-dsp. The explicit > -Wa,-isa= > > tuning implies -dsp opcode support depending on the tuning target. Can > > you try to do the build with V=1 for verbose output and paste the full > > invocation to the build as well as the full error itself, as well as > the > > toolchain versions? I was able to get your defconfig building with all > of > > the toolchains I had on hand, so this makes me suspect your binutils > > version or something is still not being parsed properly. > > It seems to be toolchain related. > Both KPIT toolchains v0601 (gcc 3.4 binutils 2.16) and v0701 compile. > My self-build crosstool toolchains with gcc 4.0.4 and 4.1.2 with > binutils 2.16.1 also compile with your fix. > The crosstool toolchains 3.2.3, 3.3.6 and 3.4.6 (all binutils 2.15) > don't work with your fix, they need -Wa,-dsp > So it seems binutils 2.15 is the one to blame. > > > /opt/crosstool/gcc-3.4.6-glibc-2.3.6/sh3-unknown-linux-gnu/lib/gcc/sh3-u > nknown-linux-gnu/3.4.6/include -D__KERNEL__ -Iinclude -include > include/linux/autoconf.h -D__ASSEMBLY__ -m3 -ml -ffreestanding -c -o > arch/sh/kernel/cpu/sh3/entry.o arch/sh/kernel/cpu/sh3/entry.S > arch/sh/kernel/cpu/sh3/entry.S: Assembler messages: > arch/sh/kernel/cpu/sh3/entry.S:270: Error: unknown opcode That's what I was afraid of, you don't support the -isa tuning. Grumble. This is getting a bit hairy.. how about this? -- diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 3d211aa..97ac586 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -34,6 +34,8 @@ isa-y := $(isa-y)-nofpu endif endif +isa-y := $(isa-y)-up + cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ $(call cc-option,-m2a-nofpu,) @@ -46,7 +48,20 @@ cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml -cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) -ffreestanding +# +# -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that +# support it, while -Wa,-dsp by itself limits the range of usable opcodes +# on certain CPU subtypes. Try the ISA variant first, and if that fails, +# fall back on -Wa,-dsp for the old binutils versions. Even without DSP +# opcodes, we always want the best ISA tuning the version of binutils +# will provide. +# +isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),) + +isaflags-$(CONFIG_SH_DSP) := \ + $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) + +cflags-y += $(isaflags-y) -ffreestanding cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') |