Is this a gcc41 bug?

walt wa1ter at myrealbox.com
Sat Dec 15 16:00:27 PST 2007


I'm still trying to get pkgsrc/multimedia/gnash to build on DFly, and
I have more information to offer but I can't explain it.

The package compiles perfectly on NetBSD but fails on DFly with this:

/usr/pkgsrc/multimedia/gnash/work/gnash-0.8.0/server/.libs/libgnashserver.so:
undefined reference to `gnash::sound_handler::convert_raw_data(short**, int*,
void*, int, int, int, bool, int, bool)'

That missing symbol is defined in libgnashbackend.so which is also part of
gnash.  I isolated the failing command in a shellscript, which runs and
works perfectly on NetBSD:

g++  -O2 -Wl,-R/usr/pkg/lib -Wl,--as-needed -o .libs/gparser parser.o
 -Wl,--export-dynamic -Wl,--rpath,/usr/pkg/lib -lgnashbackend -lgnashserver
 -lgnashbackend -lgnashamf -lgnashgeo -lgnashbase   <lots of non-linker
  garbage snipped for legibility>

Note that -lgnashbacked is definitely included in that command, so the
'missing' symbol is not really missing after all.

The following script works perfectly on DFly, and all I did was to call
the loader directly instead of going through g++:

ld --as-needed -o .libs/gparser parser.o /usr/lib/gcc41/crt1.o
 /usr/lib/gcc41/crtbegin.o --export-dynamic -rpath /usr/pkg/lib
 -lgnashbackend -lgnashserver -lgnashbackend -lgnashamf -lgnashgeo
 -lgnashbase -lc       <-Lpaths snipped for legibility>

So, my question is:  why is g++ not linking gparser correctly?  All
the same libraries are there in both cases, but g++ complains about
that missing symbol when it's not missing at all.

What approach to debugging this would you use?

Thanks for any clues.






More information about the Bugs mailing list