[PATCH 2/3] build: fix DSO dependencies

Carl Worth cworth at cworth.org
Fri Oct 29 14:37:16 PDT 2010


On Sat,  5 Jun 2010 14:05:14 +0300, Felipe Contreras <felipe.contreras at gmail.com> wrote:
> At least on Fedora 13, this doesn't link; the linker finds the
> dependencies, and aborts saying we should include them.
...
> We do need to link at least to what we really use, the linker resolves
> the dependencies of our dependencies at loading time. So let's only
> specify what we use directly.

Hi Felipe,

You're certainly right that the linking was bogus. The notmuch binary
was only linking directly against libnotmuch (which in turned linked
against GMime, Xapian, and talloc). But meanwhile, the notmuch binary
is also directly using GMime and talloc so should be linking directly
against those.

> -ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
>  FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
> -FINAL_NOTMUCH_LINKER = CXX
> -endif

But the change above causes the notmuch binary to also link directly
against Xapian, (which the binary does not use directly), so that's
undesired.

> -	gmime_ldflags=$(pkg-config --libs $gmimepc)
> +	if [ $linker_resolves_library_dependencies = "1" ]; then
> +		gmime_ldflags="-lgmime-2.6 -lgobject-2.0 -lglib-2.0"
> +	else
> +		gmime_ldflags=$(pkg-config --libs $gmimepc)
> +	fi

This part I don't understand. Why is it necessary to avoid using
pkg-config in this case? That sounds to me like a maintenance
nightmare. If the pkg-config information for GMime is wrong then we
should get that fixed, and not workaround it.

So, finally, I implemented a much more narrow fix for the linking
problem, (simply adding $(GMIME_LDFLAGS) and $(TALLOC_LDFLAGS) to the
FINAL_NOTMUCH_LDFLAGS assignement).

I tested this by installing binutils-gold on my Debian system. This
caused a compilation failure before my patch, but compilation succeeds
after my patch. I'm optimistic that this means that a Fedora compilation
will work as well now. Can you test that please?

-Carl

PS. For the other two patches you sent. I couldn't see that #1 (moving
the platform-detection earlier in configure) is necessary. But #3 seems
obviously correct, so I've pushed that now.

I do apologize that it has been many months since you posted these
patches, and that you got no review of them until now. But thanks indeed
for sending them!

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20101029/2cd9303d/attachment.pgp>


More information about the notmuch mailing list