Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120801 - djvu-3.5.16 fails to build with gcc 4.1
Summary: djvu-3.5.16 fails to build with gcc 4.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Text-Markup Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-29 02:31 UTC by Kristiaan Lenaerts
Modified: 2006-01-31 06:14 UTC (History)
1 user (show)

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


Attachments
djvu-3.5.16-gcc41.patch (djvu-3.5.16-gcc41.patch,1.08 KB, patch)
2006-01-29 02:32 UTC, Kristiaan Lenaerts
Details | Diff
djvu-3.5.16-gcc41-hash.patch (djvu-3.5.16-gcc41-hash.patch,4.06 KB, patch)
2006-01-29 02:33 UTC, Kristiaan Lenaerts
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kristiaan Lenaerts 2006-01-29 02:31:43 UTC
djvu 3.5.16 doesn't compile on gcc 4.1. First it bails out with some "extra qualification in C++ headers" errors (easy fix, in djvu-3.5.16-gcc41.patch that I'll attach), but after solving that is fails with the error below.

After looking in GContainer.h and related files, is seems that gcc just can't find the right hash-function, they are defined in GContainer.h, at the end. Instead it insists in using a hash()-function declared in GPixmap.h, that only takes a const DJVU::GPixel&. I solved this by moving the hash()-functions in GContainer.h to the front of the file, so gcc takes the right one.
I put this patch in djvu-3.5.16-gcc41-hash.patch, this makes reproducing a bit more easy. And I'm not sure if this last error is gcc 4.1 specific.

MAKEOPTS="-j1" emerge -av --oneshot djvu

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] app-text/djvu-3.5.16  USE="jpeg nls nsplugin threads tiff xml -debug -kde -qt" 0 kB

...

make[2]: Entering directory `/var/tmp/portage/djvu-3.5.16/work/djvulibre-3.5.16/gui/djview'
make[2]: Circular Makefile.dep <- Makefile.dep dependency dropped.
/usr/qt/3/bin/moc ../../gui/indep/QX/qx_imager.cpp -o qx_imager_moc.inc
i686-pc-linux-gnu-g++ -march=athlon-mp -pipe -ffriend-injection -fvisibility-inlines-hidden  -DHAVE_CONFIG_H -I../.. -I../../libdjvu -I./ -I../../gui/indep/QT/ -I../../gui/indep/QX/ -I../../gui/indep/utils/ -I../../gui/shared/QT/ -I../../gui/shared/res/ -I../../gui/shared/utils/  -I. -DNDEBUG -Wall -O3 -Wno-non-virtual-dtor -mtune=i686  -pthread -DTHREADMODEL=POSIXTHREADS -I/usr/qt/3/include -I/usr/X11R6/include -c ../../gui/indep/QX/qx_imager.cpp
distcc[15882] ERROR: compile /var/tmp/ccache/qx_imager.tmp.Cube.15878.ii on localhost failed
../../libdjvu/GContainer.h: In member function 
Comment 1 Kristiaan Lenaerts 2006-01-29 02:31:43 UTC
djvu 3.5.16 doesn't compile on gcc 4.1. First it bails out with some "extra qualification in C++ headers" errors (easy fix, in djvu-3.5.16-gcc41.patch that I'll attach), but after solving that is fails with the error below.

After looking in GContainer.h and related files, is seems that gcc just can't find the right hash-function, they are defined in GContainer.h, at the end. Instead it insists in using a hash()-function declared in GPixmap.h, that only takes a const DJVU::GPixel&. I solved this by moving the hash()-functions in GContainer.h to the front of the file, so gcc takes the right one.
I put this patch in djvu-3.5.16-gcc41-hash.patch, this makes reproducing a bit more easy. And I'm not sure if this last error is gcc 4.1 specific.

MAKEOPTS="-j1" emerge -av --oneshot djvu

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] app-text/djvu-3.5.16  USE="jpeg nls nsplugin threads tiff xml -debug -kde -qt" 0 kB

...

make[2]: Entering directory `/var/tmp/portage/djvu-3.5.16/work/djvulibre-3.5.16/gui/djview'
make[2]: Circular Makefile.dep <- Makefile.dep dependency dropped.
/usr/qt/3/bin/moc ../../gui/indep/QX/qx_imager.cpp -o qx_imager_moc.inc
i686-pc-linux-gnu-g++ -march=athlon-mp -pipe -ffriend-injection -fvisibility-inlines-hidden  -DHAVE_CONFIG_H -I../.. -I../../libdjvu -I./ -I../../gui/indep/QT/ -I../../gui/indep/QX/ -I../../gui/indep/utils/ -I../../gui/shared/QT/ -I../../gui/shared/res/ -I../../gui/shared/utils/  -I. -DNDEBUG -Wall -O3 -Wno-non-virtual-dtor -mtune=i686  -pthread -DTHREADMODEL=POSIXTHREADS -I/usr/qt/3/include -I/usr/X11R6/include -c ../../gui/indep/QX/qx_imager.cpp
distcc[15882] ERROR: compile /var/tmp/ccache/qx_imager.tmp.Cube.15878.ii on localhost failed
../../libdjvu/GContainer.h: In member function DJVU::GCont::HNode* DJVU::GMapImpl<K, TI>::get_or_create(const K&) [with K = unsigned int, TI = int]:
../../libdjvu/GContainer.h:1206:   instantiated from VTYPE& DJVU::GMapTemplate<KTYPE, VTYPE, TI>::operator[](const KTYPE&) [with KTYPE = unsigned int, VTYPE = int, TI = int]
../../gui/indep/utils/col_db.h:111:   instantiated from here
../../libdjvu/GContainer.h:1133: error: invalid initialization of reference of type const DJVU::GPixel& from expression of type const unsigned int
../../libdjvu/GPixmap.h:451: error: in passing argument 1 of unsigned int DJVU::hash(const DJVU::GPixel&)
../../libdjvu/GContainer.h: In member function DJVU::GCont::HNode* DJVU::GMapImpl<K, TI>::get_or_create(const K&) [with K = long unsigned int, TI = DJVU::GP<DXImage>]:
../../libdjvu/GContainer.h:1206:   instantiated from VTYPE& DJVU::GMapTemplate<KTYPE, VTYPE, TI>::operator[](const KTYPE&) [with KTYPE = long unsigned int, VTYPE = DJVU::GP<DXImage>, TI = DJVU::GP<DXImage>]
../../gui/indep/QX/qx_imager.cpp:1230:   instantiated from here
../../libdjvu/GContainer.h:1133: error: invalid initialization of reference of type const DJVU::GPixel& from expression of type const long unsigned int
../../libdjvu/GPixmap.h:451: error: in passing argument 1 of unsigned int DJVU::hash(const DJVU::GPixel&)
../../libdjvu/GContainer.h: In member function DJVU::GCont::HNode* DJVU::GSetImpl<K>::get(const K&) const [with K = unsigned int]:
../../libdjvu/GContainer.h:1040:   instantiated from DJVU::GPosition DJVU::GSetImpl<K>::contains(const K&) const [with K = unsigned int]
../../libdjvu/GContainer.h:1168:   instantiated from DJVU::GPosition DJVU::GMapTemplate<KTYPE, VTYPE, TI>::contains(const KTYPE&) const [with KTYPE = unsigned int, VTYPE = int, TI = int]
../../gui/indep/utils/col_db.h:111:   instantiated from here
../../libdjvu/GContainer.h:1060: error: invalid initialization of reference of type const DJVU::GPixel& from expression of type const unsigned int
../../libdjvu/GPixmap.h:451: error: in passing argument 1 of unsigned int DJVU::hash(const DJVU::GPixel&)
../../libdjvu/GContainer.h: In member function DJVU::GCont::HNode* DJVU::GSetImpl<K>::get(const K&) const [with K = long unsigned int]:
../../libdjvu/GContainer.h:1040:   instantiated from DJVU::GPosition DJVU::GSetImpl<K>::contains(const K&) const [with K = long unsigned int]
../../libdjvu/GContainer.h:1168:   instantiated from DJVU::GPosition DJVU::GMapTemplate<KTYPE, VTYPE, TI>::contains(const KTYPE&) const [with KTYPE = long unsigned int, VTYPE = DJVU::GP<DXImage>, TI = DJVU::GP<DXImage>]
../../gui/indep/QX/qx_imager.cpp:248:   instantiated from here
../../libdjvu/GContainer.h:1060: error: invalid initialization of reference of type const DJVU::GPixel& from expression of type const long unsigned int
../../libdjvu/GPixmap.h:451: error: in passing argument 1 of unsigned int DJVU::hash(const DJVU::GPixel&)
make[2]: *** [qx_imager.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/djvu-3.5.16/work/djvulibre-3.5.16/gui/djview'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/djvu-3.5.16/work/djvulibre-3.5.16/gui'
make: *** [all] Error 2

!!! ERROR: app-text/djvu-3.5.16 failed.
Call stack:
  ebuild.sh, line 1894:   Called dyn_compile
  ebuild.sh, line 941:   Called src_compile

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.

emerge --info
Portage 2.1_pre4 (default-linux/x86/2005.1, gcc-4.1.0-beta20060127, glibc-2.3.6-r2, 2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 AMD Athlon(tm) MP 2600+
Gentoo Base System version 1.12.0_pre15
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
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, 2.16.1-r1, 2.16.91.0.4, 2.16.91.0.5
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O2 -pipe -g -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /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=athlon-mp -O2 -pipe -g -ggdb -ffriend-injection -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distcc distlocks fixpackages sandbox sfperms splitdebug strict strip"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"
MAKEOPTS="-s -j7"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/bmg-main"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage/"
USE="x86 3dnow 3dnowex 3dnowext S3TC X a52 aac aalib acl acpi alsa ao asm audiofile bash-completion beagle beepmp berkdb bitmap-fonts bmp boost browserplugin bzip2 bzlib cairo calendar cdda cddb cdio cdparanoia cdr cdrom chroot codecs crypt ctype cups curl dbus dga dio divx4linux djbfft djvu dlloader dmx dpms dts dv dvd dvdread dvi ecc edl eds emboss encode erandom evo evo2 evolution exif exiscan exiscan-acl expat fam fame fdftk ffmpeg fftw flac flash fontconfig foomaticdb fortran freetype ftp gaim gb gcj gd gdbm gif gimpprint gksu glade glitz gmail gmp gnome gnomedb gnomeoffice gnutls gphoto2 gpm grammar graphviz gs gstreamer gstreamer10 gtk gtk2 gtkhtml guile hal icq icu idea idn imagemagick imlib ithreads jabber java javascript jikes jit jp2 jpeg junit kerberos lame latex lcms ldap libcaca libclamav libg++ libgda libnotify libwww lmtp lufsusermount lzo lzw lzw-tiff mad math matroska md5sum mikmod mime mimencode ming mjpeg mmap mmx mmxext mng mono motif mozilla moznoirc moznomail mp3 mpeg mpeg4 mplayer msn native nautilus ncurses net nls nptl nptlonly nsplugin nvidia oav octave ogg oggvorbis openal opengl oscar oss pam pcre pdf pdflib perl physfs pic pie plotutils png pop postscript profile python quicktime rar readline real recode rtc ruby samba sdl sharedmem slang sndfile sockets sox speex spell spreadsheet sqlite sse ssl subject-rewrite subp svg svga svgz sysfs syslog t1lib tcpd tetex theora thesaurus threads tiff transcode truetype truetype-fonts type1-fonts unicode urandom usb userlocales utf8 vcd vcdimager videos vidix vim virus-scan visualization vorbis webmin-minimal win32codecs wma123 wmf wordperfect wv wxwindows x264 xanim xinerama xml xml2 xpm xprint xrandr xscreensaver xv xvid xvmc yahoo yv12 zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_nv"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LC_ALL, LINGUAS
Comment 2 Kristiaan Lenaerts 2006-01-29 02:32:38 UTC
Created attachment 78404 [details, diff]
djvu-3.5.16-gcc41.patch

the first patch, for the extra qualification in C++ headers error.
Comment 3 Kristiaan Lenaerts 2006-01-29 02:33:05 UTC
Created attachment 78405 [details, diff]
djvu-3.5.16-gcc41-hash.patch
Comment 4 Martin Ehmsen (RETIRED) gentoo-dev 2006-01-31 05:13:54 UTC
I have added your two patches, but could you please report the problem (possible with your patches) upstream?
It would be much better for them to fix the problem in the next release than us having to patch.
Thanks for your report and for fixing it!
Comment 5 Kristiaan Lenaerts 2006-01-31 06:14:42 UTC
Of course, I submitted the bugreport and patches upstream:
http://sourceforge.net/tracker/index.php?func=detail&aid=1420522&group_id=32953&atid=406583