libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 00/12] Improve AIX support: libltdl, filename-based versioning.


From: Michael Haubenwallner
Subject: [PATCH 00/12] Improve AIX support: libltdl, filename-based versioning.
Date: Tue, 2 Oct 2012 17:34:41 +0200

Hi,

here's a set of patches to fix the two major problems with current AIX support
in libtool, that is:

*) libltdl: lt_dlopen() does work /with/ runtime linking (LDFLAGS=-brtl) only.
*) libtool: /Without/ runtime linking, there is "some" versioning support, but
   still far from being ideal for package managers, as they have to deal with
   flags (F_LOADONLY) of Shared Objects, and merge them inside archive files,
   maybe conflicting with existing archives with the same name in /usr/lib/.
   But /with/ runtime linking, there is "no" versioning support in libtool at
   all, while - even worse - the symlinks do suggest the opposite.

With Import Files, it is possible to have filename-based versioning support on
AIX, using those symlinks known from Linux. However, Import Files prevent
static linking, so these should be used with the .so filename extension only.
But this requires to enable runtime linking via the -brtl (or -G) linker flag.

While there is a bunch of variants available to use Import Files, it turns
out to be easiest to put both a Shared Object named "shr.o" and an Import
File named "shr.imp" into an archive file named "libN.so.X", having the
F_LOADONLY flag set for "shr.o". This allows to have the symlink "libN.so"
referring to "libN.so.X" work as expected (as known from Linux).

I do call this the "aix-soname" right now, but more obvious names are welcome.

Unfortunately, this is incompatible with the current implementation /with/
runtime linking, as current "lib.so" is a standalone Shared Object rather
than an archive file. Replacing that "lib.so" by (a symlink to) an archive
file will break existing binaries built against (or inside) an existing site
which has enabled the current implementation of runtime linking.

So I'd like to introduce the configure switch "--enable-aix-soname", to
explicitly allow package /managers/ to enable the "aix-soname" for their site.
Additionally, package /maintainers/ can enable "aix-soname" with LT_INIT,
usually along some version bump, while still allowing package /managers/ to
"--disable-aix-soname".

The patches can be split into a few chunks with different goals. For each
chunk there is a bootstrapped snapshot available. Also, there is a script to
run the tests with different setups, to be used as:
$ ./runtests libtool-2.4.2.1*.tar.gz
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/runtests

[00]: Current master.
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/libtool-2.4.2.177-d674ea.tar.gz

[01..04]: Support lt_dlopen("libN.la") with shared archive members, to fix
the current situation /without/ runtime linking.
Fixes these tests /without/ LDFLAGS=-brtl:
    85: libdir of installed modules ok, was: FAILED (ltdl-libdir.at)
   110: C++ exception handling      ok, was: FAILED (exceptions.at)
No changes in test results /with/ LDFLAGS=-brtl.
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/libtool-2.4.2.181-caaf.tar.gz

[05..06]: Fix -no-undefined flag for current LDFLAGS=-brtl implementation.
There aren't any tests that expose a problem, but the -no-undefined flag
doesn't work as expected. And the symlinks really are useless - the versioning
test is skipped for a reason.
These patches aren't a real prerequisite, but the linkline fixed here serves
as template for the linkline used in "aix-soname" later.
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/libtool-2.4.2.183-62c0.tar.gz

[07..10]: Introduce optional filename-based shared library versioning, also
called the "aix-soname". Tweak tests to respect "aix-soname" for expected
results. Using --enable-aix-soname also does set LDFLAGS=-brtl, so the test
results need to be compared against those /with/ runtime linking:
   72: versioning           ok,               was: skipped (versioning.at)
  115: build tree relpaths  expected failure, was: ok      (deplibs-ident.at)
This one is broken /without/ runtime linking already, but (kind of) works
/with/. However, it also breaks with "aix-soname" enabled - see patch [11]:
  108: template test with subdirs FAILED,     was: ok (template.at)
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/libtool-2.4.2.187-5fb50.tar.gz

[11]: The template test expects undefined symbols in libB to trigger libA
being kept when the executable not needing libA itself is linked against both.
This test does succeed /with/ LDFLAGS=-brtl currently: Not because of the
symbols, but standalone Shared Objects being referenced /unconditionally/.
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/libtool-2.4.2.188-1d353.tar.gz

[12]: Not meant to be pushed (right now), but to have the traditional TESTS
also run with "aix-soname" enabled. I've been unable to find out how to pass
--enable-aix-soname to subsequent configure runs in "make check-TESTS".
http://dev.gentoo.org/~haubi/libtool/aix-soname-r1/libtool-2.4.2.189-06d1.tar.gz

While there's lots of inline commenting that should explain the ideas behind,
please tell if/where/how more documentation is needed.

Thank you for consideration!
/haubi/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]