This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: __nldbl_fprintf and __gtdf2 on PowerPC no-fpu
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.
>
> another addition, changing fprintf to fscanf did not reproduce the problem.
> it seems only the combination of *printf and __gtdf2 and -static would
> cause this problem.
Opps, false information, sorry...
*scanf and __gtdf2 DID reproduce the problem.
also, __ledf2 and {*printf,*scanf} DID reproduce the problem.
Summary:
| __gtdf2 __gedf2 __ltdf2 __ledf2
----------------+-------- ------- ------- -------
__nldbl_fprintf | NG OK OK NG
__nldbl_fscanf | NG OK OK NG
(Hiroki Kaminaga)
t
--