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

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

Thread Next
Petr Pisar
August 17, 2017 06:44
The meaning of $Config{libs} and $Config{perllibs}
Message ID:

XML-LibXML blindly passes $Config{libs} value to linker flags. If perl is
built with GDBM support, the $Config{libs} contains -lgdbm. If (not
to confuse with, GNU/Linux makes distinction between libraries
for building and for running) is removed from the system, XML-LibXML fails
<>. 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:

        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.

        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
<> and

-- Petr

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About