Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 146153

Summary: games-action/maelstrom-3.0.6-r1 fails to compile (not 64-bit clean?)
Product: Gentoo Linux Reporter: Randall Nortman <gentoobugs>
Component: [OLD] GamesAssignee: Gentoo Games <games>
Status: RESOLVED FIXED    
Severity: normal CC: amd64, pacho, richardvoigt
Priority: High    
Version: 2005.1   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 117482    
Attachments: emerge --info
ebuild that applies patch
patch error and all warnings

Description Randall Nortman 2006-09-03 09:29:57 UTC
I just updated to gcc-4.1.1 and rebuilt world, but maelstrom failed to compile:

x86_64-pc-linux-gnu-g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"Maelstrom\" -DVERSION=\"3.0.6\"  -I. -I.      -pipe -O2 -pipe -O2 -I/usr/include/SDL -D_REENTRANT -I.. -I../netlogic -I../screenlib -I../maclib -DLIBDIR=\"/usr/share/games/Maelstrom\" -c SDL_FrameBuf.cpp
SDL_FrameBuf.cpp: In member function 'void FrameBuf::AddDirtyRect(SDL_Rect*)':
SDL_FrameBuf.cpp:851: error: cast from 'SDL_Rect*' to 'int' loses precision
SDL_FrameBuf.cpp:851: error: cast from 'SDL_Rect*' to 'int' loses precision
SDL_FrameBuf.cpp:852: error: cast from 'SDL_Rect*' to 'int' loses precision
make[1]: *** [SDL_FrameBuf.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/maelstrom-3.0.6-r1/work/Maelstrom-3.0.6/screenlib'

Looks to me like this is an unsafe 64-bit pointer -> 32-bit integer cast.  I'm not sure why previous versions of gcc would have accepted this, but clearly I managed to build it before on this system.
Comment 1 Randall Nortman 2006-09-03 09:31:42 UTC
Created attachment 95851 [details]
emerge --info
Comment 2 Pacho Ramos gentoo-dev 2006-09-05 13:32:18 UTC
Same problem here after updating to gcc 4.1 and trying to compile it using this gcc version.
Comment 3 Richard Benjamin Voigt 2006-09-29 19:30:05 UTC
Patched it and it now works for me, providing a patch file and ebuild to throw into your PORTAGE_OVERLAY

If PORTAGE_OVERLAY is /usr/local/portage then you will need:
(Copied from /usr/portage)
/usr/local/portage/games-action/maelstrom/files/maelstrom-3.0.6-r1-security.patch
/usr/local/portage/games-action/maelstrom/files/maelstrom-gcc34.patch
(Provided here)
/usr/local/portage/games-action/maelstrom/files/maelstrom-gcc41.patch
/usr/local/portage/games-action/maelstrom/maelstrom-3.0.6-r1.ebuild
(Run "ebuild /usr/local/portage/games-action/maelstrom/maelstrom-3.0.6-r1.ebuild digest")
/usr/local/portage/games-action/maelstrom/Manifest
/usr/local/portage/games-action/maelstrom/files/digest-maelstrom-3.0.6-r1
Comment 4 Richard Benjamin Voigt 2006-09-29 19:30:50 UTC
Created attachment 98422 [details]
ebuild that applies patch

/usr/local/portage/games-action/maelstrom/maelstrom-3.0.6-r1.ebuild
Comment 5 Richard Benjamin Voigt 2006-09-29 19:31:30 UTC
Created attachment 98423 [details, diff]
patch error and all warnings

/usr/local/portage/games-action/maelstrom/files/maelstrom-gcc41.patch
Comment 6 Richard Benjamin Voigt 2006-09-29 19:44:16 UTC
Just submitted patch upstream as well.
Comment 7 Tupone Alfredo gentoo-dev 2006-10-25 13:55:37 UTC
Fix is in portage. Thanks for report and patch