[PATCH] Don't link libnotmuch if libutil isn't linked in properly.

Tom Prince tom.prince at ualberta.net
Sun Nov 13 08:34:42 PST 2011


For some reason, on my machine, the link is picking up
/usr/lib/libutil.so instead of util/libutil.a. This causes there to be
undefined symbols in libnotmuch, making it unuseable. This patch causes
the link to fail instead.
---
 lib/Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 
On Sun, 13 Nov 2011 10:19:14 -0400, David Bremner <david at tethera.net> wrote:
> According to our sortof-schedule, we should release 0.10 soonish.  I'd
> like to freeze for a few days first, so that means we have time for
> maybe one or two more non-trivial patches before the freeze.

libnotmuch isn't linking properly to libutil for me. This seems to be
due to $(xapian-config --libs) including -L/usr/lib64, which then causes
-lutil to pick up /usr/lib64/libutil.so (from glibc) instead.
I noticed this failing because symbol-test fails to compile, causing
both symbol-hinding test to fail.

The following patch doesn't fix this, but does cuase the build to fail
earlier.

diff --git a/lib/Makefile.local b/lib/Makefile.local
index d58552c..cb53781 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -30,7 +30,7 @@ LIBRARY_SUFFIX = so
 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
-LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME)
+LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined
 ifeq ($(LIBDIR_IN_LDCONFIG),1)
 ifeq ($(DESTDIR),)
 LIBRARY_INSTALL_POST_COMMAND=ldconfig
--
1.7.6.1


More information about the notmuch mailing list