Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 80668 - media-libs/svgalib fix for gcc 4.0.0 alpha
Summary: media-libs/svgalib fix for gcc 4.0.0 alpha
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-03 19:43 UTC by Peter Gordon (RETIRED)
Modified: 2005-04-24 21:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
svgalib-1.9.19-apm-fix-lvalues.diff (svgalib-1.9.19-apm-fix-lvalues.diff,1.08 KB, patch)
2005-02-03 19:45 UTC, Peter Gordon (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gordon (RETIRED) gentoo-dev 2005-02-03 19:43:42 UTC
This is a patch I made to fix the lvalues errors in the ./src/drivers/apm.c file. 

I added the epatch line right before the last sed in the src_unpack function of the ebuild:

--- Begin Snip ---
        # devfs_mk_symlink no longer available #77186
        epatch ${FILESDIR}/${P}-devfs.patch

        # gcc 4.0.0 lvalues fix
        epatch ${FILESDIR}/${P}-apm-fix-lvalues.diff

        # Link like the other packages
        sed -i 's:$(FLAGS):$(CFLAGS) $(LDFLAGS):' demos/Makefile || die
--- End Snip ---

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-4.0.0,
glibc-2.3.4.20041102-r0, 2.6.10-ac11 i686)
=================================================================
System uname: 2.6.10-ac11 i686 AMD Athlon(tm) processor
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.4,dev-lang/python-2.3.4 [2.4 (#1, Jan  8
2005, 19:04:36)]
ccache version 2.3 [enabled]
dev-lang/python:     2.4, 2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.6.3, 1.8.5-r3, 1.9.4, 1.5, 1.7.9-r1, 1.4_p6
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-tbird -mtune=athlon-tbird -fomit-frame-pointer -pipe"
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 /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-tbird -mtune=athlon-tbird -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo
http://distro.ibiblio.org/pub/Linux/distributions/gentoo/
http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowex X X509 aac aalib alsa apache2 apm audiofile avi
bash-completion bcmath bidi bindist bitmap-fonts bmp bzip2 bzlib calendar
cdparanoia chroot cpdflib crypt cscope ctype cups curl curlwrappers dba dbx
directfb encode erandom exif fam fbcon flac font-server foomaticdb fortran ftp
gcj gd gdbm ggi gif gimpprint glitz glut gnutls gpm gtk gtk2 gtkhtml hal iconv
imap imlib innodb ipv6 java javacomm javascript jikes jpeg ldap libcaca live lua
mad md5sum mhash mikmod mime ming mmap mmx mmx2 mng mozdevelop mozilla mozsvg
mozxmlterm mp3 mpeg mpi mplayer mysql mysqli ncurses nls nptl nptlonly nvidia
objc offensive oggvorbis opengl openntpd pam parse-clocks pcmcia pcre perl php
pic png pnp posix ppds pwdb python readline real ruby sasl sdk sdl session silc
simplexml skey sndfile sockets speex spell sqlite ssl stroke svg svga sysvipc
tcltk tcpd tetex theora threads tidy tiff tokenizer truetype truetype-fonts
type1-fonts unicode usb wddx wmf xine xml xml2 xpm xprint xsl xv xvid zlib
video_cards_nvidia"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL
Comment 1 Peter Gordon (RETIRED) gentoo-dev 2005-02-03 19:45:45 UTC
Created attachment 50297 [details, diff]
svgalib-1.9.19-apm-fix-lvalues.diff

This fixes the errors in ./src/drivers/apm.c by changing it so that instead of
type-casting after the variables are assigned, the value which they are
assigned is type-casted first.
Comment 2 SpanKY gentoo-dev 2005-02-06 13:05:30 UTC
thanks, added to -r3
Comment 3 SpanKY gentoo-dev 2005-03-14 07:09:26 UTC
patch is incorrect
Comment 4 Peter Gordon (RETIRED) gentoo-dev 2005-03-14 18:32:07 UTC
SpanKY: Are you sure? What's wrong with it? It's a few simple compile-time fixes. It works nicely on my box (and has been for a while)...
Comment 5 SpanKY gentoo-dev 2005-03-14 19:53:36 UTC
because the left hand casting like that is to change the size of the memory the pointer refers to

regs is an array of unsigned char ... so regs[APMREG_SAVE(18)] refers to 1 byte but (unsigned long)regs[APMREG_SAVE(18)] refers to 8 bytes (assuming sizeof(long) == 8)

plus the upstream author told me the patch was incorrect :)
Comment 6 Peter Gordon (RETIRED) gentoo-dev 2005-03-14 20:33:32 UTC
Crud. Sorry about that. I'm mainly a PHP & C++ guy, and that looked like it fixed it. >_< Hmmm. Should we just wait for an upstream patch in this case then?
Comment 7 SpanKY gentoo-dev 2005-03-14 20:37:21 UTC
i'm inclined to do that ... i dont enjoy hacking on svgalib personally ;)
Comment 8 SpanKY gentoo-dev 2005-04-24 00:55:34 UTC
1.9.21 is now in portage ... it has a slightly different fix for this issue
Comment 9 Peter Gordon (RETIRED) gentoo-dev 2005-04-24 21:33:59 UTC
Heh. Excellent. Thank you vapier. :-)