Bug 133538 - games-strategy/freelords-0.3.7 does not compile with gcc-4.1; patch inside + patch for a freelordsrc problem
|
Bug#:
133538
|
Product: Gentoo Linux
|
Version: 2006.0
|
Platform: All
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: games@gentoo.org
|
Reported By: aballier@gentoo.org
|
|
Component: Games
|
|
|
URL:
|
|
Summary: games-strategy/freelords-0.3.7 does not compile with gcc-4.1; patch inside + patch for a freelordsrc problem
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2006-05-16 14:25 0000
|
I've encoutered compile time problems, and runtime problems; two patches will
follow, fixing it for me.
Here is my emerge --info (This is weird, it shows gcc beta but I've 4.1-r1):
Portage 2.1_rc1-r2 (default-linux/amd64/2006.0, gcc-4.1.0-beta20060106,
glibc-2.4-r3, 2.6.16 x86_64)
=================================================================
System uname: 2.6.16 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.12.0_pre19
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disabled]
ccache version 2.4 [enabled]
dev-lang/python: 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache: 2.4-r1
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-r2
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="-march=athlon64 -O2 -pipe -funroll-loops"
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.5/env
/usr/kde/3.5/share/config /usr/kde/3.5/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/eselect/compiler /etc/gconf /etc/terminfo
/etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe -funroll-loops"
DISTDIR="/share/distfiles"
FEATURES="autoconfig buildsyspkg ccache distlocks fixpackages metadata-transfer
sfperms strict userpriv"
GENTOO_MIRRORS="http://mir.zyrianes.net/gentoo/
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
MAKEOPTS="-j5"
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 a52 aac aalib alsa apache2 audiofile avi bash-completion berkdb
bitmap-fonts bluetooth bzip2 cddb cdr cli crypt cups custom-cflags dba directfb
divx4linux dri dv dvd dvdr dvdread eds emboss encode escreen faad fbdev ffmpeg
flac foomaticdb fortran fping gd gif gimp gnutls gpm gstreamer gtk gtk2 hal ide
imagemagick imap imlib ipv6 irmc isdnlog ithreads jpeg jpeg2k latex lcms
libcaca lirc lzo lzw lzw-tiff mad maildir mozilla mp3 mp4 mpeg mplayer myqsl
mysql ncurses nls nowin nptl nptlonly nsplugin nvidia offensive ogg oggvorbis
opengl opie pam pcre pdflib perl png ppds pppd python quicktime readline
reflection rtc samba sdl session slang sms softmmu spell spl ssl stroke
subtitles subversion tcpd threads tiff truetype truetype-fonts type1-fonts udev
unicode usb utf8 v4l2 vchroot vorbis x264 xml2 xorg xpm xprint xv xvid xvmc
zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux
userland_GNU video_cards_vesa video_cards_nv video_cards_nvidia"
Unset: ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS,
PORTAGE_RSYNC_EXTRA_OPTS
Created an attachment (id=86882) [details]
The patch for compile time problems.
It's mostly trivial fixes. All changes but the "int -> long" should be arch
independant.
The int -> long is an amd64 specific fix, a pointer was casted into an int,
what caused a compile error. Casting it into a long fixes the issue and should
also be arch independant.
Created an attachment (id=86885) [details]
The freelordsrc patch.
freelordsrc generation was not good for the savegame dir, what caused problem
with perms when trying to run freelords because it tried to write to
/var/tmp/portage/....
This patch simply removes the line about savegames location, by default they go
to ~/.freelords/ so that solves the issue.
I confirm that freelords fails to compile with gcc-4.1.1
v1.5 of the ebuild freelords-0.3.7 has this line
epatch "${FILESDIR}/${P}"-gcc41.patch
but your new version (based on 1.4 apparently) has
epatch ${FILESDIR}/${P}.gcc41.patch
So apparently there are already some patches for gcc-4.1, which maybe aren't
used? Should your patch be appended to this file or replace it or something
other? Did you send a patch to the freelords developers?
I've had a look at the patch in portage, it is the same as the one I submitted
but without the amd64 fix. The dev who added this patch probably did not look
for bugs here.
I've not sent it upstream since it's only trivial fixes.
hmm, it's been three months and this patch has still not been merged :(
Specifically this patch is missing from portage:
diff -N -u -r freelords-0.3.7-old/src/OptionsDialog.cpp
freelords-0.3.7/src/OptionsDialog.cpp
--- freelords-0.3.7-old/src/OptionsDialog.cpp 2006-05-16 22:38:32.921421416
+0200
+++ freelords-0.3.7/src/OptionsDialog.cpp 2006-05-16 22:46:17.083151544
+0200
@@ -245,7 +245,7 @@
d_smooth_scrolling->Hide();
d_show_next_player->Hide();
- unsigned int mode = (unsigned int)item->GetUserData();
+ unsigned long mode = (unsigned long)item->GetUserData();
switch(mode)
{
Using Alexis' ebuild and patches freelords compiles and runs. I did get a
segmentation fault when clicking languages.
In fact 0.3.4 does not compile with gcc 4.1 either. This means that the stable
ebuild cannot be compiled on a regular stable system any more :(
(Unfortunately, I do not have time at the moment to see whether the patch
provided applies cleanly to 0.3.4).
Updated GCC 4.1.1 patch and added the other patch... emerge --sync in an hour
to get the newer version... I am also marking it stable where necessary so it
will work with the stable tree...