[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-0.7.0 Solaris Host patch (Real)

From: Juergen Keil
Subject: Re: [Qemu-devel] [PATCH] qemu-0.7.0 Solaris Host patch (Real)
Date: Tue, 3 May 2005 19:24:20 +0200 (CEST)

> Undefined                       first referenced
>  symbol                             in file
> fesetround                          libqemu.a(softfloat-native.o)
> lrintf                              libqemu.a(softfloat-native.o)
> llrint                              libqemu.a(softfloat-native.o)
> rintf                               libqemu.a(softfloat-native.o)
> lrint                               libqemu.a(softfloat-native.o)
> remainderf                          libqemu.a(softfloat-native.o)
> sqrtf                               libqemu.a(softfloat-native.o)
> llrintf                             libqemu.a(softfloat-native.o)
> ld: fatal: Symbol referencing errors. No output written to qemu
> collect2: ld returned 1 exit status
> gmake[1]: *** [qemu] Error 1
> Okay, fesetround can be resolved by adding '-L/opt/SUNWspro/lib -lm9x' but 
> what about the other symbols?

Hmm, Solaris 10 has all of these functions in libm.so, but apparently
they are missing in the Solaris 8 or Solaris 9 math library -lm.

For the BSDs, this problem has already be solved for lrint() and llrint():

    long lrint(double x);
    long long llrint(double x);

See the file fpu/softfloat-native.c,  you'll find:

#if defined(_BSD)
#define lrint(d)                ((int32_t)rint(d))
#define llrint(d)               ((int64_t)rint(d))

Both macros should be enabled for Solaris 8 & 9, too.

lrintf() and llrintf() is the same, but with a float argument instead of
double.  The following macros should work:

#define lrintf(f)               ((int32_t)rint(f))
#define llrintf(f)              ((int64_t)rint(f))

sqrtf(), remainderf() and rintf() is similar to sqrt(), remainder() and
rint() but uses float arguments and result values.

#define sqrtf(f)                ((float)sqrt(f))
#define remainderf(fa, fb)      ((float)remainder(fa, fb))
#define rintf(f)                ((float)rint(f))

(All of this is untested, but should work)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]