Bug 46352 - Glob2 v0.8.4 crashs during compiling when it hits SoundMixer.o
Bug#: 46352 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: CLOSED Severity: normal Priority: P2
Resolution: NEEDINFO Assigned To: games@gentoo.org Reported By: deepwave_admin@users.sourceforge.net
Component: Games
URL: 
Summary: Glob2 v0.8.4 crashs during compiling when it hits SoundMixer.o
Keywords:  
Status Whiteboard: 
Opened: 2004-03-31 05:47 0000
Description:   Opened: 2004-03-31 05:47 0000
When emerging glob2, I get the following errors during the compile:

SoundMixer.o(.text+0xcc): In function `mixaudio(void*, unsigned char*, int)':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_iterator.h:642: undefined reference to `ov_read'
SoundMixer.o(.text+0xf2): In function `mixaudio(void*, unsigned char*, int)':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_alloc.h:232: undefined reference to `ov_pcm_tell'
SoundMixer.o(.text+0x10c):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_alloc.h:232: undefined reference to `ov_pcm_seek'
SoundMixer.o(.text+0x14f): In function `mixaudio(void*, unsigned char*, int)':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_read'
SoundMixer.o(.text+0x37c):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_pcm_seek'
SoundMixer.o(.text+0x3a3):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_pcm_seek'
SoundMixer.o(.text+0x3eb):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_read'
SoundMixer.o(.text+0x52f):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_pcm_seek'
SoundMixer.o(.text+0xc05): In function `SoundMixer::~SoundMixer [not-in-charge]()':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_clear'
SoundMixer.o(.text+0xcbd): In function `SoundMixer::~SoundMixer [in-charge]()':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/stl_vector.h:501: undefined reference to `ov_clear'
SoundMixer.o(.text+0xd70): In function `SoundMixer::loadTrack(char const*)':
/var/tmp/portage/glob2-0.8.4/work/glob2-0.8.4/src/SoundMixer.cpp:234: undefined reference to `ov_open'
collect2: ld returned 1 exit status
make[2]: *** [glob2] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


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

Actual Results:  
The emerge fails.

Expected Results:  
A working compiliation of glob2...

------- Comment #1 From Mr. Bones. 2004-04-01 01:37:55 0000 -------
give 0.8.5 a try please.

------- Comment #2 From Dorian Pula 2004-04-01 09:06:04 0000 -------
v 0.8.5 does the exact same thing.

------- Comment #3 From Mr. Bones. 2004-04-03 01:28:37 0000 -------
Try remerging your glibc and gcc please.  Compiling glob2 works great for me.
Also, please post the output of emerge --info as instructed on the bug submission
page.  Thanks.

------- Comment #4 From Dorian Pula 2004-04-03 16:40:20 0000 -------
OK I emerged gcc and glibc but I get the exact same result.

Here is what I got from emerge --info:

Gentoo Base System version 1.4.3.13
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.3-gentoo-r1)
=================================================================
System uname: 2.6.3-gentoo-r1 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.80GHz
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache sandbox sfperms userpriv usersandbox"
GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/ http://212.219.247.15/sites/www.ibiblio.org/gentoo/ http://212.219.247.21/sites/www.ibiblio.org/gentoo/ http://212.219.247.14/sites/www.ibiblio.org/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bonobo cdr crypt cups encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile imlib java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"

------- Comment #5 From Mr. Bones. 2004-04-04 00:13:42 0000 -------
Try it with MAKEOPTS="-j1"
Try it with CXXFLAGS="-pipe"

------- Comment #6 From Dorian Pula 2004-04-05 09:05:46 0000 -------
Tried that no success...

------- Comment #7 From Dorian Pula 2004-04-06 08:48:18 0000 -------
Funny, it seems to be a problem with ebuild.  When I run with no tags, there
are still is the same problem... in fact the optimization does not change a
single thing.  However, when I compile glob2 as a user... it actually compiles.

------- Comment #8 From Mr. Bones. 2004-04-07 15:57:50 0000 -------
I'm wondering if it could be related to FEATURES somehow.  Can you
try it with FEATURES="" please?

------- Comment #9 From SpanKY 2004-04-07 23:38:55 0000 -------
could you provide a more complete output ?

we've got the error (at least, i think it's the whole error) but we dont have the build command ...

basically could you copy & paste the last g++ command before you got the error ?

------- Comment #10 From Mr. Bones. 2004-04-11 18:45:01 0000 -------
Need more information...

------- Comment #11 From Dorian Pula 2004-04-12 17:21:52 0000 -------
OK. OK. Sorry, but my AC adaptor died two days ago and I have not even had the
oppurtunity to compile.  Damn laptop adaptor....

------- Comment #12 From Sascha Silbe 2004-04-21 08:34:47 0000 -------
Same problem here. Will attach build script.
I noticed that configure complains about missing Vorbis support, even though I do have the vorbis packages installed and USE=oggvorbis is set.


------- Comment #13 From Sascha Silbe 2004-04-21 08:35:35 0000 -------
Created an attachment (id=29755) [details]
Build script

------- Comment #14 From Sascha Silbe 2004-04-21 08:40:02 0000 -------
Created an attachment (id=29756) [details]
config.log

/usr/games/include does not exist, so gcc bails out:

=== Begin config.log excerpt ===
configure:4597: gcc -o conftest -march=pentium -mcpu=athlon-xp -O3 -pipe
-I/usr/games/include	conftest.c  -L/usr/games/lib -lvorbis -lm -l
vorbisenc  >&5
cc1: /usr/games/include: Permission denied
configure:4600: $? = 1
configure: program exited with status 1
=== End config.log excerpt ===

=== Begin screenshot ===
sascha@cube:~$ ls -l /usr/games/
total 4
drwxr-x---    2 games	 games	      4096 Apr 21 13:28 bin
drwxr-x---    6 games	 games		59 Feb	5 00:59 lib
drwxr-x---    2 games	 games		28 Dec 31 15:11 libexec
sascha@cube:~$ 
=== End screenshot ===

------- Comment #15 From Mr. Bones. 2004-05-07 16:26:04 0000 -------
This doesn't have anything to do with /usr/games/include being missing.  You
have some serious config issue with your C compiler.  I recommend (again)
remerging glibc and gcc and trying this again.

------- Comment #16 From Mr. Bones. 2004-05-27 17:36:51 0000 -------
No reply, still works for me.  Closing.

------- Comment #17 From Greg Symons 2004-06-11 21:40:13 0000 -------
The failure of the Ogg Vorbis test in configure is indicative of the problem. I
am able to build glob2 outside of portage after copying the source from
/var/tmp/portage/glob2-0.8.6/work

After looking at my FEATURES and Dorian's FEATURES, we both have userpriv
enabled. After disabling userpriv, I am able to build using portage.

It appears that when the Ogg Vorbis test in the configure script fails, the
compiler flag '-lvorbisfile' is left out of the makefile. If the executable is
not linked with libvorbisfile, then none of the ogg vorbis functions can be
resolved during linking.

The test is indeed failing because /usr/games/include and /usr/games/lib don't
exist... I'm not sure why, but gcc spews a permission denied error in that
case, rather than failing in a more descriptive manner. What's really wierd is
that when run as root, gcc ignores the problem completely. I'll look to see if
there's a gcc bug for this.

I've modified the ebuild so that the vorbis prefix gets reset when configure is
run. I've checked it out and the modified ebuild builds successfully with
userpriv turned on. I'll attach a patch in just a bit.

------- Comment #18 From Greg Symons 2004-06-11 21:51:54 0000 -------
Created an attachment (id=33116) [details]
Patch to fix ebuild

I overrode src_compile so that the vorbis prefix is reset when the configure
script is run

------- Comment #19 From Simon Farnsworth 2004-06-15 06:47:14 0000 -------
I fixed it with userpriv enabled by added the user "portage" to the group
"games"; this allows configure to pick up the Vorbis libraries.