Back to the Vavoom Forum Archives


Forum

[Fixed] GCC 4.1 support ?

Wed, 09 Aug 2006 15:14:22

dapsaille

Hi, First ... i'm so excited to replay my old strife cdrom under linux .. that i am doing a chroot32 on my gentoo amd64 box only for use your software :p Really thanks .. But WE have problems (users of gentoo) with gcc 4.1 for compile it under amd64 (i know that gcc 4.1 is not ready and you may have other things to do for improve this software than adapt it to unsupported compilers). It could be really cool if you can adapt it to gcc 4.1 (and again sorry because i know that this kind of request is a little out of subject .... Thanks again and good work ^^
Wed, 09 Aug 2006 16:48:13

Janis Legzdinsh

What's the problem? I've been using gcc 4.1.1 for some time now without problems.
Wed, 09 Aug 2006 16:58:59

dapsaille

Hey .. thanks for your quick response :p I use x86-64 gentoo and i have seen on your forum a problem like me .. the answer was gcc 4.1 .. emerge info Portage 2.1.1_pre4-r4 (default-linux/amd64/2006.0, gcc-4.1.1/amd64-vanilla, glibc-2.4-r3, 2.6.17-gentoo-r4 x86_64) ================================================================= System uname: 2.6.17-gentoo-r4 x86_64 Mobile AMD Athlon(tm) 64 Processor 2800+ Gentoo Base System version 1.12.4 Last Sync: Wed, 09 Aug 2006 10:30:01 +0000 ccache version 2.4 [enabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r2 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 2.0.0_rc1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.16 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O4 -mmmx -msse -msse2 -m3dnow -mfpmath=sse,387 -ftree-vectorize -march=athlon64 -ffast-math -funroll-loops -fexpensive-optimizations -frerun-loop-opt -fthread-jumps -fforce-addr -frerun-cse-after-loop -fomit-frame-pointer -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo" CXXFLAGS="-O4 -mmmx -msse -msse2 -m3dnow -mfpmath=sse,387 -ftree-vectorize -march=athlon64 -ffast-math -funroll-loops -fexpensive-optimizations -frerun-loop-opt -fthread-jumps -fforce-addr -frerun-cse-after-loop -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org <!-- m --><a class="postlink" href="http://distro.ibiblio.org/pub/linux/distributions/gentoo">http://distro.ibiblio.org/pub/linux/dis ... ons/gentoo</a><!-- m -->" LINGUAS="fr FR fr_FR FR_fr" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X acpi alsa avi berkdb bitmap-fonts browserplugin cdinstall cli crypt dbus dlloader dri dvd dvd+rw dvdrw eds elibc_glibc emboss encode foomaticdb fortran gif gpm gstreamer gtk gtk2 hal hald imlib input_devices_keyboard input_devices_mouse ipv6 isdnlog java jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux linguas_FR linguas_FR_fr linguas_fr linguas_fr_FR lzw lzw-tiff mp3 mpeg ncurses nls nowin nptl nptlonly nsplugin ogg opengl oss pam pcmcia pcre pdflib perl png pppd python qt qt3 qt4 quicktime readline reflection sdl session spell spl tcpd tiff timidity truetype-fonts type1-fonts usb userland_GNU video_cards_ati video_cards_fglrx video_cards_vesa video_cards_vga vorbis xorg xpm xv zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS Compilation from vavoom-1.21.1 from your website (ebuilds don't work for me too) ./configure OK ./make stop here = make[1]: Entering directory `/home/florent/vavoom-1.21.1/utils/fixmd2' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/florent/vavoom-1.21.1/utils/fixmd2' g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/d_part.o source/d_part.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/d_polyse.o source/d_polyse.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/d_scache.o source/d_scache.cpp source/d_scache.cpp: In member function 'surfcache_t* VSoftwareDrawer::SCAlloc(int, int)': source/d_scache.cpp:202: error: cast from 'byte*' to 'int' loses precision make: *** [obj/d_scache.o] Error 1 localhost vavoom-1.21.1 # Hope thoose informations will be suffiscients .. EDIT=After reading others posts of this sub-forum .. i fell so embarassed .. you all know a lot about this engine .. and i'm crying for a broken compilation .. gulps <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
Thu, 10 Aug 2006 16:58:58

Janis Legzdinsh

Try this patch:
Index: source/d_scache.cpp
===================================================================
--- source/d_scache.cpp (revision 1646)
+++ source/d_scache.cpp (working copy)
@@ -199,7 +199,7 @@
        if ((height < 0) || (height > 256))
                Sys_Error("D_SCAlloc: bad cache height %d\n", height);

-       size = (int)&((surfcache_t *)0)->data[size];
+       size = &((surfcache_t *)0)->data[size] - (vuint8*)0;
        size = (size + 3) & ~3;
        if (size > sc_size)
                Sys_Error("D_SCAlloc: %i > cache size", size);
Thu, 10 Aug 2006 20:36:26

dapsaille

Hey .. i'm really impressed by your quick response :p Compilation go but hang here ... g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/sbar.o source/sbar.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/sc_man.o source/sc_man.cpp source/sc_man.cpp: In function 'void OpenScript(const char*, int, int)': source/sc_man.cpp:188: warning: comparison is always false due to limited range of data type source/sc_man.cpp:188: warning: comparison is always false due to limited range of data type source/sc_man.cpp:188: warning: comparison is always false due to limited range of data type g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/screen.o source/screen.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/sn_sonix.o source/sn_sonix.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/str.o source/str.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/stream.o source/stream.cpp g++ -c -DHAVE_INTTYPES_H=1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -o obj/sv_acs.o source/sv_acs.cpp source/sv_acs.cpp: In member function 'int VACS::RunScript(float)': source/sv_acs.cpp:3383: error: cast from 'vuint8*' to 'int' loses precision source/sv_acs.cpp:3385: error: cast from 'vuint8*' to 'int' loses precision make: *** [obj/sv_acs.o] Error 1 Maybee there is something wrong with my configuration ? i mean maybee i'm bothering you with problems who aren't ... Great Work :p EDIT=TYPO
Thu, 10 Aug 2006 21:18:50

scen

Same problems here, with a little more "stable" Gentoo installation <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
# emerge --info
Portage 2.1-r1 (default-linux/amd64/2006.0, gcc-4.1.1, glibc-2.3.6-r4, 2.6.17-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3800+
Gentoo Base System version 1.6.15
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
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-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.ngi.it http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ ftp://ftp.unina.it/pub/linux/distributions/gentoo"
LANG="it_IT@euro"
LC_ALL="it_IT@euro"
LINGUAS="it"
MAKEOPTS="-j2"
PKGDIR="/var/tmp/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X alsa arts avi berkdb bitmap-fonts cli crypt cups dlloader dri eds emboss encode flac foomaticdb fortran gif gpm gtk2 hal imlib isdnlog jpeg kde kdeenablefinal lzw lzw-tiff mp3 mpeg ncurses nls nptl ogg opengl pam pcre pdflib perl png pppd python qt qt3 quicktime readline reflection sdl session spell spl ssl tcpd theora tiff truetype truetype-fonts type1-fonts usb vorbis xml xorg xpm xv zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_penmount kernel_linux linguas_it userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
I've applied successfully the posted patch, but i run into the same error. I think the involved code lines in source/sv_acs.cpp are
[...]
ACSVM_CASE(PCD_CaseGotoSorted)
                        //      The count and jump table are 4-byte aligned.
                        if ((int)ip & 3) // <-- THIS LINE
                        {
                                ip += 4 - ((int)ip & 3); // <-- AND THIS LINE
                        }
                        {
                                int numcases = READ_INT32(ip);
[...]
[EDIT] I suggest to move the topic in "bug reports" section <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> [/EDIT]
Thu, 10 Aug 2006 23:34:15

dapsaille

[quote="scen":1hcoll3h]Same problems here, with a little more "stable" Gentoo installation <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
# emerge --info
Portage 2.1-r1 (default-linux/amd64/2006.0, gcc-4.1.1, glibc-2.3.6-r4, 2.6.17-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3800+
Gentoo Base System version 1.6.15
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
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-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.ngi.it http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ ftp://ftp.unina.it/pub/linux/distributions/gentoo"
LANG="it_IT@euro"
LC_ALL="it_IT@euro"
LINGUAS="it"
MAKEOPTS="-j2"
PKGDIR="/var/tmp/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X alsa arts avi berkdb bitmap-fonts cli crypt cups dlloader dri eds emboss encode flac foomaticdb fortran gif gpm gtk2 hal imlib isdnlog jpeg kde kdeenablefinal lzw lzw-tiff mp3 mpeg ncurses nls nptl ogg opengl pam pcre pdflib perl png pppd python qt qt3 quicktime readline reflection sdl session spell spl ssl tcpd theora tiff truetype truetype-fonts type1-fonts usb vorbis xml xorg xpm xv zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_penmount kernel_linux linguas_it userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
I've applied successfully the posted patch, but i run into the same error. I think the involved code lines in source/sv_acs.cpp are
[...]
ACSVM_CASE(PCD_CaseGotoSorted)
                        //      The count and jump table are 4-byte aligned.
                        if ((int)ip & 3) // <-- THIS LINE
                        {
                                ip += 4 - ((int)ip & 3); // <-- AND THIS LINE
                        }
                        {
                                int numcases = READ_INT32(ip);
[...]
[EDIT] I suggest to move the topic in "bug reports" section <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> [/EDIT] +1 for the topic move :p Happy (sort off) to see that it is not my optimisations who make this buzz ^^
Fri, 11 Aug 2006 11:50:55

Janis Legzdinsh

Next patch:
Index: source/sv_acs.cpp
===================================================================
--- source/sv_acs.cpp   (revision 1652)
+++ source/sv_acs.cpp   (working copy)
@@ -3380,9 +3380,9 @@

                ACSVM_CASE(PCD_CaseGotoSorted)
                        //      The count and jump table are 4-byte aligned.
-                       if ((int)ip & 3)
+                       if (ActiveObject->PtrToOffset(ip) & 3)
                        {
-                               ip += 4 - ((int)ip & 3);
+                               ip += 4 - (ActiveObject->PtrToOffset(ip) & 3);
                        }
                        {
                                int numcases = READ_INT32(ip);
Fri, 11 Aug 2006 14:08:39

scen

Ok, with these two patches vavoom-1.21.1 compiles fine with gcc-4.1.1 on x86 Gentoo Linux system! <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->
Sat, 12 Aug 2006 11:15:58

Janis Legzdinsh

Good to know that.

Back to the Vavoom Forum Archives