|
|||||
| | |||||
|
library.a ... indicates the name of a static library.
library.so.version ... indicates a shared library. The stubs are copied from this file and placed in the executable, allowing it to load the library according to ld.so
use the command ldd to show the shared dependencies of an executable (e.g. ldd /usr/bin/X11/term).
libc is the standard c library and as a result of the ldd command, it will show up as libc.so.5=> /lib/libc.so.5.0.9 The version of the number of the library for which the program was compiled is followed by (points to) the location of that library. For a library to be compatible, the major version must match.
On my linux RH7.0 system, in /lib directory, libc.so.6 -> libc.2.1.92.so. libc.2.1.92.so is found in /lib too.
The order is declared in /etc/ld.so.conf.
The directive LD_LIBRARY_PATH tells the compiler to look in a special place to find your private libraries; it is an environmental variable. And the -L compiler option? It adds directories to look for header files to the normal search path. Thus, it has nothing to do with the linking stage of compilation, only with the compilation stage.
If you modify /etc/ld.so.conf you need do ldconfig in order to regenerate.
evacuating the old files:
The following is taken from the gnu install file found with glibc tarball.
None of your old libraries, static or shared, can be used with a different C library major version. For shared libraries this is not a problem, because the filenames are different and the dynamic linker will enforce the restriction. But static libraries have no version information. You have to evacuate all the static libraries in /usr/lib to a safe location.
The following is taken from the masterfully written piece of prose written in 1995 by Welsh and Kaufmann, Running Linux.
"When you upgrade a library, you must replace the .a and .so.version files corresponding to the library. The .a file is easy: just copy over it with the new versions. However, you must use some caution when replacing the shared library image, .so.version; most of the programs on the system depend on those images, so youcan't simply delete them or rename them. To put this another way, the symbolic link library.so.major must always point to a valid library image. To accomplish this, first copy the new image file to /lib, and then change the symbolic link to pont to the new file in one step, using
ln -sf. "We can do this in the following way:
pwd
response: /lib
cp libc.so.5.1 /lib
ls -l /lib/libc*
response: shows the library there with a symbolic link pointing to the old libc.so.5.0.9
ln -sf /lib/libc.so.5.1 /lib/libc.so.5
this updated the symbolic link, and now, you can remove the old libc.so.5.0.9.
and be sure to runldconfig
A way to update your system to have both glib5 and glib6 present is noted at http://huizen.dds.nl/~frodol/glibc/overview.html.
a fresh install like that above is unnecessary if you are not changing the major version of your library, i.e. if not upgrading from libc5 to libc6.
compile options to making glibc:
./configure --prefix=/usr
glibc faq
reference question 2.2
check the output of nm /root/cvs/modperl-2.0/src/modules/perl/mod_perl.so and it may show something like should be something like U Perl_Ipatchlevel_ptr. which is an unresolved symbol, which gets resolved when libperl.so is loaded. To find out which perl library you have linked against, do: ldd modules/mod_perl.so |grep perl. libperl.so => /home/stas/perl/blead-ithread/lib/5.9.0/i686-linux-thread-multi/CORE/libperl.so (0x4002e000). Now you can check whether the symbol is there. in my case: nm /home/stas/perl/blead-ithread/lib/5.9.0/i686-linux-thread-multi/CORE/libperl.so |grep Perl_Ipatch ::::::::::0011fa41 T Perl_Ipatchlevel_ptr. Chances are that you are linking against the wrong perl library, which will explain the resolving problem.
source: post by stas bekman on the mod perl mailing list (jan 22 2003)
| Leave a Reply |