unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 0/2] build fixes
@ 2010-10-29 23:16 Felipe Contreras
  2010-10-29 23:16 ` [PATCH 1/2] build: fix DSO dependencies Felipe Contreras
  2010-10-29 23:16 ` [PATCH 2/2] build: only link to what we really use Felipe Contreras
  0 siblings, 2 replies; 4+ messages in thread
From: Felipe Contreras @ 2010-10-29 23:16 UTC (permalink / raw)
  To: notmuch

Hi,

Here are a couple of build fixes. One is required to build on Fedora 13, the
other is just nice (at least gets rid of some debian lintian warnings).

Carl Worth (1):
  build: fix DSO dependencies

Felipe Contreras (1):
  build: only link to what we really use

 Makefile.local |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

-- 
1.7.3.2.2.g0dc5c

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] build: fix DSO dependencies
  2010-10-29 23:16 [PATCH 0/2] build fixes Felipe Contreras
@ 2010-10-29 23:16 ` Felipe Contreras
  2010-10-29 23:16 ` [PATCH 2/2] build: only link to what we really use Felipe Contreras
  1 sibling, 0 replies; 4+ messages in thread
From: Felipe Contreras @ 2010-10-29 23:16 UTC (permalink / raw)
  To: notmuch

From: Carl Worth <cworth@cworth.org>

At least on Fedora 13, this doesn't link; the linker finds the
dependencies, and aborts saying we should include them.

/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/lib/libgmime-2.6.so.0 so try adding it to the linker command line
/usr/lib/libgmime-2.6.so.0: could not read symbols: Invalid operation

We do need to link at least to what we really use, the linker resolves
the dependencies of our dependencies at loading time.

For more information, see:
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

Reported by Felipe Contreras, rewrote by Carl Worth.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index bc61a3c..9fed725 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 $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CC
 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
-- 
1.7.3.2.2.g0dc5c

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] build: only link to what we really use
  2010-10-29 23:16 [PATCH 0/2] build fixes Felipe Contreras
  2010-10-29 23:16 ` [PATCH 1/2] build: fix DSO dependencies Felipe Contreras
@ 2010-10-29 23:16 ` Felipe Contreras
  2010-10-30 20:38   ` Carl Worth
  1 sibling, 1 reply; 4+ messages in thread
From: Felipe Contreras @ 2010-10-29 23:16 UTC (permalink / raw)
  To: notmuch

At least linux has the -Wl,--as-needed option.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Makefile.local |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 9fed725..70c395a 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -33,7 +33,9 @@ FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CC
-ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
+ifeq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
+FINAL_NOTMUCH_LDFLAGS += -Wl,--as-needed
+else
 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CXX
 endif
-- 
1.7.3.2.2.g0dc5c

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] build: only link to what we really use
  2010-10-29 23:16 ` [PATCH 2/2] build: only link to what we really use Felipe Contreras
@ 2010-10-30 20:38   ` Carl Worth
  0 siblings, 0 replies; 4+ messages in thread
From: Carl Worth @ 2010-10-30 20:38 UTC (permalink / raw)
  To: Felipe Contreras, notmuch

[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]

On Sat, 30 Oct 2010 02:16:47 +0300, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> At least linux has the -Wl,--as-needed option.
> 
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

Thanks, Felipe.

I've pushed this.

I also followed it up with a change to do a configure-time check for the
-Wl,--as-needed option, (since I don't like having platform-specific
conditionals in the Makefile). And this conditional:

> -ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
> +ifeq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
> +FINAL_NOTMUCH_LDFLAGS += -Wl,--as-needed
> +else

wasn't only platform-specific, but actually using one conditional, ("linker
resolved library dependencies"), for another, ("platform is
linux"). That's a kind of fragility that I also don't like.

But thanks very much for adding the --as-needed option.

And please let me know if everything is building well for you now. (For the
first patch you sent in this set, I had already pushed my own version.)

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-30 20:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 23:16 [PATCH 0/2] build fixes Felipe Contreras
2010-10-29 23:16 ` [PATCH 1/2] build: fix DSO dependencies Felipe Contreras
2010-10-29 23:16 ` [PATCH 2/2] build: only link to what we really use Felipe Contreras
2010-10-30 20:38   ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).