Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0D4F9431FC7 for ; Mon, 12 May 2014 11:02:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QLYHjzkY+Xs7 for ; Mon, 12 May 2014 11:02:16 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id A7963431FC2 for ; Mon, 12 May 2014 11:02:16 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 04CEA100051; Mon, 12 May 2014 21:02:08 +0300 (EEST) From: Tomi Ollila To: Felipe Contreras , notmuch@notmuchmail.org Subject: Re: [PATCH] build: fix order of rpath In-Reply-To: <1399861345-25397-1-git-send-email-felipe.contreras@gmail.com> References: <1399861345-25397-1-git-send-email-felipe.contreras@gmail.com> User-Agent: Notmuch/0.18+11~gb21401f (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain Cc: Moritz Wilhelmy X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 18:02:20 -0000 On Mon, May 12 2014, Felipe Contreras wrote: > In my system `pkg-config --libs talloc` returns > 'Wl,-rpath,/usr/lib -ltalloc' (probably wrongly) which causes the final > LDFLAGS to be something like '-Wl,-rpath,/usr/lib > -Wl,-rpath,/opt/notmuch/lib', which causes the RUNPATH to be > '/usr/lib:/opt/notmuch/lib', so basically defeating the whole purpose of > RUNPATH. > > I noticed this when my /opt/notmuch/bin/notmuch (0.17) started updating > the database after I updated the system (which updated the system's > notmuch). This shouldn't happen. > > Let's move the RUNPATH flags before other external flags have a chance of > screwing the build. > > Signed-off-by: Felipe Contreras > --- LGTM. Works for me (i.e. did not break my RPATH setting for notmuch-shared binary. Tomi > Makefile.local | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/Makefile.local b/Makefile.local > index fa07d81..af79b5c 100644 > --- a/Makefile.local > +++ b/Makefile.local > @@ -46,15 +46,16 @@ PV_FILE=bindings/python/notmuch/version.py > # Smash together user's values with our extra values > FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS) > FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) $(CONFIGURE_CXXFLAGS) > -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS) > +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch > +ifeq ($(LIBDIR_IN_LDCONFIG),0) > +FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS) > +endif > +FINAL_NOTMUCH_LDFLAGS += $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS) > FINAL_NOTMUCH_LINKER = CC > ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) > FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS) > FINAL_NOTMUCH_LINKER = CXX > endif > -ifeq ($(LIBDIR_IN_LDCONFIG),0) > -FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS) > -endif > FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(CONFIGURE_LDFLAGS) > > .PHONY: all > -- > 1.9.2+fc1~45~g3953d93 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch