Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7331 - libgcc (gcc 3.2) related symbols in smpg causes failure to emerge marbles with sound support
Summary: libgcc (gcc 3.2) related symbols in smpg causes failure to emerge marbles wit...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Matthew Kennedy (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-01 10:14 UTC by José Fonseca
Modified: 2003-05-28 12:54 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description José Fonseca 2002-09-01 10:14:27 UTC
marbles' configure script fails to find SDL_mixer with gcc-3.2:

**********************************************************************
configure:1700: checking for main in -lSDL_mixer
configure:1715: gcc -o conftest -g -O2 -Wall -I/usr/include/SDL -D_REENTRANT
-DSDL_1_1_5   conftest.c -lSDL_mixer  -lm  -L/usr/lib -Wl,-rpath,/usr/lib -lSDL
-lpthread 1>&5
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_GetIP'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_GetRegionStart'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_Resume'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_DeleteException'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_RaiseException'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_SetIP'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_GetTextRelBase'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_GetLanguageSpecificData'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_SetGR'
/usr/lib/libsmpeg-0.4.so.0: undefined reference to `_Unwind_GetDataRelBase'
collect2: ld returned 1 exit status
configure: failed program was:
#line 1708 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
**********************************************************************

These symbols live in the gcc libraries in /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/ .

Strangely the programs bundled with smpg (such as gtv) wich use libsmpg run
fine, i.e., those symbols are resolved. So this problem must arise from the way
the configure invokes gcc, but so far I was unable to figure out what specifically.

I've decided to submit the bug here in the hope someone has a better clue about it.
Comment 1 José Fonseca 2002-09-01 10:27:08 UTC
Ok. After playing around I've discovered that adding
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so to linked libraries
eliminates the missing symbols, i.e., doing:

gcc -o conftest -g -O2 -Wall -I/usr/include/SDL -D_REENTRANT -I/usr/include/SDL
-D_REENTRANT   conftest.c -lm  -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so

But I still don't know what is libgcc_s.so purpose or why is it necessary to be
manually added to the command line...

Comment 2 José Fonseca 2002-09-02 06:07:50 UTC
Ok, I have made further progress. The problem is that libsmpeg-0.4.so.0.1.3
doesn't link to libgcc_s.so.1 (ldd shows that):
        libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0x4006f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x400d0000)
        libm.so.6 => /lib/libm.so.6 (0x400e6000)
        libc.so.6 => /lib/libc.so.6 (0x40109000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x4022e000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x402af000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x402b8000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x402df000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x403a9000)
        libdl.so.2 => /lib/libdl.so.2 (0x403b9000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
The programs that use libsmpeg are the ones that link to libgcc_s, such as plaympeg:
        libsmpeg-0.4.so.0 => /usr/lib/libsmpeg-0.4.so.0 (0x40015000)
        libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0x40077000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x400e6000)
        libm.so.6 => /lib/libm.so.6 (0x400fb000)
        libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libstdc++.so.5
(0x4011e000)
        libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so.1
(0x401e8000)
        libc.so.6 => /lib/libc.so.6 (0x401f0000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x40315000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x40396000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x403a0000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403c7000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40491000)
        libdl.so.2 => /lib/libdl.so.2 (0x404a1000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

The way I managed to better fix this problem was:
 # emerge smpeg  (and stop the emerge when it starts compiling)
 # cd /var/tmp/portage/smpeg-0.4.4-r4/work/smpeg-0.4.4
 # make
 # gcc -shared  MPEG.lo MPEGring.lo MPEGlist.lo MPEGstream.lo MPEGsystem.lo
MPEGfilter.lo smpeg.lo -Wl,--whole-archive audio/.libs/libaudio.al
video/.libs/libvideo.al -Wl,--no-whole-archive  -L/usr/lib -lSDL -lpthread -lm
-lSDL -lpthread -lm -lsupc++ -lSDL -lpthread -lm -lc  -Wl,-soname
-Wl,libsmpeg-0.4.so.0 -o .libs/libsmpeg-0.4.so.0.1.3
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so.1
(i.e., manually link libsmpeg adding libgcc_s)
 # cp .libs/libsmpeg-0.4.so.0.1.3 /usr/lib/

and voil
Comment 3 José Fonseca 2002-09-02 06:07:50 UTC
Ok, I have made further progress. The problem is that libsmpeg-0.4.so.0.1.3
doesn't link to libgcc_s.so.1 (ldd shows that):
        libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0x4006f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x400d0000)
        libm.so.6 => /lib/libm.so.6 (0x400e6000)
        libc.so.6 => /lib/libc.so.6 (0x40109000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x4022e000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x402af000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x402b8000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x402df000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x403a9000)
        libdl.so.2 => /lib/libdl.so.2 (0x403b9000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
The programs that use libsmpeg are the ones that link to libgcc_s, such as plaympeg:
        libsmpeg-0.4.so.0 => /usr/lib/libsmpeg-0.4.so.0 (0x40015000)
        libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0x40077000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x400e6000)
        libm.so.6 => /lib/libm.so.6 (0x400fb000)
        libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libstdc++.so.5
(0x4011e000)
        libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so.1
(0x401e8000)
        libc.so.6 => /lib/libc.so.6 (0x401f0000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x40315000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x40396000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x403a0000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403c7000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40491000)
        libdl.so.2 => /lib/libdl.so.2 (0x404a1000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

The way I managed to better fix this problem was:
 # emerge smpeg  (and stop the emerge when it starts compiling)
 # cd /var/tmp/portage/smpeg-0.4.4-r4/work/smpeg-0.4.4
 # make
 # gcc -shared  MPEG.lo MPEGring.lo MPEGlist.lo MPEGstream.lo MPEGsystem.lo
MPEGfilter.lo smpeg.lo -Wl,--whole-archive audio/.libs/libaudio.al
video/.libs/libvideo.al -Wl,--no-whole-archive  -L/usr/lib -lSDL -lpthread -lm
-lSDL -lpthread -lm -lsupc++ -lSDL -lpthread -lm -lc  -Wl,-soname
-Wl,libsmpeg-0.4.so.0 -o .libs/libsmpeg-0.4.so.0.1.3
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so.1
(i.e., manually link libsmpeg adding libgcc_s)
 # cp .libs/libsmpeg-0.4.so.0.1.3 /usr/lib/

and voilá! Everything now works as it should.

Of course that this is a hack. My guess is that the gcc specs at
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs are wrong, and gcc_s.so should be
automatically added when using -shared. That or libtool is somehow broken..

PS: Can anybody reproduce this problem, or is just my system that is screwed up?
Comment 4 Matthew Kennedy (RETIRED) gentoo-dev 2002-12-14 00:10:52 UTC
assigned
Comment 5 José Fonseca 2003-03-21 08:49:18 UTC
I've recently re-emerged smpg and libsmpeg-0.4.so.0.1.3 is properly linked to libgcc_s.so.1, so this problem must have been fixed in gcc. But looking back, I really don't see why bothering to write detailed bug reports if nobody ever looks at them and silently hopes to things magically get fixed upstream.

I would close this bug now - I always check my bugs are no longer relevant to help keeping the Bugzilla database sane - but it seems the bug reporters no longer have such priveleges. More load on the developers then! WAY TO GO GENTOERS!! Duh...
Comment 6 Hanno Böck gentoo-dev 2003-05-28 12:54:57 UTC
seems to be done