[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

shared build problems

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2001-11-25 01:17:58 CET

This is long, but if you understand our configuration system and
libtool pretty well, please read the whole thing -- your expertise is
needed. :-)

I just reverted revision 478, because it seems to have broken shared
builds; here I'm reporting what I saw so we can figure out what's
wrong and how to make it right. Reverting 478 fixed part of the
problem, leaving a (somewhat familiar) remainder problem.

Note that I'm not claiming there's anything necessarily wrong with
change 478. It might simply be that that change revealed another bug
elsewhere in our configuration system; not sure yet.

First, some background. Here's the log message and diff from revision
478:

   ------------------------------------------------------------------------
   rev 478: yoshiki | Mon 19 Nov 2001 02:41:55 | 5 lines
   
   * configure.in: Add new option --enable-dso. Default is
     --disable-dso. When enabled, libsvn_client tries to load
     RA libraries at run time. Otherwise, RA libraries are
     dynamically linked.
   
   ------------------------------------------------------------------------
   *** configure.in Sat Nov 24 08:35:08 2001
   --- configure.in Sat Nov 24 08:31:15 2001
   ***************
   *** 273,279 ****
     AC_SUBST(INSTALL_INFO)
     
     dnl decide whether we want to link against the RA libraries
   ! if test "$enable_shared" = "no"; then
       AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_DAV, 1,
             [Defined if libsvn_client should link against libsvn_ra_dav])
       SVN_RA_LIB_DEPS="subversion/libsvn_ra_dav/libsvn_ra_dav.la"
   --- 273,290 ----
     AC_SUBST(INSTALL_INFO)
     
     dnl decide whether we want to link against the RA libraries
   ! AC_ARG_ENABLE(dso,
   ! [ --enable-dso Turn on DSO loading of RA libralies],
   ! [
   ! if test "$enableval" = "yes"; then
   ! enable_dso=yes
   ! if test "$enable_shared" = "no"; then
   ! AC_MSG_ERROR([--enable-dso conflicts with --disable-shared])
   ! fi
   ! fi
   ! ])
   !
   ! if test "$enable_shared" = "no" -o "$enable_dso" != "yes"; then
       AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_DAV, 1,
             [Defined if libsvn_client should link against libsvn_ra_dav])
       SVN_RA_LIB_DEPS="subversion/libsvn_ra_dav/libsvn_ra_dav.la"

Below is a transcript of what was happening *before* I reverted the
above change. I'll configure without the --with-apxs stuff for
simplicity's sake, since the problem was identical with and without
that:

   floss$ su
   floss# /usr/local/bin/cleanup.sh
      [... this cleans libsvn_*, etc, out of /usr/local/lib ...]
   floss# exit
   floss$ cd top-of-my-subversion-working-copy
   floss$ svn up
   floss$ make distclean
   floss$ ./autogen.sh
   floss$ ./configure --enable-maintainer-mode \
                      --with-berkeley-db=/usr/local/BerkeleyDB.3.3
   floss$ make
      [... builds with no errors ...]
   floss$ ./subversion/clients/cmdline/svn --version
   Subversion Client, version 0.6.0
      compiled Nov 24 2001, 09:11:47
   
   Copyright (C) 2000-2001 CollabNet.
   Subversion is open source software, see http://subversion.tigris.org/
   
   The following repository access (RA) modules are available:
   
   * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
     - handles 'http' schema
   * ra_local : Module for accessing a repository on local disk.
     - handles 'file' schema

   floss$ su
   floss# make install
      [... output discussed later in this mail message ...]
   floss# exit
   floss$ ./subversion/clients/cmdline/svn --version
   lt-svn: error in loading shared libraries: libsvn_ra.so.0: cannot \
   open shared object file: No such file or directory
   floss$ /usr/local/bin/svn --version
   /usr/local/bin/svn: error in loading shared libraries: libsvn_ra.so.0: \
   cannot open shared object file: No such file or directory
   floss$ HUH?
   bash: HUH?: command not found
   floss$

Fascinating. Before I install, the newly-built binary reports that it
handles both ra_dav and ra_local. After the install, it can't even
load up properly, no matter where you invoke it from. Not only that,
but look who didn't get installed:

   floss$ ls /usr/local/lib/libsvn_ra*
   /usr/local/lib/libsvn_ra_dav.a /usr/local/lib/libsvn_ra_dav.so.0@
   /usr/local/lib/libsvn_ra_dav.la* /usr/local/lib/libsvn_ra_dav.so.0.0.0*
   /usr/local/lib/libsvn_ra_dav.so@

Only ra_dav libraries were installed; no ra, no ra_local. Where are
they? Let's ask the working copy:

   floss$ ls -l subversion/libsvn_ra/.libs
      [... output abbreviated for readability ...]
   total 88
   -rw-r--r-- 38596 libsvn_ra.a
   lrwxrwxrwx 15 libsvn_ra.la -> ../libsvn_ra.la
   -rw-r--r-- 1012 libsvn_ra.lai
   lrwxrwxrwx 18 libsvn_ra.so -> libsvn_ra.so.0.0.0
   lrwxrwxrwx 18 libsvn_ra.so.0 -> libsvn_ra.so.0.0.0
   -rwxr-xr-x 43424 libsvn_ra.so.0.0.0U*
   floss$ ls -l subversion/libsvn_ra_local/.libs
      [... output abbreviated for readability ...]
   total 268
   -rw-r--r-- 173500 libsvn_ra_local.a
   lrwxrwxrwx 21 libsvn_ra_local.la -> ../libsvn_ra_local.la
   -rw-r--r-- 941 libsvn_ra_local.lai
   lrwxrwxrwx 24 libsvn_ra_local.so -> libsvn_ra_local.so.0.0.0
   lrwxrwxrwx 24 libsvn_ra_local.so.0 -> libsvn_ra_local.so.0.0.0
   -rwxr-xr-x 85957 libsvn_ra_local.so.0.0.0U*

Well, those symbolic links look messed up -- they're pointing to
.so.0.0.0 files that don't exist. There are those files with "U"
appended to their names; not sure what that's about. Maybe this is
all proper libtool behavior, and I just am not sufficiently familiar
with it to know?

Anyway, at this point I reviewed the output of "make install" to see
if it even tried to install `libsvn_ra' and `libsvn_ra_local'. It did
try, and it failed. Below are the relevant sections from the output
of "make install" for each of ra, ra_dav, and ra_local, in that order.
Only ra_dav installed successfully. The other two apparently try to
link with -lsvn_ra_dav or -lsvn_repos, respectively, and bomb. Why
would they try this at link time? I'm not sure...

Here are the "make install" output excerpts:

--------------------------------------------------------------------------
For plain ra:
--------------------------------------------------------------------------

   cd subversion/libsvn_ra ; /bin/sh /home/kfogel/src/subversion/libtool --mode=install /home/kfogel/src/subversion/ac-helpers/install-sh -c libsvn_ra.la /usr/local/lib/libsvn_ra.la
   libtool: install: warning: relinking `libsvn_ra.la'
   cd /home/kfogel/src/subversion/subversion/libsvn_ra; /bin/sh /home/kfogel/src/subversion/libtool --mode=relink gcc -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -g -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread -DNEON_ZLIB -Wpointer-arith -Wwrite-strings -Wshadow -DSVN_DEBUG -DAP_DEBUG -I./subversion/include -I. -I/home/kfogel/src/subversion/apr/include -I/include -I/home/kfogel/src/subversion/neon/src -I./expat-lite -I/usr/local/BerkeleyDB.3.3/include -rpath /usr/local/lib -o libsvn_ra.la ra_loader.lo /home/kfogel/src/subversion/subversion/libsvn_ra_dav/libsvn_ra_dav.la /home/kfogel/src/subversion/neon/src/libneon.la -L/usr/local/lib -lz /home/kfogel/src/subversion/subversion/libsvn_ra_local/libsvn_ra_local.la /home/kfogel/src/subversion/subversion/libsvn_repos/libsvn_repos.la /home/kfogel/src/subversion/subversion/libsvn_fs/libsvn_fs.la -L/usr/local/BerkeleyDB.3.3/lib -ldb -lm -lcrypt -lnsl -ldl
   gcc -shared ra_loader.lo -Wl,--rpath -Wl,/usr/local/lib -L/home/kfogel/src/subversion/subversion/libsvn_subr/.libs -L/home/kfogel/src/subversion/subversion/libsvn_delta/.libs -L/usr/local/BerkeleyDB.3.3/lib -L/home/kfogel/src/subversion/subversion/libsvn_fs/.libs -L/home/kfogel/src/subversion/subversion/libsvn_repos/.libs -L/home/kfogel/src/subversion/neon/src/.libs -L/usr/local/lib -lsvn_ra_dav -lneon -lz -lsvn_ra_local -lsvn_repos -lsvn_fs -ldb -lm -lcrypt -lnsl -ldl -Wl,-soname -Wl,libsvn_ra.so.0 -o .libs/libsvn_ra.so.0.0.0
   /usr/bin/ld: cannot find -lsvn_ra_dav
   collect2: ld returned 1 exit status
   libtool: install: error: relink `libsvn_ra.la' with the above command before installing it

--------------------------------------------------------------------------
Now ra_dav:
--------------------------------------------------------------------------

   cd subversion/libsvn_ra_dav ; /bin/sh /home/kfogel/src/subversion/libtool --mode=install /home/kfogel/src/subversion/ac-helpers/install-sh -c libsvn_ra_dav.la /usr/local/lib/libsvn_ra_dav.la
   libtool: install: warning: relinking `libsvn_ra_dav.la'
   cd /home/kfogel/src/subversion/subversion/libsvn_ra_dav; /bin/sh /home/kfogel/src/subversion/libtool --mode=relink gcc -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -g -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread -DNEON_ZLIB -Wpointer-arith -Wwrite-strings -Wshadow -DSVN_DEBUG -DAP_DEBUG -I./subversion/include -I. -I/home/kfogel/src/subversion/apr/include -I/include -I/home/kfogel/src/subversion/neon/src -I./expat-lite -I/usr/local/BerkeleyDB.3.3/include -rpath /usr/local/lib -o libsvn_ra_dav.la session.lo props.lo log.lo merge.lo util.lo options.lo fetch.lo commit.lo /home/kfogel/src/subversion/neon/src/libneon.la -L/usr/local/lib -lz -lm -lcrypt -lnsl -ldl
   gcc -shared session.lo props.lo log.lo merge.lo util.lo options.lo fetch.lo commit.lo -Wl,--rpath -Wl,/usr/local/lib -L/usr/local/lib -lneon -lz -lm -lcrypt -lnsl -ldl -Wl,-soname -Wl,libsvn_ra_dav.so.0 -o .libs/libsvn_ra_dav.so.0.0.0
   /home/kfogel/src/subversion/ac-helpers/install-sh -c .libs/libsvn_ra_dav.so.0.0.0T /usr/local/lib/libsvn_ra_dav.so.0.0.0
   (cd /usr/local/lib && rm -f libsvn_ra_dav.so.0 && ln -s libsvn_ra_dav.so.0.0.0 libsvn_ra_dav.so.0)
   (cd /usr/local/lib && rm -f libsvn_ra_dav.so && ln -s libsvn_ra_dav.so.0.0.0 libsvn_ra_dav.so)
   /home/kfogel/src/subversion/ac-helpers/install-sh -c .libs/libsvn_ra_dav.lai /usr/local/lib/libsvn_ra_dav.la
   /home/kfogel/src/subversion/ac-helpers/install-sh -c .libs/libsvn_ra_dav.a /usr/local/lib/libsvn_ra_dav.a
   ranlib /usr/local/lib/libsvn_ra_dav.a
   chmod 644 /usr/local/lib/libsvn_ra_dav.a

--------------------------------------------------------------------------
Now ra_local:
--------------------------------------------------------------------------

   cd subversion/libsvn_ra_local ; /bin/sh /home/kfogel/src/subversion/libtool --mode=install /home/kfogel/src/subversion/ac-helpers/install-sh -c libsvn_ra_local.la /usr/local/lib/libsvn_ra_local.la
   libtool: install: warning: relinking `libsvn_ra_local.la'
   cd /home/kfogel/src/subversion/subversion/libsvn_ra_local; /bin/sh /home/kfogel/src/subversion/libtool --mode=relink gcc -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -g -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread -DNEON_ZLIB -Wpointer-arith -Wwrite-strings -Wshadow -DSVN_DEBUG -DAP_DEBUG -I./subversion/include -I. -I/home/kfogel/src/subversion/apr/include -I/include -I/home/kfogel/src/subversion/neon/src -I./expat-lite -I/usr/local/BerkeleyDB.3.3/include -rpath /usr/local/lib -o libsvn_ra_local.la ra_plugin.lo commit_editor.lo split_url.lo checkout.lo ../../subversion/libsvn_repos/libsvn_repos.la ../../subversion/libsvn_fs/libsvn_fs.la ../../subversion/libsvn_delta/libsvn_delta.la ../../subversion/libsvn_subr/libsvn_subr.la -lm -lcrypt -lnsl -ldl
   gcc -shared ra_plugin.lo commit_editor.lo split_url.lo checkout.lo -Wl,--rpath -Wl,/usr/local/lib -L/usr/local/BerkeleyDB.3.3/lib -L/usr/local/lib -lsvn_repos -lsvn_fs -lsvn_delta -lsvn_subr -lm -lcrypt -lnsl -ldl -Wl,-soname -Wl,libsvn_ra_local.so.0 -o .libs/libsvn_ra_local.so.0.0.0
   /usr/bin/ld: cannot find -lsvn_repos
   collect2: ld returned 1 exit status
   libtool: install: error: relink `libsvn_ra_local.la' with the above command before installing it

--------------------------------------------------------------------------

Then I reverted 478, and rebuilt everything exactly the same way
(complete with the cleanup.sh, "make distclean", etc). Here's how
things go immediately after building:

  floss$ subversion/clients/cmdline/svn --version
   Subversion Client, version 0.6.0
      compiled Nov 24 2001, 09:44:53
   
   Copyright (C) 2000-2001 CollabNet.
   Subversion is open source software, see http://subversion.tigris.org/
   
   The following repository access (RA) modules are available:
   
   

     [... okay, having no ra modules is typical, we just need to
     install ...]

   floss$ su
   floss# make install
   floss# exit
   floss$ subversion/clients/cmdline/svn --version
   Subversion Client, version 0.6.0
      compiled Nov 24 2001, 09:44:53
   
   Copyright (C) 2000-2001 CollabNet.
   Subversion is open source software, see http://subversion.tigris.org/
   
   The following repository access (RA) modules are available:
   
   * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
     - handles 'http' schema
   
  floss$ /usr/local/bin/svn --version
   Subversion Client, version 0.6.0
      compiled Nov 24 2001, 09:44:53
   
   Copyright (C) 2000-2001 CollabNet.
   Subversion is open source software, see http://subversion.tigris.org/
   
   The following repository access (RA) modules are available:
   
   * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
     - handles 'http' schema
   
   floss$
   
Okay, now we get ra_dav, but still no ra_local. We've seen this
phenomenon before, where ra_local doesn't get included in a shared
build, but I can't remember the cause. Does anyone recall?

Anyway, I reviewed the output of "make install" again. Everything
installed successfully except for `ra_local', which had the same link
error as before I reverted 478:

--------------------------------------------------------------------------

   cd subversion/libsvn_ra_local ; /bin/sh /home/kfogel/src/subversion/libtool --mode=install /home/kfogel/src/subversion/ac-helpers/install-sh -c libsvn_ra_local.la /usr/local/lib/libsvn_ra_local.la
   libtool: install: warning: relinking `libsvn_ra_local.la'
   cd /home/kfogel/src/subversion/subversion/libsvn_ra_local; /bin/sh /home/kfogel/src/subversion/libtool --mode=relink gcc -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -g -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread -DNEON_ZLIB -Wpointer-arith -Wwrite-strings -Wshadow -DSVN_DEBUG -DAP_DEBUG -I./subversion/include -I. -I/home/kfogel/src/subversion/apr/include -I/include -I/home/kfogel/src/subversion/neon/src -I./expat-lite -I/usr/local/BerkeleyDB.3.3/include -rpath /usr/local/lib -o libsvn_ra_local.la ra_plugin.lo commit_editor.lo split_url.lo checkout.lo ../../subversion/libsvn_repos/libsvn_repos.la ../../subversion/libsvn_fs/libsvn_fs.la ../../subversion/libsvn_delta/libsvn_delta.la ../../subversion/libsvn_subr/libsvn_subr.la -lm -lcrypt -lnsl -ldl
   gcc -shared ra_plugin.lo commit_editor.lo split_url.lo checkout.lo -Wl,--rpath -Wl,/usr/local/lib -L/usr/local/BerkeleyDB.3.3/lib -L/usr/local/lib -lsvn_repos -lsvn_fs -lsvn_delta -lsvn_subr -lm -lcrypt -lnsl -ldl -Wl,-soname -Wl,libsvn_ra_local.so.0 -o .libs/libsvn_ra_local.so.0.0.0
   /usr/bin/ld: cannot find -lsvn_repos
   collect2: ld returned 1 exit status
   libtool: install: error: relink `libsvn_ra_local.la' with the above command before installing it

--------------------------------------------------------------------------

In summary, with change 478, one can't (or at least, I can't) build a
shared binary that can use either ra_local or ra_dav. Without change
478, a shared binary can use ra_dav, but still not ra_local.

By the way, through all of this, configuring with --disable-shared
still works fine. Can get a static binary with both ra_local and
ra_dav anytime.

Thoughts?

-Karl

P.S. Just in case you were wondering:

   floss$ libtool --version
   ltmain.sh (GNU libtool) 1.4.2 (1.922.2.53 2001/09/11 03:18:52)
   floss$ autoconf --version
   autoconf (GNU Autoconf) 2.52
   [...]
   floss$

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:49 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.