Bug 26657 - psemu-peopsspu-1.0.7-r1 fails building because of bad Makefile
Bug#: 26657 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: games@gentoo.org Reported By: langhamm@in.tum.de
Component: Games
URL: 
Summary: psemu-peopsspu-1.0.7-r1 fails building because of bad Makefile
Keywords:  
Status Whiteboard: 
Opened: 2003-08-14 20:16 0000
Description:   Opened: 2003-08-14 20:16 0000
DESCRIPTION:
------------
psemu-peopsspu can fail from building because the Makefile adds the deprecated
option "-mpentium" to CFLAGS


REASON:
-------
The option "-mpentium" is deprecated and can break the build on other processors
than pentium.
The bug is reproducable by setting CFLAGS="-march=athlon-tbird
-fprefetch-loop-arrays".


SOLUTION:
--------- 
Remove the "-mpentium" from the Makefile.
This breaks nothing and owners of pentiums have their "-march=pentium" in
/etc/make.conf.


ERROR-LOG:
----------

gcc -march=athlon-tbird -fprefetch-loop-arrays  -fPIC -c -Wall -mpentium -O3
-ffast-math -fomit-frame-pointer -DUSEALSA  dma.c
`-mpentium' is deprecated. Use `-march=pentium' or `-mcpu=pentium' instead.
dma.c: In function `SPUreadDMAMem':
dma.c:64: internal error: Floating point exception
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [dma.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from spu.c:198:
adsr.c: In function `InitADSR':
adsr.c:65: internal error: Floating point exception
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [spu.o] Error 1

!!! ERROR: app-emulation/psemu-peopsspu-1.0.7-r1 failed.
!!! Function src_compile, Line 43, Exitcode 2
!!! (no error message)

------- Comment #1 From Matthias Langhammer 2003-08-14 20:44:08 0000 -------
Created an attachment (id=16123) [details]
patch to fix compiling on other processors than pentium

apply patch with:

cd /usr/portage/app-emulation/psemu-peopsspu
patch < psemu-peopsspu-1.0.7-r1.ebuild.diff

------- Comment #2 From Chris Gianelloni (RETIRED) 2003-08-15 05:37:56 0000 -------
This is your error:

dma.c:64: internal error: Floating point exception

This has nothing to do with the -mpentium being in the source, at least at first glance.  Have you tried removing the -mpentium from the Makefile and compiling it by hand to see if it fails?  If removing the flag solves the problem, then I'll modify the ebuild to fix the Makefile.

------- Comment #3 From Matthias Langhammer 2003-08-15 06:00:23 0000 -------
Yes, I tried it.
Removing the "-mpentium" from the Makefile fixes the build on my "-march=athlon-tbird".

Seems that gcc gets confused how to optimize the code if there is "-march=athlon-tbird -mpentium" together.

The modified sed-expression in my .diff removes the -mpentium from the Makefile. This will have no bad sideeffects to anybody, because every normal gentoo-user with a pentium processor has his "-mpentium" or better "-march=pentium" in his CFLAGS.

Please remove the flag from the Makefile. I think there are many people without pentium processor out there ;-)

------- Comment #4 From Chris Gianelloni (RETIRED) 2003-08-15 06:31:26 0000 -------
Fixed in CVS

------- Comment #5 From SpanKY 2003-08-21 17:27:42 0000 -------
http://bugs.gentoo.org/show_bug.cgi?id=25461#c6 explains the issue better :)