mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 06:50:12 +00:00
b0e852bc1a
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> |
||
---|---|---|
build-tools | ||
doc | ||
src | ||
tests | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.splintrc | ||
acinclude.m4 | ||
CODING | ||
configure-libafs.ac | ||
configure.ac | ||
CONTRIBUTING | ||
INSTALL | ||
libafsdep | ||
LICENSE | ||
Makefile-libafs.in | ||
Makefile.in | ||
NEWS | ||
NTMakefile | ||
README | ||
README-WINDOWS | ||
regen.sh |
AFS is a distributed file system that enables users to share and access all of the files stored in a network of computers as easily as they access the files stored on their local machines. The file system is called distributed for this exact reason: files can reside on many different machines, but are available to users on every machine. OpenAFS 1.0 was originally released by IBM under the terms of the IBM Public License 1.0 (IPL10). For details on IPL10 see the LICENSE file in this directory. The current OpenAFS distribution is licensed under a combination of the IPL10 and many other licenses as granted by the relevant copyright holders. The LICENSE file in this directory contains more details, thought it is not a comprehensive statement. See INSTALL for information about building and installing OpenAFS on various platforms. See CODING for developer information and guidelines. See NEWS for recent changes to OpenAFS.