NetBSD Problem Report #35249

From www@NetBSD.org  Wed Dec 13 18:03:24 2006
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
	id 0265563BA6D; Wed, 13 Dec 2006 18:03:24 +0000 (UTC)
Message-Id: <20061213180324.0265563BA6D@narn.NetBSD.org>
Date: Wed, 13 Dec 2006 18:03:24 +0000 (UTC)
From: lorenl@north-winds.org
Reply-To: lorenl@north-winds.org
To: gnats-bugs@NetBSD.org
Subject: Sendmail fails to find libraries in /usr/pkg/lib on Linux.
X-Send-Pr-Version: www-1.0

>Number:         35249
>Category:       pkg
>Synopsis:       Sendmail fails to find libraries in /usr/pkg/lib on Linux.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jnemeth
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 18:05:01 +0000 2006
>Closed-Date:    
>Last-Modified:  Tue Aug 30 19:30:20 +0000 2011
>Originator:     Loren M. Lang
>Release:        RedHat 9 Linux 2.4.20-20.9b
>Organization:
Alzatex, Inc.
>Environment:
Linux hosea.tallye.com 2.4.20-20.9b #1 SMP Wed Nov 19 22:14:33 PST 2003 i686 i686 i386 GNU/Linux
>Description:
I am using pkgsrc on Linux to replace parts of the Linux userland one-by-one.  Cyrus SASL, OpenSSL and OpenLDAP are installed from pkgsrc with older versions sitting under /usr and /usr/local.  The port mail/sendmail appears to install correctly, though none of the executables run due to missing libraries.  Specifically, it cannot find the ldap libraries that were installed into /usr/pkg/lib as the SONAME is different than installed under /usr/lib.

$/usr/pkg/libexec/sendmail/sendmail
/usr/pkg/libexec/sendmail/sendmail: error while loading shared libraries: libldap-2.3.so.0: cannot open shared object file: No such file or directory

$ldd /usr/pkg/libexec/sendmail/sendmail
        libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0x4003a000)
        libsasl2.so.2 => /usr/local/lib/libsasl2.so.2 (0x40184000)
        libldap-2.3.so.0 => not found
        liblber-2.3.so.0 => not found
        libdb4-4.4.so.4 => not found
        ...

Looking in work/.work.log, I found no -R options to the linker or compiler.
>How-To-Repeat:
Install newer versions of OpenLDAP, BerkeleyDB, or other libraries onto a Linux system from pkgsrc, then install Sendmail from pkgsrc with the appropriate options enabled so that it depends on them and see that the generated binaries cannot find the libraries from pkgsrc unless /usr/pkg/lib is added to /etc/ld.so.conf and /sbin/ldconfig is re-ran.
>Fix:
A work-around on Linux is to add /usr/pkg/lib to /etc/ld.so.conf and run /sbin/ldconfig to update the library cache.  This causes sendmail from pkgsrc to find the appropriate libraries, but, of course, causes a lot of the base system programs to change to the libraries from pkgsrc.  The correct course of action is to have sendmail linked with the appropriate -R option.

>Release-Note:

>Audit-Trail:
From: "Loren M. Lang" <lorenl@north-winds.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/35249: Sendmail fails to find libraries in /usr/pkg/lib on
 Linux.
Date: Fri, 15 Dec 2006 10:05:47 -0800

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig5E7184D9E1A6EFBB10D46978
 Content-Type: multipart/mixed;
  boundary="------------020304050801070009050800"

 This is a multi-part message in MIME format.
 --------------020304050801070009050800
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable

 This adds the -Wl,-R flag to the sendmail build which makes the sendmail
 binaries able to find the appropriate libraries and run.

 gnats-admin@NetBSD.org wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `pkg/35249'.
 > The individual assigned to look at your
 > report is: pkg-manager.=20
 >=20
 >> Category:       pkg
 >> Responsible:    pkg-manager
 >> Synopsis:       Sendmail fails to find libraries in /usr/pkg/lib on Li=
 nux.
 >> Arrival-Date:   Wed Dec 13 18:05:01 +0000 2006
 >=20


 --=20
 Loren M. Lang
 lorenl@north-winds.org
 http://www.north-winds.org/


 Public Key: ftp://ftp.north-winds.org/pub/lorenl_pubkey.asc
 Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2


 --------------020304050801070009050800
 Content-Type: text/plain;
  name="sendmail.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline;
  filename="sendmail.patch"

 Index: sendmail/files/site.config.m4
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/pkgsrc/mail/sendmail/files/site.config.m4,v
 retrieving revision 1.5
 diff -u -r1.5 site.config.m4
 --- sendmail/files/site.config.m4	8 Jun 2006 02:26:32 -0000	1.5
 +++ sendmail/files/site.config.m4	15 Dec 2006 18:04:58 -0000
 @@ -17,4 +17,4 @@
  define(`confMAN5EXT', `5')
  define(`confMAN8EXT', `8')
  APPENDDEF(`confENVDEF', `-I${PREFIX}/include')
 -APPENDDEF(`confLIBS', `-L${PREFIX}/lib')
 +APPENDDEF(`confLIBS', `-L${PREFIX}/lib -Wl,-R${PREFIX}/lib')

 --------------020304050801070009050800--

 --------------enig5E7184D9E1A6EFBB10D46978
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFFguQISHsHRHUO+igRAuH0AKDM+YpFJHP6c3ghaDMy2u6XumajSQCdEhQ1
 KP63/xDz9fyzwFfpkI24cHI=
 =3RFY
 -----END PGP SIGNATURE-----

 --------------enig5E7184D9E1A6EFBB10D46978--

From: "Loren M. Lang" <lorenl@north-winds.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/35249: Sendmail fails to find libraries in /usr/pkg/lib on
 Linux.
Date: Fri, 15 Dec 2006 16:46:10 -0800

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig8ADD1F5F7CB9B0703315605F
 Content-Type: multipart/mixed;
  boundary="------------010608000403030106050803"

 This is a multi-part message in MIME format.
 --------------010608000403030106050803
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable

 Apparently I failed to fully test the last patch; this one should work
 better.  It seems that everytime APPENDDEF is called in site.config.m4,
 a layer of quotes is lost exposing the comma in -Wl,-R which eats up
 everything after it.  I have changed to using LDOPTS instead of LIBS as
 nothing else appends to it and so it only needs two layers of quotes.
 This has been tested with several cleans followed by builds.
 --=20
 Loren M. Lang
 lorenl@north-winds.org
 http://www.north-winds.org/


 Public Key: ftp://ftp.north-winds.org/pub/lorenl_pubkey.asc
 Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2


 --------------010608000403030106050803
 Content-Type: text/plain;
  name="sendmail.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline;
  filename="sendmail.patch"

 Index: sendmail/files/site.config.m4
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/pkgsrc/mail/sendmail/files/site.config.m4,v
 retrieving revision 1.5
 diff -u -r1.5 site.config.m4
 --- sendmail/files/site.config.m4	8 Jun 2006 02:26:32 -0000	1.5
 +++ sendmail/files/site.config.m4	16 Dec 2006 00:40:14 -0000
 @@ -18,3 +18,4 @@
  define(`confMAN8EXT', `8')
  APPENDDEF(`confENVDEF', `-I${PREFIX}/include')
  APPENDDEF(`confLIBS', `-L${PREFIX}/lib')
 +APPENDDEF(`confLDOPTS', ``-Wl,-R${PREFIX}/lib'')

 --------------010608000403030106050803--

 --------------enig8ADD1F5F7CB9B0703315605F
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFFg0HaSHsHRHUO+igRAt0ZAKDS4ojdXofWRBeEWCg4BEQvMc0O8ACffmrW
 n3xA+tzJU+j1Mo2AAQ4KRDI=
 =Xdtp
 -----END PGP SIGNATURE-----

 --------------enig8ADD1F5F7CB9B0703315605F--

Responsible-Changed-From-To: pkg-manager->tv
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sat, 16 Dec 2006 09:40:38 +0000
Responsible-Changed-Why:
Over to maintainer.
If you can't handle it, please assign it to linux-pkg-people.


Responsible-Changed-From-To: tv->linux-pkg-people
Responsible-Changed-By: tv@netbsd.org
Responsible-Changed-When: Sat, 05 May 2007 14:57:17 +0000
Responsible-Changed-Why:
I don't actively maintain pkgsrc sendmail anymore.


State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 05 Jan 2010 07:40:15 +0000
State-Changed-Why:
Is this still a problem?


Responsible-Changed-From-To: linux-pkg-people->jnemeth
Responsible-Changed-By: cheusov@NetBSD.org
Responsible-Changed-When: Tue, 30 Aug 2011 19:30:20 +0000
Responsible-Changed-Why:
1) This issue is reproducible
2) "Responsible" is set to OWNER (jnemeth)
3) This issue is not specific to Linux
4) The following patch solve the problem.
   I built sendmail successfully with default option as well as with
   db4, ldap and sasl enabled.

Index: files/site.config.m4
===================================================================
RCS file: /cvsroot/pkgsrc/mail/sendmail/files/site.config.m4,v
retrieving revision 1.10
diff -u -r1.10 site.config.m4
--- files/site.config.m4        16 Dec 2009 09:46:36 -0000      1.10
+++ files/site.config.m4        30 Aug 2011 19:23:22 -0000
@@ -17,7 +17,7 @@
 define(`confMAN5EXT', `5')
 define(`confMAN8EXT', `8')
 APPENDDEF(`confENVDEF', `-I${PREFIX}/include -DSMRSH_CMDDIR=\"${SMRSH_CMDDIR}\"')
-APPENDDEF(`confLIBS', `-L${PREFIX}/lib')
+APPENDDEF(`confLIBDIRS', `-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib')
 APPENDDEF(`confMAPDEF', `-DSOCKETMAP')

 # the following are handled by pkgsrc


State-Changed-From-To: feedback->open
State-Changed-By: cheusov@NetBSD.org
State-Changed-When: Tue, 30 Aug 2011 19:30:20 +0000
State-Changed-Why:
See above


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.