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

Bug 114949

Summary: dosbox-0.63 fails to compile under gcc4.0.2 on amd64, patch needs to be applied
Product: Gentoo Linux Reporter: Gustavo Ribeiro Alves <gralves>
Component: [OLD] GCC PortingAssignee: Gentoo Games <games>
Status: RESOLVED FIXED    
Severity: normal CC: amd64, chainsaw, eradicator, gentoo-bugs, jkeiren, magnade
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 117482    
Attachments: Proposed patch
dosbox-gcc4.patch
dosbox-0.63-gcc4.patch

Description Gustavo Ribeiro Alves 2005-12-08 20:43:17 UTC
dosbox fails to build on amd 64. The following patch file needs to be applied
for it to work. The patch is taken from a newer version of dosbox cvs. All it
does is to change some unsafe casts.

Reproducible: Always
Steps to Reproduce:
Comment 1 Gustavo Ribeiro Alves 2005-12-08 20:44:18 UTC
Created attachment 74362 [details, diff]
Proposed patch
Comment 2 Gustavo Ribeiro Alves 2005-12-08 20:45:20 UTC
I forgot to mention, this bug is about dosbox 0.63.
Comment 3 SpanKY gentoo-dev 2005-12-09 05:37:12 UTC
can you repost the patch using `diff -u` please
Comment 4 Gustavo Ribeiro Alves 2005-12-09 08:46:11 UTC
I got the patch directly from dosbox cvs. I'll take a look at it today after work.
Comment 5 Gustavo Ribeiro Alves 2005-12-11 19:36:41 UTC
After more testing, I figured out that dosbox seens to be unstable on my machine
w/ these modifications. Right now I'm using the cvs head version. I think it
might be safer to wait until 0.64 (it seems that the dosbox team will release it
soon).
Comment 6 Joshua Baergen (RETIRED) gentoo-dev 2006-01-07 15:42:31 UTC
Created attachment 76491 [details, diff]
dosbox-gcc4.patch

This is all it took for me to get it to compile on 4.1.  It should work for 4.0.x too.
Comment 7 Tony Vroon (RETIRED) gentoo-dev 2006-01-22 06:35:31 UTC
(In reply to comment #6)
> Created an attachment (id=76491) [edit]
> dosbox-gcc4.patch
> 
> This is all it took for me to get it to compile on 4.1.  It should work for
> 4.0.x too.

Sorry, it doesn't work for me:
drive_cache.cpp: In member function 
Comment 8 Tony Vroon (RETIRED) gentoo-dev 2006-01-22 06:35:31 UTC
(In reply to comment #6)
> Created an attachment (id=76491) [edit]
> dosbox-gcc4.patch
> 
> This is all it took for me to get it to compile on 4.1.  It should work for
> 4.0.x too.

Sorry, it doesn't work for me:
drive_cache.cpp: In member function int DOS_Drive_Cache::CompareShortname(const char*, const char*):
drive_cache.cpp:320: error: cast from char* to int loses precision
drive_cache.cpp:320: error: cast from const char* to int loses precision
drive_cache.cpp:322: error: cast from char* to int loses precision
drive_cache.cpp:322: error: cast from char* to int loses precision
drive_cache.cpp:325: error: cast from char* to int loses precision
drive_cache.cpp:325: error: cast from const char* to int loses precision
make[3]: *** [drive_cache.o] Error 1

Portage 2.1_pre3-r1 (default-linux/amd64/2005.1, gcc-4.0.2, glibc-2.3.6-r2, 2.6.16-rc1 x86_64)
=================================================================
System uname: 2.6.16-rc1 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+
Gentoo Base System version 1.12.0_pre15
dev-lang/python:     2.3.5, 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-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer"
DISTDIR="/store/distfiles"
FEATURES="autoaddcvs autoconfig cvs distlocks sandbox sfperms sign"
GENTOO_MIRRORS="ftp://ftp.heanet.ie/pub/gentoo/"
LC_ALL="en_IE.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/cvs/gentoo-x86"
PORTDIR_OVERLAY="/cvs/gentopia /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 16bit S3TC X a52 aac aalib acpi adns aim alsa ao aotuv apache2 audacious audiofile avi bash-completion berkdb bitmap-fonts bl browserplugin bzip2 cairo cddb cdio cdparanoia cdr crypt cups curl dbus dlloader dpms dri dts dvd dvdr ecc eds elf emboss encode erandom ethereal evo exif expat fam fat fbcon fbsplash ffmpeg fftw firefox flac fmod foomaticdb fpx freetype ftp gcj gd gdbm gif glitz glut gnome gnome-print gnomecanvas gnutls gpm gstreamer gtk gtk2 gtkhtml gzip hal howl icq id3 idn ieee1394 imagemagick imap imlib imlib2 inifile ipv6 irc java jce john jp2 jpeg jpeg2k kerberos lame lcms ldap libcaca libsamplerate libvisual libwww lirc live lm_sensors logrotate lzo lzw lzw-tiff mad matroska md5sum mhash mikmod mjpeg mmap mng mod modplug mozsvg mp3 mpeg mpeg2 mpeg4 mplayer musepack musicbrainz nautilus ncurses network nls no-old-linux nptl nsplugin ntlm ogg oggvorbis openal opengl openssl oscar pam pccts pcre pdflib perl physfs pic png pnp python quicktime rar rdesktop readline real recode rtc ruby sdl sensord sid silc slang sndfile speex spell ssl stencil-buffer svg svgz symlink sysfs tcltk theora tiff timidity transcode truetype truetype-fonts type1-fonts udev unicode ups usb v4l2 vcd vorbis wifi wma wmf xanim xine xinerama xml2 xpm xprint xsl xslt xv xvid yahoo yv12 zeroconf zip zlib zvbi elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS
Comment 9 Bret Towe 2006-01-22 14:36:43 UTC
applying both attached patchs works fine for me here
it loaded and i could look around  i seemed to of misplaced
my dosbox stuff tho so i couldnt do any real testing

Portage 2.1_pre3-r1 (default-linux/amd64/2005.0, gcc-4.0.2, glibc-2.3.6-r1, 2.6.16-rc1-git4 x86_64)
=================================================================
System uname: 2.6.16-rc1-git4 x86_64 AMD Athlon(tm) 64 Processor 2800+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
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.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages sandbox sfperms"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/mdhd/portage.local"
SYNC="rsync://vox.net/gentoo-portage"
USE="amd64 X a52 aac alsa audiofile avi berkdb bitmap-fonts bzip2 canna cdr cjk cli crypt curl dmx dri dv dvb dvd dvdread eds emboss esd exif expat fam fbcon fbdev flac foomaticdb gd glut gmp gnome gstreamer gtk gtk2 gtkhtml idn imagemagick imlib ipv6 jpeg kde lcms libwww live lua lzw lzw-tiff mad matroska mhash mng motif mozilla mp3 mpeg ncurses nls nptl nptlonly ogg oggvorbis openal opengl pam pcre pdflib perl php png python qt quicktime readline real recode samba sdl speex spell ssl svg tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales v4l v4l2 vcd vorbis wmf xine xinerama xml2 xmms xpm xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, LC_ALL, LINGUAS
Comment 10 Patrick McLean gentoo-dev 2006-03-01 21:13:21 UTC
Created attachment 81087 [details, diff]
dosbox-0.63-gcc4.patch

This is all I needed to change to get it to compile with gcc-4.0.2-r3
Comment 11 Gustavo Ribeiro Alves 2006-03-12 21:09:17 UTC
I did some testing and it seems that the unstability was caused by the binary ati-drivers. I think the patches are safe.
Comment 12 Mark Loeser (RETIRED) gentoo-dev 2006-03-14 15:30:02 UTC
*** Bug 126222 has been marked as a duplicate of this bug. ***
Comment 13 Jeremy Huddleston (RETIRED) gentoo-dev 2006-03-19 03:22:59 UTC
Fixed in cvs.
Comment 14 Mr. Bones. (RETIRED) gentoo-dev 2006-03-19 23:26:43 UTC
*** Bug 126902 has been marked as a duplicate of this bug. ***