RE: GCC 6.2 and shared libraries: dlopen not found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On /16/11/16 Andrew Haley wrote:
> On 16/11/16 15:35, Richard Sewards wrote:
> > With gcc 6, it appears I must add "-ldl" when creating libtcl.so
> > in order for a subsequent link that uses "-ltcl -ldl" will find
> > dlopen.  Without -ldl when creating libtcl.so the subsequent link
> > fails to find dlopen even though it's invoked with -ldl.    With
> > gcc 5 this is not necessary.
>
> This isn't really a GCC thing, it's more to do with the way that
> the linker interworks with the shared library loader and the
> --as-needed flag.  Use -ldl always and you'll be fine.
>
> Andrew.

Thanks, that's helpful.  My GCC 5 is built to use binutils 2.25 and
gcc 6 uses binutils 2.27.   Rebuilding gcc 6 to use 2.25 eliminates
the link errors, so gold 1.12 must differ from gold 1.11 somehow.  I
don't see anything obvious in the Changelog or News files.

I suppose the solution is to be more careful when creating libraries,
using -ldl and possibly --no-undefined.  Is there something special
about -ldl?  And are there accepted conventiosn for this now?

Regards,
--
Richard Sewards




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux