Project

General

Profile

Bug #886

Is this a gcc41 bug?

Added by wa1ter over 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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.

History

#1

Updated by wa1ter over 12 years ago

On Sat, 15 Dec 2007, walt wrote:

Well, I just discovered that removing the --as-needed flag fixes the problem
when using g++ to link. Any idea why it works in NetBSD but not DFly?

Also available in: Atom PDF