Problem with gcc and binutils-2.8.1 m68k cross-compiler

Mark Phillips
Wed Jun 18 01:53:00 GMT 1997

When gcc builds it builds a support library called libgcc1 multiple times,
once for ech legal combination of compiler target flags (see
MULTILIB_OPTIONS in the Makefile).

Now when performing one of those builds (look a bit further back in the
make log for the flags on the compiler line in the for loop), it has
either generated illegal code for the selected target, or the assembler
has a bug which causes it to reject a legal opcode.

In particular I know that "tst.l %a4" is legal on 68020 and cpu32, but gas
(binutils 2.8.0) rejects it for cpu32.

So you have a couple of choices:-

1) Find a patch from someone which fixes the problem!

2) If the build is building a lib for a set of options you are not
interested in (say vanila 68000), edit config/m68k/t-m68kbare
MULTILIB_OPTIONS to remove the flag. This will sidestep the problem and
reduce the build time of gcc (and particularly newlib, if you use that).
If you do this, make sure you clean out all the old installed libs before
installing the new version.

3) Patch the assembler to allow the opcode IF IT IS REALLY LEGAL. It is on
the cpu32, but unless you have been tweeking gcc, it currently never uses
that flag!!!!

Good Luck

PS. I didn't see this error until I started tweeking the source code, my
gcc crossgcc patch with binutils 2.8.0 built. BUT I have
heard of other people having problems.

Mark S. Phillips        ESN 742 2461        Tel. +44 1279 402461

On Tue, 17 Jun 1997, Marc SCHAEFER wrote:

> Hi,
> I have tried to compile a cross-compiler for m68k as described in
> the FAQ on a Linux GCC/ELF compiler and on a SparcStation Solaris
> 2.5.6 and I have the following (same) problem:
>    binutils-2.8.1
>    gcc-
> Do you have any idea what could be wrong ?
> thank you
> _fixdfdi
> _fixunssfdi
> _fixsfdi
> _fixxfdi
> _fixunsxfdi
> _floatdixf
> /tmp/cca03511.s: Assembler messages:
> /tmp/cca03511.s:97: Error: operands mismatch -- statement `tst.l %a4' ignored
> make[2]: *** [libgcc2.a] Error 1
> make[2]: Leaving directory `/giga/d3/scratch/schaefer/cross-gcc/compile/build-gc
> c'
> make[1]: *** [stmp-multilib-sub] Error 2
> make[1]: Leaving directory `/giga/d3/scratch/schaefer/cross-gcc/compile/build-gc
> c'
> make: *** [stmp-multilib] Error 1

More information about the crossgcc mailing list