This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Soname for 32bit/64bit Linux


Here is my proposal for library names on 32bit/64bit Linux.


-- 
H.J. Lu (hjl@gnu.org)
---
There is nothing really preventing us from putting a library, libfoo,
with different ABIs in a directory, say /usr/lib. The only problem
is the linker will search for libfoo.so and libfoo.a when -lfoo is
passed. It may not find the right one.

To resolve it, we require

1. soname of a shared object for libfoo, should not be libfoo.so. The
real filename of a shared object for libfoo, should not be libfoo.so
either.

2. soname of a shared object for libfoo should encode ABI, which
is calling convention plus the data structure for libfoo and
data structure for libc used to compile libfoo. We can use

libfoo-${libc_version}-${ABI}.so.${libfoo_version}

for soname and use

libfoo-${libfoo_version}-${libc_version}-${ABI}-${libfoo_release}.so

for the real filename. soname is a symlink to it. For the static
archive, we have

libfoo-${libc_version}-${ABI}.a.${libfoo_version}

for soname and use

libfoo-${libfoo_version}-${libc_version}-${ABI}-${libfoo_release}.a

libfoo.so is a symlink to

libfoo-${libc_version}-${ABI}.so.${libfoo_version}

and libfoo.a is a symlink to

libfoo-${libc_version}-${ABI}.a.${libfoo_version}

3. Install both ABI32 and ABI64 under /usr/lib.

4. For ABI32, we use the old soname scheme.

5. For ABI64, we use the new soname scheme.

6. If we don't want to compile ABI32 binary with libfoo, remove the
symlink of the ABI32 libfoo.so from /usr/lib and keep the symlink of
libfoo.so to ABI64 in /usr/lib.

7. If we want to compile ABI32 binary using libfoo, move the symlink of
the ABI32 libfoo.so from /usr/lib to /ABI32/usr/lib and keep the symlink
of the ABI64 libfoo.so in /usr/lib. We modify the compiler/linker to
search /ABI32/usr/lib instead of /usr/lib for libfoo.so when compiling
for ABI32.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]