On Tue, 25 Nov 2003, Lawrence Gold wrote:

> On Tue, Nov 25, 2003 at 03:12:30PM +0100, Anders H?ckersten wrote:
> > Hi! I tried installing xmame 0.77.1 today, but was unable to link it.
> > Apparently, some of the emulated machines use the functions sqrtf and
> > floorf, which are not supported on the Solaris platform. 0.76.1 links
> > fine, so this is obviously a bug in the new version.
>
> Could you provide a full log of the errors?  Hopefully there'll be a good
> way to fix it.
>
> Thanks.

Sure. Here is the relevant output. Since the original file was 405
lines long, I've taken the liberty to remove more or less duplicate lines
(that refer to the same files and functions). If you want to, I can send a
complete file detailing everything:

Linking xmame.x11 ...
xmame.obj/midway.a(voodoo.o)(.text+0x30b8): In function
`render_0c000035_00045119_000b4779_0824101f':
: undefined reference to `floorf'
xmame.obj/midway.a(voodoo.o)(.text+0x3e80): In function
`render_0c000035_00045119_000b4779_0824101f':
: undefined reference to `sqrtf'
xmame.obj/midway.a(voodoo.o)(.text+0x13e48): In function
`generic_render_1tmu':
: undefined reference to `floorf'
xmame.obj/midway.a(voodoo.o)(.text+0x16028): In function
`generic_render_1tmu':
: undefined reference to `sqrtf'
xmame.obj/midway.a(voodoo.o)(.text+0x165b4): In function
`generic_render_2tmu':
: undefined reference to `floorf'
xmame.obj/midway.a(voodoo.o)(.text+0x19500): In function
`generic_render_2tmu':
: undefined reference to `sqrtf'
collect2: ld returned 1 exit status
gmake: *** [xmame.x11] Error 1

The problem, as may or may not be evident, is that sqrtf, floorf and so on
(single precision floating point operations) are not available in
the Solaris libm. I found a quick and possibly dirty fix here:
http://www.winehq.org/hypermail/wine-patches/2003/02/0180.html

In essence it entails defining those functions in terms of the ordinary
functions somewhere, which they do by putting in:
#if defined(__sun) || defined(__sun__)
static inline float logf (float x) { return log (x); }
static inline float sqrtf (float x) { return sqrt (x); }
static inline float floorf (float x) { return floor (x); }
static inline float powf (float x, float y) { return pow (x,y); }
#endif

However, I seriously doubt that single precision is a necessity in the
code where it is found, so it might be safe just to use the double
precision functions (which are a lot more portable evidently) everywhere.
But then again, I've never touched a line of MAME code in my life, so I
could be totally wrong, maybe they need to be single precision.

/ Anders

-- 
"Computers are useless. They can only give you answers"
- Pablo Picasso

_______________________________________________
Xmame mailing list
[EMAIL PROTECTED]
http://toybox.twisted.org.uk/mailman/listinfo/xmame

Reply via email to