[5490] in Moira

home help back first fref pref prev next nref lref last post

Bug in shared library builds

daemon@ATHENA.MIT.EDU (Evan Broder)
Sun Oct 18 17:53:01 2009

Message-ID: <4ADB8E32.9080603@mit.edu>
Date: Sun, 18 Oct 2009 17:52:50 -0400
From: Evan Broder <broder@MIT.EDU>
MIME-Version: 1.0
To: moiradev@mit.edu
Content-Type: multipart/mixed;
 boundary="------------020007090604030002060508"

This is a multi-part message in MIME format.
--------------020007090604030002060508
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi -
    I think I've found a bug in the new shared library build process.
Currently configure.in sets

LIBS="-lmoira $KLIBS"

on line 467.

This seems to cause the linker to prefer a globally installed libmoira
over the one in the build tree. Since it is linking a shared library and
not a static one, this generally works out, but you'll run into problems
if you add new symbols to libmoira. I think instead you want to link
against the libmoira.la file directly, which is defined just below in
MR_LIBDEP.

I believe the attached patch will fix the issue.

- Evan

--------------020007090604030002060508
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="use-build-tree-libmoira.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="use-build-tree-libmoira.patch"

diff -ur moira-20091016.orig/configure.in moira-20091016/configure.in
--- moira-20091016.orig/configure.in    2009-10-16 16:37:18.000000000 -0400
+++ moira-20091016/configure.in 2009-10-18 17:27:47.000000000 -0400
@@ -464,12 +464,12 @@
 if test "$zephyr" != no; then
   KLIBS="-lzephyr $KLIBS"
 fi
-LIBS="-lmoira $KLIBS"
-AC_SUBST(KLIBS)
-
 MR_LIBDEP='$(BUILDTOP)/lib/libmoira.la'
 AC_SUBST(MR_LIBDEP)
 
+LIBS="$MR_LIBDEP $KLIBS"
+AC_SUBST(KLIBS)
+
 AC_OUTPUT(Makefile lib/Makefile include/Makefile clients/Makefile \
          clients/lib/Makefile clients/addusr/Makefile \
          clients/blanche/Makefile clients/chfn/Makefile \

--------------020007090604030002060508--

home help back first fref pref prev next nref lref last post