tech-pkg archive

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

databases/nss_ldap excessive linking


When building on NetBSD, databases/nss_ldap depends on many unused
libraries (The binary does not contain any symbol from kerberos

$ ldd /usr/lib/
        -lldap-2.4.2 => /usr/pkg/lib/
        -llber-2.4.2 => /usr/pkg/lib/
        -lc.12 => /usr/lib/
        -lsasl2.3 => /usr/pkg/lib/
        -lresolv.2 => /usr/lib/
        -lgcc_s.1 => /usr/lib/
        -lssl.10 => /usr/lib/
        -lcrypto.8 => /usr/lib/
        -lcrypt.1 => /lib/
        -lkrb5.26 => /usr/lib/
        -lhx509.5 => /usr/lib/
        -lasn1.9 => /usr/lib/
        -lcom_err.7 => /usr/lib/
        -lroken.19 => /usr/lib/
        -lutil.7 => /usr/lib/
        -lwind.0 => /usr/lib/
        -lheimbase.1 => /usr/lib/
        -lgssapi.10 => /usr/lib/
        -lheimntlm.4 => /usr/lib/

This makes the package unusable on a stripped down system where theses
libraries are not there. A patch on configure to remove a few
AC_CHECK_LIB() produces a binary with the exact same symbol, but with
the following library requirement:
        -lldap-2.4.2 => /usr/pkg/lib/
        -llber-2.4.2 => /usr/pkg/lib/
        -lc.12 => /lib/
        -lsasl2.3 => /usr/pkg/lib/
        -lresolv.2 => /usr/lib/
        -lgcc_s.1 => /lib/
        -lssl.10 => /usr/lib/
        -lcrypto.8 => /lib/
        -lcrypt.1 => /lib/
The patch is below. Is it reasonnable to add it in pkgsrc?
---   2016-04-20 18:26:12.000000000 +0000
+++        2016-04-20 18:27:08.000000000 +0000
@@ -288,19 +288,19 @@

 AC_CHECK_LIB(dl, dlopen,[LIBS="-ldl $LIBS"],,$LIBS)
 dnl AC_CHECK_LIB(db, main,[LIBS="-ldb $LIBS"],,$LIBS)

-AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS"
-if test -z "$found_gssapi_lib"; then
-  AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,[LIBS="-lgssapi_krb5
+dnl AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS"
+dnl if test -z "$found_gssapi_lib"; then
+dnl   AC_CHECK_LIB(gssapi_krb5,
gss_krb5_ccache_name,[LIBS="-lgssapi_krb5 $LIBS"],,$LIBS)
+dnl fi
 dnl Following checks probably not strictly necessary.
 dnl AC_CHECK_LIB(crypto, main,[LIBS="-lcrypto $LIBS"],,$LIBS)
 dnl AC_CHECK_LIB(ssl, main,[LIBS="-lssl $LIBS"],,$LIBS)
-AC_CHECK_LIB(com_err, main,[LIBS="-lcom_err $LIBS"],,$LIBS)
+dnl AC_CHECK_LIB(com_err, main,[LIBS="-lcom_err $LIBS"],,$LIBS)
 dnl AC_CHECK_LIB(k5crypto, main,[LIBS="-lk5crypto $LIBS"],,$LIBS)
-AC_CHECK_LIB(krb5, main,[LIBS="-lkrb5 $LIBS"],,$LIBS)
+dnl AC_CHECK_LIB(krb5, main,[LIBS="-lkrb5 $LIBS"],,$LIBS)
 dnl AC_CHECK_LIB(krb4, main,[LIBS="-lkrb4 $LIBS"],,$LIBS)
 AC_CHECK_LIB(sasl2, sasl_client_init)

 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o
$with_ldap_lib = umich -o $with_ldap_lib = openldap \); then

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index