__nldbl_fprintf and __gtdf2 on PowerPC no-fpu
Hiroki Kaminaga
kaminaga@sm.sony.co.jp
Wed Dec 6 09:01:00 GMT 2006
Hi,
Hiroki Kaminaga wrote:
> I'm using gcc-4.1.1, glibc-2.5, binutils-2.17.50.0.6 to cross compile
> for PowerPC architecture, without fp.
>
> Below is sample problem I met:
>
> $ cat ldbl.c
> #include <stdio.h>
> int main(void){
> long double ld1, ld2;
> if (ld1>ld2)
> fprintf(stderr, "hello, %Lf\n", ld1);
> return 0;
> }
>
> $ powerpc-unknown-linux-gcc -static ldbl.c
> /usr/local/powerpc-unknown-linux-newtool/devel/bin/../target/usr/lib/libc.a(gedf2.o): In function `__gtdf2':
> gedf2.c:(.text+0x0): multiple definition of `__gtdf2'
> /usr/local/powerpc-unknown-linux-newtool/devel/bin/../lib/gcc/powerpc-unknown-linux/4.1.1/libgcc.a(_gt_df.o):/var/rpm/BUILD/gcc-4.1.1/objdir/gcc/dp-bit.c:1223: first defined here
> /usr/local/powerpc-unknown-linux-newtool/devel/bin/../lib/gcc/powerpc-unknown-linux/4.1.1/../../../../powerpc-unknown-linux/bin/ld: Warning: size of symbol `__gtdf2' changed from 152 in /usr/local/powerpc-unknown-linux-newtool/devel/bin/../lib/gcc/powerpc-unknown-linux/4.1.1/libgcc.a(_gt_df.o) to 440 in /usr/local/powerpc-unknown-linux-newtool/devel/bin/../target/usr/lib/libc.a(gedf2.o)
> collect2: ld returned 1 exit status
>
> Without specifying -static, or removing `if' statement, or change `long
> double' to `float' from sample program would not reproduce the problem.
in addition, changing the if statement to
'>=' or '<' or '<=' or '=='or '!='
(thus __gedf2, __l[te]df2, __eqdf2, __nedf2) did not show up the
problem. It seems to appear only on __gtdf2.
(Hiroki Kaminaga)
t
--
More information about the Libc-alpha
mailing list