mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
cf: Set default --with-aix-soname to 'svr4'
OpenAFS builds both shared and static libraries by default. On most platforms, each library is built as a shared library libfoo.so.x.y.z, and as a static library libfoo.a. libtool refers to this as the 'svr4' style of libraries on AIX. On AIX, traditionally libraries are built with the shared library, static library, and various versions and 64-bit variants and such all contained in the same libfoo.a. libtool refers to this as the 'aix' style of libraries on AIX. libtool defaults to the 'aix' style on AIX, and so this is how libtool attempts to build our libraries on AIX. For many of our libraries, even though the build completes successfully, this results in broken binaries because our Makefile rules assume the shared and static library files have different names. For example, here is the install rule for librokenafs: install: $(SHARED_LIBS) librokenafs.a $(LT_INSTALL_DATA) librokenafs.la $(DESTDIR)$(libdir)/librokenafs.la $(RM) $(DESTDIR)$(libdir)/librokenafs.la $(INSTALL_DATA) librokenafs.a $(DESTDIR)$(libdir)/librokenafs.a On AIX, the LT_INSTALL_DATA step will install the shared library librokenafs.a into $(DESTDIR)$(libdir). Then the INSTALL_DATA step will install the static library librokenafs.a into the same location, deleting the shared library file. When the user tries to run an executable, they get an error, because the shared library librokenafs is not installed at all: $ /opt/openafs/bin/pts exec(): 0509-036 Cannot load program /opt/openafs/bin/pts because of the following errors: 0509-150 Dependent module /opt/openafs/lib/librokenafs.a(librokenafs.so.2) could not be loaded. 0509-152 Member librokenafs.so.2 is not found in archive To avoid this, the user can run configure with --with-aix-soname=svr4 to build all of our shared libraries in the 'svr4' style. In the above example, this causes LT_INSTALL_DATA to install the shared librokenafs as librokenafs.so.* into $(DESTDIR)$(libdir), and then the static library is installed as librokenafs.a like normal. The resulting binaries can then run without issue. To make it so users don't need to specify --with-aix-soname=svr4 to get a working build, change the default behavior to --with-aix-soname=svr4 by passing aix-soname=svr4 to LT_INIT. However, just specifying LT_INIT([aix-soname=svr4]) alone does not work, due to a bug in libtool: https://savannah.gnu.org/support/?111161 To workaround this bug, also explicitly turn on shared and static libraries by default in LT_INIT, even though they are already on by default. Using --disable-shared or --disable-static should still be honored as normal; the LT_INIT arguments just specify the default values. Ideally, we would install our shared libraries in the 'aix' style, so a single libfoo.a contains all of the necessary .o and .so files for that library. However, changing our build system to do this is difficult. And historically, OpenAFS has built shared libraries on AIX in the 'svr4' style; that is how we built shared libraries in OpenAFS 1.6 and earlier, before we converted to using libtool. Change-Id: Ifd2538c635323c568f0d8b2e621cc0b8594721ae Reviewed-on: https://gerrit.openafs.org/15983 Reviewed-by: Ben Huntsman <ben@huntsmans.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net>
This commit is contained in:
parent
d98377ca72
commit
b0e852bc1a
@ -18,7 +18,14 @@ dnl libtool.
|
|||||||
AC_DEFUN([AFS_LT_INIT],
|
AC_DEFUN([AFS_LT_INIT],
|
||||||
[AC_REQUIRE([AFS_LT_PATH_NM])
|
[AC_REQUIRE([AFS_LT_PATH_NM])
|
||||||
|
|
||||||
LT_INIT
|
dnl For AIX, change the --with-aix-soname default to be 'svr4' (builds a static
|
||||||
|
dnl libfoo.a and a shared libfoo.so) instead of 'aix' (builds the static and
|
||||||
|
dnl shared objects together in libfoo.a).
|
||||||
|
dnl
|
||||||
|
dnl Also specify 'shared' and 'static' to enable shared and static libraries by
|
||||||
|
dnl default. These are already turned on by default, but we specify them
|
||||||
|
dnl explicitly here to workaround libtool bug #111161.
|
||||||
|
LT_INIT([shared static aix-soname=svr4])
|
||||||
|
|
||||||
dnl If libtool cannot figure out how to extract symbol names from 'nm', then it
|
dnl If libtool cannot figure out how to extract symbol names from 'nm', then it
|
||||||
dnl will log a failure and lt_cv_sys_global_symbol_pipe will be unset, but it
|
dnl will log a failure and lt_cv_sys_global_symbol_pipe will be unset, but it
|
||||||
|
Loading…
Reference in New Issue
Block a user