powerpc-linux cross-compiler. unknown register name `st(1)' in `asm'

Brendan Simon brendan@dgs.monash.edu.au
Sun Jun 6 08:24:00 GMT 1999


Kai Ruottu wrote:

>  The 'ld.so.1' may be a script, where the '/lib/libc.so' or '/lib/libc.a' is
> named. Just edit it...
>
>  The mips-linux and m68k-linux 'dynamic-linker' files are text scripts,
> probably the powerpc-linux too... If it is, just edit it... Otherwise there is
> a real problem to be solved ;-(

Yep.  libc.so is a script but libc.a is a binary.  I changed "GROUP ( /lib/libc.so.6
/usr/lib/libc_nonshared.a )" to "GROUP ( /usr/local/egcs/powerpc-linux/lib/libc.so.6
/usr/local/egcs/powerpc-linux/lib/libc_nonshared.a )" and this fixed the linking
problem.

Now I get a unrecognised registers in the __math.h header file.

/usr/local/src/gnu-tools/build-egcs-1.1.2/gcc/xgcc
-B/usr/local/src/gnu-tools/build-egcs-1.1.2/gcc/ -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../.././tools/egcs-1.1.2/libiberty/../include
../../.././tools/egcs-1.1.2/libiberty/floatformat.c
/usr/local/egcs/powerpc-linux/sys-include/__math.h: In function `atan2':
In file included from /usr/local/egcs/powerpc-linux/sys-include/math.h:208,
                 from ../../.././tools/egcs-1.1.2/libiberty/floatformat.c:21:
/usr/local/egcs/powerpc-linux/sys-include/__math.h:142: unknown register name `st(1)'
in `asm'
/usr/local/egcs/powerpc-linux/sys-include/__math.h: In function `fmod':
/usr/local/egcs/powerpc-linux/sys-include/__math.h:275: unknown register name `ax' in
`asm'
/usr/local/egcs/powerpc-linux/sys-include/__math.h: In function `drem':
/usr/local/egcs/powerpc-linux/sys-include/__math.h:467: unknown register name `ax' in
`asm'
/usr/local/egcs/powerpc-linux/sys-include/__math.h: In function
`floatformat_to_double':
/usr/local/egcs/powerpc-linux/sys-include/__math.h:287: inconsistent operand
constraints in an `asm'
/usr/local/egcs/powerpc-linux/sys-include/__math.h:287: inconsistent operand
constraints in an `asm'
make[1]: *** [floatformat.o] Error 1

The offending line is the one with the "st(1) in it.

__MATH_INLINE double atan2 (double __y, double __x);
__MATH_INLINE double
atan2 (double __y, double __x)
{
  register double __value;
  __asm __volatile__
    ("fpatan\n\t"
     : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");   /* THIS
IS THE OFFENDING LINE IN __math.h */

  return __value;
}

I've checked my powerpc book and can not find any floating point instruction "fpatan".
The compiler does not complain about this though, just that the register st(1) is not
known.
Is this a valid powerpc assembler statement ?
Have I got the right header files (I got the yellowdog linux rpm files) ?

Brendan Simon.




More information about the crossgcc mailing list