develooper Front page | perl.perl5.porters | Postings from August 2017

Re: The meaning of $Config{libs} and $Config{perllibs}

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
August 17, 2017 16:52
Subject:
Re: The meaning of $Config{libs} and $Config{perllibs}
Message ID:
CAHhgV8jCiiUPnjFTChe=z070jOgcpMQcDw0nxJM0c+N9vJ5QLg@mail.gmail.com
On Thu, Aug 17, 2017 at 8:44 AM, Petr Pisar <ppisar@redhat.com> wrote:

> Hello,
>
> XML-LibXML blindly passes $Config{libs} value to linker flags. If perl is
> built with GDBM support, the $Config{libs} contains -lgdbm. If libgdbm.so
> (not
> to confuse with libgdm.so.4, GNU/Linux makes distinction between libraries
> for building and for running) is removed from the system, XML-LibXML fails
> <https://rt.cpan.org/Public/Bug/Display.html?id=83028>. Naturally
> XML-LibXML
> does not need GDBM library at all.
>
> I think the $Config{libs} is not supposed to be used by non-core XS
> modules.
> It's more a documentation variable showing how perl was configured.
>
> I recommended to XML-LibXML replacing $Config{libs} with $Config{perllibs},
> but even the $Config{perllibs} contains many libraries that are not
> helpfull
> for non-core extensions. E.g. my Perl 5.26.0 has
>
> $Config{libs} = '-lpthread -lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt
> -lutil -lc -lgdbm_compat'
> $Config{perllibs} = '-lpthread -lresolv -lnsl -ldl -lm -lcrypt -lutil -lc'
>
> Documentation reads:
>
>     "libs"
>         From libs.U:
>
>         This variable holds the additional libraries we want to use. It is
> up
>         to the Makefile to deal with it. The list can be empty.
>
>     "perllibs"
>         From End.U:
>
>         The list of libraries needed by Perl only (any libraries needed by
>         extensions only will by dropped, if using dynamic loading).
>
> Am I right this is a bug in XML-LibXML CPAN distribution? Or is it a bug in
> how my Perl is packaged because it allows uninstalling development GDBM
> files?
>
> This question comes from two contradicting Fedora/RHEL user's requests
> <https://bugzilla.redhat.com/show_bug.cgi?id=905482> and
> <https://bugzilla.redhat.com/show_bug.cgi?id=1481324>.


Yes, this looks like a bug in XML-LibXSLT to me. While apparently it fixed
some compilation issue ten years ago[1], it doesn't sound like the right
solution at all (at least under unix, on Windows perllibs is always added
to the linker flags because of the way that PE linking works).

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About