Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
View Bug Activity | Format For Printing | XML | Clone This Bug
After emerging Duke Nukem 3D (duke3d-20040817.ebuild) I found out that while it compiles fine it refuses to start with the message "Not enough memory for file grouping system". Reproducible: Always Steps to Reproduce: 1. 2. 3. After some digging I found that there is an endianness problem - game does necessary byte-swapping only on Mac. Below is the patch that solved the problem for me. ------------------------------ duke3d-20040817-endian_patch --- duke3d/source/buildengine/platform.h 2003-08-07 12:06:17.000000000+0200 +++ duke3d.new/source/buildengine/platform.h 2004-08-24 18:35:05.292291088+0200 @@ -5,6 +5,7 @@ #include "win32_compat.h" #elif (defined PLATFORM_UNIX) #include "unix_compat.h" +#include <endian.h> #elif (defined PLATFORM_DOS) #include "doscmpat.h" #else @@ -60,9 +61,15 @@ #define BUILDSWAP_INTEL16(x) _swap16(x) #define BUILDSWAP_INTEL32(x) _swap32(x) #else +#if __BYTE_ORDER == __LITTLE_ENDIAN #define PLATFORM_LITTLEENDIAN 1 #define BUILDSWAP_INTEL16(x) (x) #define BUILDSWAP_INTEL32(x) (x) +#else +#define PLATFORM_BIGENDIAN 1 +#define BUILDSWAP_INTEL16(x) _swap16(x) +#define BUILDSWAP_INTEL32(x) _swap32(x) +#endif #endif extern int has_altivec; /* PowerPC-specific. */ -----------------------------------------------------------
Created an attachment (id=38105) [edit] duke3d-20040817-endian_patch
Just curious, but have you checked to see if this has been fixed upstream?
Nope. I just wanted to see it running on my machine _now_ ;)
Curious, the homepage just describes a Linux/x86 and a Mac OS X/ppc port. No Linux/ppc port. So I'm not sure if it will run on Linux/ppc. dholm, you set the ~ppc keyword. Tell us more ;-)
Well... Without the change I did it compiled but crashed (wrong byte swapping due to wrong endianness). After the change it starts fine, plays the intros etc. Then I started the game - it worked too but not fast enough as for my liking so I played for maybe two minutes and quited. So for me - now it is properly marked as ~ppc as it does run to some extent.
awesome, added to cvs, thanks ... also e-mailed it upstream
(This is in the upstream CVS now. Thanks for the patch!) --ryan.