Re: question about shared libraries and the library cache.

2002-12-04 Thread Terry Lambert
Reinier Kleipool wrote:
> but it does not put some files in the hints cache: (Files listed above
> deleted by hand from the listing below)
> 
> root@mail:~# ls -l /usr/local/lib/*.so* | grep -v "^l"
> -rwxr-xr-x  1 root  wheel  699643 Dec  1 11:12 /usr/local/lib/libdb-4.1.so*
> -rwxr-xr-x  1 root  wheel  699643 Nov 29 11:32 /usr/local/lib/libdb4_1.so*
> -rwxr-xr-x  1 root  wheel  800336 Dec  1 11:13 /usr/local/lib/libdb_cxx-4.1.so*

These are shared libraries, but they do not have version numbers
associated with them (*.so.).  You have built them
incorrectly; they  should be symlinked to a versioned library of
the same name without the version.


> -r-xr-xr-x  1 root  wheel   32216 Nov 23 16:53 /usr/local/lib/pam_ldap.so*
> -r--r--r--  1 root  wheel   10581 Nov 23 16:50 /usr/local/lib/pam_smb_auth.so

These are *not* shared libraries.  They are shared objects, which
are intended to be dlopen'ed by the PAM library, as one of the
allowed module types.  See /etc/pam.conf.


> My question is now: "Why those files not???"
> In my opinion it has something to do with the "format" of those files. It
> has nothing to do with reboots or upgrades. (it is a clean install of
> FreeBSD 4.7) Also "ldconfig /usr/lib /usr/local/lib" should create a clean
> new hintsfile with all libraries in those directories.
> Any ideas about the way you generate good files and bad libraries???

See above.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: question about shared libraries and the library cache.

2002-12-04 Thread Tim Kientzle
According to the source code for ldconfig
(/usr/src/sbin/ldconfig/ldconfig.c),
ldconfig requires that the library file
have a name that:

* begins with 'lib'
* contains '.so.'  (note the trailing period)

This is in the dodir() function, around line
270.  It does not seem to require a number after the
final dot, though, based on a cursory reading of the
source.

So, 'pam_XXX.so' isn't in the hints file
because it's not a 'libXXX', and the
others don't have a trailing version number.

Tim Kientzle


Reinier Kleipool wrote:


Hello Gents,

  ldconfig -r does find other libraries in /usr/local/lib:
root@mail:~# ldconfig -r | grep local
search directories: /usr/lib:/usr/local/lib
67:-lltdl.1 => /usr/local/lib/libltdl.so.1
68:-ldb3.3 => /usr/local/lib/libdb3.so.3
69:-ldb3_cxx.3 => /usr/local/lib/libdb3_cxx.so.3
70:-llber.2 => /usr/local/lib/liblber.so.2
71:-lldap.2 => /usr/local/lib/libldap.so.2
72:-lldap_r.2 => /usr/local/lib/libldap_r.so.2
73:-lsasl2.2 => /usr/local/lib/libsasl2.so.2
74:-ljpeg.9 => /usr/local/lib/libjpeg.so.9
75:-lpng.5 => /usr/local/lib/libpng.so.5
root@mail:~#

but it does not put some files in the hints cache: (Files listed above
deleted by hand from the listing below)

root@mail:~# ls -l /usr/local/lib/*.so* | grep -v "^l"
-rwxr-xr-x  1 root  wheel  699643 Dec  1 11:12 /usr/local/lib/libdb-4.1.so*
-rwxr-xr-x  1 root  wheel  699643 Nov 29 11:32 /usr/local/lib/libdb4_1.so*
-rwxr-xr-x  1 root  wheel  800336 Dec  1 11:13
/usr/local/lib/libdb_cxx-4.1.so*
-r-xr-xr-x  1 root  wheel   32216 Nov 23 16:53 /usr/local/lib/pam_ldap.so*
-r--r--r--  1 root  wheel   10581 Nov 23 16:50
/usr/local/lib/pam_smb_auth.so
root@mail:~#

My question is now: "Why those files not???"
In my opinion it has something to do with the "format" of those files. It
has nothing to do with reboots or upgrades. (it is a clean install of
FreeBSD 4.7) Also "ldconfig /usr/lib /usr/local/lib" should create a clean
new hintsfile with all libraries in those directories.
Any ideas about the way you generate good files and bad libraries???

Kind regards,
Reinier




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message








To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



RE: question about shared libraries and the library cache.

2002-12-04 Thread Reinier Kleipool
Hello Gents,

  ldconfig -r does find other libraries in /usr/local/lib:
root@mail:~# ldconfig -r | grep local
search directories: /usr/lib:/usr/local/lib
67:-lltdl.1 => /usr/local/lib/libltdl.so.1
68:-ldb3.3 => /usr/local/lib/libdb3.so.3
69:-ldb3_cxx.3 => /usr/local/lib/libdb3_cxx.so.3
70:-llber.2 => /usr/local/lib/liblber.so.2
71:-lldap.2 => /usr/local/lib/libldap.so.2
72:-lldap_r.2 => /usr/local/lib/libldap_r.so.2
73:-lsasl2.2 => /usr/local/lib/libsasl2.so.2
74:-ljpeg.9 => /usr/local/lib/libjpeg.so.9
75:-lpng.5 => /usr/local/lib/libpng.so.5
root@mail:~#

but it does not put some files in the hints cache: (Files listed above
deleted by hand from the listing below)

root@mail:~# ls -l /usr/local/lib/*.so* | grep -v "^l"
-rwxr-xr-x  1 root  wheel  699643 Dec  1 11:12 /usr/local/lib/libdb-4.1.so*
-rwxr-xr-x  1 root  wheel  699643 Nov 29 11:32 /usr/local/lib/libdb4_1.so*
-rwxr-xr-x  1 root  wheel  800336 Dec  1 11:13
/usr/local/lib/libdb_cxx-4.1.so*
-r-xr-xr-x  1 root  wheel   32216 Nov 23 16:53 /usr/local/lib/pam_ldap.so*
-r--r--r--  1 root  wheel   10581 Nov 23 16:50
/usr/local/lib/pam_smb_auth.so
root@mail:~#

My question is now: "Why those files not???"
In my opinion it has something to do with the "format" of those files. It
has nothing to do with reboots or upgrades. (it is a clean install of
FreeBSD 4.7) Also "ldconfig /usr/lib /usr/local/lib" should create a clean
new hintsfile with all libraries in those directories.
Any ideas about the way you generate good files and bad libraries???

Kind regards,
Reinier




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: question about shared libraries and the library cache.

2002-12-02 Thread Terry Lambert
Peter Pentchev wrote:
> The original posting did not mention a reboot, but rather a manual
> ldconfig(8) invocation immediately after installing the libraries.  In
> this case, your advice about ldconfig -m was correct, as I noted in the
> part of my message that you snipped; but there are other directories to
> be considered besides /usr/local/lib.

FWIW:

IMO, the value of the path list was probably corrupt, since the
"ldconfig -R" he said he ran failed to find it, or the other
shared libraries in /usr/local/lib.  In other words, he munged
something and broke it, some time ago, and was only now feeling
the pain.

One of the problems with upgrading from an older version of
FreeBSD to a newer version is that the process fails to deal
with transporting the current configuration to the new version
of the OS, for a lot of corner cases.

The reason I said what I said, and said it the way that I did,
was to give something that would work, no matter how screwed
up the situation was.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: question about shared libraries and the library cache.

2002-12-01 Thread Peter Pentchev
On Sun, Dec 01, 2002 at 03:09:34PM -0800, Terry Lambert wrote:
> Peter Pentchev wrote:
> > > Reinier Kleipool wrote:
> > > > I have compiled a new library,
> > > > and installed it in /usr/local/lib. If I then ask ldconfig(8) to updates its
> > > > hints file, the new library is not listed in the hints file. In
> > > > /usr/local/lib I see two other libraries that also are not listed:
> > > > pam_ldap.so pam_smb_auth.so.
> > 
> > I think that /etc/defaults/rc.conf's ldconfig_paths variable has
> > contained /usr/local/lib since at least February 1999, which is the
> > start of the src/etc/defaults/rc.conf CVS history.
> 
> Apparently does not work, according to the original posting.

The original posting did not mention a reboot, but rather a manual
ldconfig(8) invocation immediately after installing the libraries.  In
this case, your advice about ldconfig -m was correct, as I noted in the
part of my message that you snipped; but there are other directories to
be considered besides /usr/local/lib.

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
I've heard that this sentence is a rumor.



msg38420/pgp0.pgp
Description: PGP signature


Re: question about shared libraries and the library cache.

2002-12-01 Thread Terry Lambert
Peter Pentchev wrote:
> > Reinier Kleipool wrote:
> > > I have compiled a new library,
> > > and installed it in /usr/local/lib. If I then ask ldconfig(8) to updates its
> > > hints file, the new library is not listed in the hints file. In
> > > /usr/local/lib I see two other libraries that also are not listed:
> > > pam_ldap.so pam_smb_auth.so.
> 
> I think that /etc/defaults/rc.conf's ldconfig_paths variable has
> contained /usr/local/lib since at least February 1999, which is the
> start of the src/etc/defaults/rc.conf CVS history.

Apparently does not work, according to the original posting.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: question about shared libraries and the library cache.

2002-12-01 Thread Peter Pentchev
On Sun, Dec 01, 2002 at 02:46:16AM -0800, Terry Lambert wrote:
> Reinier Kleipool wrote:
> >   I have a question about shared libraries. I have compiled a new library,
> > and installed it in /usr/local/lib. If I then ask ldconfig(8) to updates its
> > hints file, the new library is not listed in the hints file. In
> > /usr/local/lib I see two other libraries that also are not listed:
> > pam_ldap.so pam_smb_auth.so.
> > 
> >   My question: What is so special about these libraries that they are not
> > listed in the ldconfig hints files? And for my own library: What do I need
> > to do to make my own library listed in ldconfig? Are there special ld(1)
> > flags needed to get it listed?
> 
> You have to add /usr/local/lib to the ldconfig search path, e.g.:
> 
>   ldconfig -m /usr/local/lib
> 
> If you want them to be there at boot time, you need to add:
> 
>   ldconfig_paths="/usr/lib /usr/local/lib"
> 
> in /etc/rc.conf.

I think that /etc/defaults/rc.conf's ldconfig_paths variable has
contained /usr/local/lib since at least February 1999, which is the
start of the src/etc/defaults/rc.conf CVS history.  Thus, all you need
to worry about is running ldconfig(8) by hand, in which case you should
not forget /usr/X11R6/lib, /usr/local/lib, and any other library
directories where ports might have installed stuff, such as MySQL's
/usr/local/lib/mysql/.

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
When you are not looking at it, this sentence is in Spanish.



msg38415/pgp0.pgp
Description: PGP signature


Re: question about shared libraries and the library cache.

2002-12-01 Thread Terry Lambert
Reinier Kleipool wrote:
>   I have a question about shared libraries. I have compiled a new library,
> and installed it in /usr/local/lib. If I then ask ldconfig(8) to updates its
> hints file, the new library is not listed in the hints file. In
> /usr/local/lib I see two other libraries that also are not listed:
> pam_ldap.so pam_smb_auth.so.
> 
>   My question: What is so special about these libraries that they are not
> listed in the ldconfig hints files? And for my own library: What do I need
> to do to make my own library listed in ldconfig? Are there special ld(1)
> flags needed to get it listed?

You have to add /usr/local/lib to the ldconfig search path, e.g.:

ldconfig -m /usr/local/lib

If you want them to be there at boot time, you need to add:

ldconfig_paths="/usr/lib /usr/local/lib"

in /etc/rc.conf.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



question about shared libraries and the library cache.

2002-12-01 Thread Reinier Kleipool
Hello,

  I have a question about shared libraries. I have compiled a new library,
and installed it in /usr/local/lib. If I then ask ldconfig(8) to updates its
hints file, the new library is not listed in the hints file. In
/usr/local/lib I see two other libraries that also are not listed:
pam_ldap.so pam_smb_auth.so.

  My question: What is so special about these libraries that they are not
listed in the ldconfig hints files? And for my own library: What do I need
to do to make my own library listed in ldconfig? Are there special ld(1)
flags needed to get it listed?

Kind regards,
Reinier Kleipool



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message