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

Bug 119208

Summary: wolfgl doesn't compile with GCC4
Product: Gentoo Linux Reporter: Avuton Olrich <avuton>
Component: [OLD] GamesAssignee: Gentoo Games <games>
Status: RESOLVED FIXED    
Severity: normal CC: chainsaw, vanquirius
Priority: High    
Version: 2005.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 117482    
Attachments: wolfgl-0.93-gcc4.patch
wolfgl-0.93-gcc4.patch

Description Avuton Olrich 2006-01-16 09:20:32 UTC
Hello,

I got a compile error, I'm relatively sure it's due to GCC4, but here's the error:

gcc -I. -I../common -I/usr/local/include -D_LINUX -Wimplicit -D_SPEAR_DEMO_ -march=i686 -O2 -ffast-math -pipe -DDATADIR=\"/usr/share/games/wolfgl\" -c ../common/id_ca.c -o sdm/obj/id_ca.o
../common/id_ca.c: In function 'CAL_CarmackExpand':
../common/id_ca.c:271: error: invalid lvalue in increment
../common/id_ca.c:277: error: invalid lvalue in increment
../common/id_ca.c:290: error: invalid lvalue in increment
../common/id_ca.c: In function 'CA_UpLevel':
../common/id_ca.c:809: error: invalid lvalue in unary '&'
../common/id_ca.c: In function 'CA_SetAllPurge':
../common/id_ca.c:865: error: invalid lvalue in unary '&'
make[2]: *** [sdm/obj/id_ca.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/wolfgl-0.93-r1/work/wolfgl-0.93/linux'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/var/tmp/portage/wolfgl-0.93-r1/work/wolfgl-0.93/linux/SDM'
make: *** [all] Error 2


micromachine files # emerge info
Portage 2.1_pre3-r1 (default-linux/x86/2005.0, gcc-4.0.2, glibc-2.3.6-r2, 2.6.15-rc5-mm1 i686)
=================================================================
System uname: 2.6.15-rc5-mm1 i686 Transmeta(tm) Crusoe(tm) Processor TM5800
Gentoo Base System version 1.12.0_pre13
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -ffast-math -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=i686 -O2 -ffast-math -pipe"
DISTDIR="/usr/distfiles"
FEATURES="autoconfig ccache digest distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 7zip X a52 aac aalib acl acpi aim alsa ao apache2 audiofile avi bash-completion berkdb bitmap-fonts bootsplash bzip2 c++ cairo calendar cardbus cdda cddb cdparanoia cdr cgi chroot crypt css cups curl dbus dhcp dvd dvdread encode ethereal exif expat fam ffmpeg firefox flac foomaticdb ftp gcj gd gdbm gif gimp glut gmp gnutls gpm gstreamer gzip hal http httpd icecast iconv icq idn imagemagick imlib imlib2 irssi jabber java javascript jp2 jpeg jpeg2k kde lcms libgd libwww logrotate mad mhash mikmod mime mmx mng mono motif mouse moznomail mozsvg mp3 mpeg mpeg2 mplayer mpm-prefork msn mysql ncurses net network nfs nls no-old-linux no-suexec nocd nptl nptlonly nsplugin ntfs offensive ogg opengl openssl oscar pam pcmcia pcre pda pdf pdflib perl php png python qt quicktime rar readline real reiser4 reiserfs rtc scp sdl search-screen sharedmem slang speex spell ssl subversion svg svgz sysfs szip tcltk tetex theora threads tiff transcode truetype truetype-fonts type1 type1-fonts udev unicode usb utf8 uudeview vidix vim vim-pager vim-with-x vorbis wifi win32codecs wma123 wmf wordperfect xfs xine xosd xrandr xscreensaver xv xvid yahoo zip zlib elibc_glibc kernel_linux userland_GNU video_cards_radeon"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2006-01-16 09:33:31 UTC
gcc4 isn't supported yet so unless you have a patch, I'm marking this LATER.  Reopen if you have a patch.
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-16 10:43:37 UTC
I'm reopening this since the toolchain team *want* to see these.

http://article.gmane.org/gmane.linux.gentoo.devel/34696
Comment 3 Marcelo Goes (RETIRED) gentoo-dev 2006-01-16 13:13:00 UTC
Created attachment 77292 [details, diff]
wolfgl-0.93-gcc4.patch

does not fix all problems
Comment 4 Marcelo Goes (RETIRED) gentoo-dev 2006-01-16 14:21:14 UTC
Created attachment 77296 [details, diff]
wolfgl-0.93-gcc4.patch

Please test.
Comment 5 Marcelo Goes (RETIRED) gentoo-dev 2006-01-17 09:58:43 UTC
While at it, you may want to fix this for modular X.

``linking_libs.sh`` does not show anything.
``included_headers.sh`` shows:

Headers ignored because they weren't found:

windows.h

Absolute headers:

sys-libs/glibc-2.3.6-r2
x11-proto/xproto-7.0.4
media-libs/mesa-6.4.1-r1
sys-kernel/linux-headers-2.6.11-r3
Comment 6 Avuton Olrich 2006-01-17 15:02:01 UTC
Thanks for the patch, it compiles, but I can't run it until my emerge -e world is complete :(. I will reply as soon as possible, unless someone else does first.
Comment 7 Tony Vroon (RETIRED) gentoo-dev 2006-01-22 07:25:06 UTC
(In reply to comment #4)
> Created an attachment (id=77296) [edit]
> wolfgl-0.93-gcc4.patch
> 
> Please test.

Although this fixed compilation on my AMD64 GCC 4.0.2 machine, the resulting executable did not launch the game succesfully. Fair enough, it wasn't keyworded ~amd64, so I tested on an ~x86 machine with GCC 3.4.4 to make sure that no regressions were introduced.
I'm sorry to report that this breaks things, two attempts to launch the game succeeded, but an explosion occured when attempting to actually select New Game and a difficulty level:
chainsaw@metis /cvs/gentoo-x86/games-fps/wolfgl $ wolfgl-wl1
WolfGL startup
configured audio device
sound module ready
OpenGL version 1.2 Mesa 6.2.1
Mesa DRI Radeon 20040929 AGP 2x x86/MMX/SSE NO-TCL
*** glibc detected *** free(): invalid next size (normal): 0x08251e30 ***
Segmentation fault

chainsaw@metis /cvs/gentoo-x86/games-fps/wolfgl $ wolfgl-wl1
WolfGL startup
configured audio device
sound module ready
OpenGL version 1.2 Mesa 6.2.1
Mesa DRI Radeon 20040929 AGP 2x x86/MMX/SSE NO-TCL
Segmentation fault

Details about the machine:
Portage 2.0.53_rc7 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r3, 2.6.15-git11 i686)
=================================================================
System uname: 2.6.15-git11 i686 Intel(R) Pentium(R) III Mobile CPU      1000MHz
Gentoo Base System version 1.12.0_pre11
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20-r1
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3m -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig cvs digest distlocks fixpackages sandbox sfperms sign"
GENTOO_MIRRORS="ftp://ftp.heanet.ie/pub/gentoo/"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/cvs/gentoo-x86/"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="x86 16bit S3TC X X509 a52 aac aalib acpi aim alsa ao aotuv asm audacious audiofile avi bash bash-completion
beepmp berkdb bitmap-fonts bonobo bzip2 bzlib cairo cdda cddb cdio cdparanoia cdr codecs crypt css cups curl dbus
djbfft dpms dts dv dvd ecc eds elf encode erandom ethereal evo evo2 exif expat faad fam fame fb fbcon ffmpeg fftw
firefox flac flash font-server foomaticdb fpx freetype ftp gb gcj gdbm gif glitz glut gnome gnomedb gnutls gphoto2
gstreamer gtk gtk2 gtkhtml hal howl icq idn imap imlib imlib2 inifile ipv6 irc jabber java jbig jce jikes jpeg
kdgraphics kerberos krb4 lcms libcaca libg++ libsamplerate libwww live lzo lzw mad maildir matroska md5sum mikmod
mjpeg mmap mmx mmxext mng modplug monkey mono moznomail mozsvg mp3 mpeg mpeg4 mplayer msn musepack native nautilus
ncurses nls nptl nptlonly ntlm ode ogg oggvorbis openal opengl oscar pam pcmcia pcre pdflib perl physfs pic png pnp
posix ppds python quicktime readline real rtc samba sdl serial sid silc slp smime sndfile spell sse ssl
stencil-buffer svg svgz symlink sysfs sysvipc szip tcltk tga theora tiff timidity transcode truetype truetype-fonts
type1-fonts udev unicode ups uptimed usb utf8 vcd vidix vorbis wifi win32codecs wma wma123 wmf xanim xine xml2 xprint
xscreensaver xv xvid yv12 zeroconf zlib zvbi userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS

The regular wolfgl ebuild with no patches applies is able to compile and run succesfully. Stress testing; level 1 -> level 10 -> level 2; which is a lot further then the patched version came.
Comment 8 Marcelo Goes (RETIRED) gentoo-dev 2006-01-22 10:54:14 UTC
I think the problem is related to this:

-				offset = *((unsigned char*)inptr)++;
+				offset = *((unsigned char*)inptr);
+				inptr += sizeof (unsigned char);

By I think, I mean I have confirmed it by having the binary segfault after making this change. Unfortunately, I don't think I know how to fix this. I already tried moving inptr +=... above offset =..., using sizeof (unsigned short), but no dice.
Comment 9 Mark Loeser (RETIRED) gentoo-dev 2006-01-28 16:02:07 UTC
I redid the patch.  Fixed in CVS.