Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 8 Apr 2013 22:41:28 +0200
From: meres5@...ha.tmit.bme.hu
To: musl@...ts.openwall.com
Subject: Re: vfprintf.c:(.text+0xc6c): undefined reference to
 `__signbitl'

Well,

> what is the long double on your platform? i assume it's 128bit
>
> gcc -dM -E - </dev/null |grep LDBL_

meres5@...ha:~/src/eglibc/ports$ gcc -dM -E - </dev/null |grep LDBL_
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __LDBL_MANT_DIG__ 106
#define __LDBL_MIN_EXP__ (-968)
#define __LDBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __LDBL_MIN_10_EXP__ (-291)
#define __LDBL_DIG__ 31

seems . . .

>> lib/libc.a(vfprintf.o): In function `printf_core':
>> vfprintf.c:(.text+0xc6c): undefined reference to `__signbitl'
>> vfprintf.c:(.text+0xccc): undefined reference to `__fpclassifyl'
>>
>> by linking static against musl a Hello sample.
>> I think this is not good. . .
>
> the problem is that various functions use the signbit macro
> from math.h

Yep.

> it gets the sign bit with bithacks for float and double and
> calls __signbitl for long double
>
> but the __signbitl call should only be generated by the compiler
> if sizeof(long double) != sizeof(double)
>
> in that case we only support the 80bit long double of x86
>
> (powerpc long double can be 64bit, 128bit ieee or 128bit ibm
> and we only support 64bit at this point, the others are
> soft-float emulations anyway so not very useful, but that's
> the standard abi so many toolchains use that..)

I won't like to descend so deep.
I've just like to demo the difference between static and
dynamic linking to our students, and came up here - LOL!

Anyway, it's been 19 years passed, so my guide seemed not so
durable.
Also Linux dropped the concept of static linking in practivce.
Goodby kiss to

$ ld -o stdhello /lib/crt0.o stdhello.o -lc

> it might make sense to add these so code will
> "happen to work" if it does not use long double
>
> (note that printf uses long double internally
> to print floats but it may even work with
> float and doubles but it will definitly fail to
> print long doubles)

Thanks. . . I check out some more static libs for gcc.
I have just tried to build eglibc:

cc1: error: unrecognized command line option "-mno-vsx"
make[2]: *** [/home/meres5/src/eglibc/ports/gmon/mcount.o] Error 1

:-)
All about
./configure --prefix=. . . . .
make
make install


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.