[DVDnav-discuss] [PATCH] libdvdread: `dvdread-config --libs` should include "-ldl"

Alexis Ballier aballier at gentoo.org
Wed Oct 29 22:22:22 CET 2008


Hi,

> 2008/10/29 Alexis Ballier <aballier at gentoo.org>:
> >> Patch adds "-ldl" to the appropriate output strings in
> >> dvdread-config.sh and dvdread-config.in
> >
> > Hmm wait. Shouldn't that be outputted only when linking statically ?
> > libdvdread.so should be linked to libdl if needed, what's the
> > problem with not having -ldl in --libs ?
> 
> I'm currently trying to test compatibility of Gentoo's various
> libdvdread-dependent packages with libdvdread-4.1.3.

The ebuild uses configure2 and allows user ldflags. Are you using
as-needed by any chance ?
If yes, please try the enclosed patch. With the current configure2
build system, if I link with as-needed, libdvdread.so gets its libdl
linkage dropped.

> yzhao at awa ~/hacking/vobcopy-1.1.2 $ gcc -o vobcopy vobcopy.o dvd.o
> -ldvdread /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libdvdread.so:
> undefined reference to `dlsym'
> /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libdvdread.so: undefined
> reference to `dlopen'
> /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libdvdread.so: undefined
> reference to `dlclose'
> collect2: ld returned 1 exit status

That just means libdvdread should be linked to libdl :)

> The correct solution, then seems to be updating configure to take
> libdvdcss into account, and generate dvdread-config accordingly.

that would make any dvdread-config consumer wrongly link to libdl :(

> Relatedly, is configure2 still the preferred way, or is it already
> considered unmaintained?

Good question; and by the way, configure2 always links to libdl while
the autofoo seems to have better handling of dlopen stuff. Which means
configure2 will probably fail on freebsd.

Regards,

Alexis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldl.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/attachments/20081029/378e14df/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/attachments/20081029/378e14df/attachment.pgp>


More information about the DVDnav-discuss mailing list