Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Fixing the "fnstsw" compile bug without using --disable-asm

This thread is locked; no one can reply to it. rss feed Print
Fixing the "fnstsw" compile bug without using --disable-asm
Bernhard Rosenkraenzer
Member #10,257
October 2008

Hi,
I've seen various posts about the "fnstsw" compile bug - always with a reply stating --disable-asm or --enable-asm=no fixes it.

While that does fix it, it also disables some optimizations -- there is a better fix.

The problem is caused by the use of the asm statement

fnstsw %eax

That used to work with old versions of binutils, current binutils versions (correctly) reject it as invalid because it uses a 16 bit operation on a 32 bit register.

The correct fix is to work on the 16 bit version of the register instead:

fnstsw %ax

I'm attaching a patch that fixes this.

kazzmir
Member #1,786
December 2001
avatar

Its normal to disable asm because the C code is just as fast these days.

If no other Allegro dev pushes this through and no one else disagrees then I'll apply it for you.

Evert
Member #794
November 2000
avatar

No reason to not apply it.
It does mean that we should output 4.4 at least, maybe 4.2.3 (with just minor fixes like this) as well.

Go to: