Bug 4703 - alpha: ARCH_STRING inconsistent with Makefile, and -ffast-math doesn't work
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: GIT MASTER
Hardware: DEC Linux
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL: http://bugs.debian.org/cgi-bin/bugrep...
Depends on:
Blocks:
 
Reported: 2010-08-13 15:35 EDT by Simon McVittie
Modified: 2011-02-06 12:20:00 EST
1 user (show)

See Also:


Attachments
patch originally from Steve Langasek, updated to current svn (975 bytes, patch)
2010-08-13 15:36 EDT, Simon McVittie

Description Simon McVittie 2010-08-13 15:35:06 EDT
Two unrelated bugs on alpha; they were reported against an old openarena in <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410555>, but I believe they still affect ioquake3.

(That Debian bug actually mentions three bugs, but the first one, regarding "uchar" in lcc, is in code we no longer distribute, so we don't have a patch for it. It may already have been fixed, I don't know.)

On Linux, Makefile thinks the DEC Alpha architecture is called "axp", whereas q_platform.h thinks it's called "alpha"; this mismatch means that DLLs will be called something like qagameaxp.so, whereas the engine will be trying to dlopen qagamealpha.so.

(I know you don't recommend using native code DLLs; see Bug #4701 for my rationale for using them.)

While fixing this, Steve Langasek found that when compiled with -ffast-math, openarena would die with SIGFPE; disabling -ffast-math fixed this. I've asked him to confirm whether this is still necessary, since the bug report was a while ago.
Comment 1 Simon McVittie 2010-08-13 15:36:35 EDT
Created attachment 2402 [details]
patch originally from Steve Langasek, updated to current svn

This should fix the latter two bugs I mentioned: alpha vs. axp, and -ffast-math.
Comment 2 Simon McVittie 2010-08-16 06:40:41 EDT
Steve writes:
> My Alpha died a couple of years back and I have no plans to resuscitate it.
> Best to ask on the debian-alpha list for help.
>
> But the meaning of -ffast-math hasn't changed, so unless there have been
> code changes in openarena around fp handling, it's still inappropriate to
> use here.

Consulting `info gcc`, I noticed this:

> `-mieee'
>      DEBIAN SPECIFIC: This option is on by default, unless
>      `-ffinite-math-only' (which is part of the `-ffast-math' set) is
>      specified, because the software functions in the GNU libc math
>      libraries generate denormalized numbers, NaNs, and infs (all of
>      which will cause a programs to SIGFPE when it attempts to use the
>      results without `-mieee').

I suspect that this is the problem here, and -ffinite-math-only isn't really safe to use in ioquake3, at least on Alpha.
Comment 3 Thilo Schulz 2011-02-06 12:20:00 EST
applied r1859