[PATCH] Fix linker error from insufficient LDFLAGS

Ben Gamari bgamari.foss at gmail.com
Thu Apr 22 15:20:27 PDT 2010


It seems that LDFLAGS have recently been reorganized, along with the
introduction of a notmuch-shared rule. Unfortunately, the LDFLAGS used
in notmuch-shared don't include CONFIGURE_LDFLAGS. This caused linking
to fail with the following,

$ make V=1
gcc debugger.o gmime-filter-reply.o gmime-filter-headers.o notmuch.o notmuch-config.o notmuch-count.o notmuch-dump.o notmuch-new.o notmuch-reply.o notmuch-restore.o notmuch-search.o notmuch-search-tags.o notmuch-setup.o notmuch-show.o notmuch-tag.o notmuch-time.o query-string.o show-message.o json.o  -Llib -lnotmuch -o notmuch-shared
/usr/bin/ld: gmime-filter-reply.o: undefined reference to symbol 'g_mime_filter_set_size'
/usr/bin/ld: note: 'g_mime_filter_set_size' is defined in DSO //usr/lib64/libgmime-2.4.so.2 so try adding it to the linker command line
//usr/lib64/libgmime-2.4.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [notmuch-shared] Error 1
---
 Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 5bb570b..33b8213 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -31,7 +31,7 @@ GPG_FILE=$(SHA1_FILE).asc
 # Smash together user's values with our extra values
 FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
-FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch
+FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch $(CONFIGURE_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CC
 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
-- 
1.7.0.5



More information about the notmuch mailing list