From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] tools/xenstore: fix link error with libsystemd Date: Fri, 5 Dec 2014 10:53:03 +0000 Message-ID: <1417776783.22808.55.camel@citrix.com> References: <1417776587-26018-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417776587-26018-1-git-send-email-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Wei Liu , Ian Jackson , Stefano Stabellini , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-12-05 at 11:49 +0100, Olaf Hering wrote: > Linking fails with undefined reference to the used systemd functions. > Move LDFLAGS after the object files to fix the failure. > > Signed-off-by: Olaf Hering > Cc: Ian Jackson > Cc: Stefano Stabellini Acked-by: Ian Campbell This should go into 4.5. FWIW my suspicion is that this relates to toolstacks using --as-needed by default. > Cc: Wei Liu > --- > tools/xenstore/Makefile | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile > index bff9b25..11b6a06 100644 > --- a/tools/xenstore/Makefile > +++ b/tools/xenstore/Makefile > @@ -74,10 +74,10 @@ endif > init-xenstore-domain.o: CFLAGS += $(CFLAGS_libxenguest) > > init-xenstore-domain: init-xenstore-domain.o $(LIBXENSTORE) > - $(CC) $(LDFLAGS) $^ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -o $@ $(APPEND_LDFLAGS) > + $(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -o $@ $(APPEND_LDFLAGS) > > xenstored: $(XENSTORED_OBJS) > - $(CC) $(LDFLAGS) $^ $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) > + $(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) > > xenstored.a: $(XENSTORED_OBJS) > $(AR) cr $@ $^ > @@ -86,13 +86,13 @@ $(CLIENTS): xenstore > ln -f xenstore $@ > > xenstore: xenstore_client.o $(LIBXENSTORE) > - $(CC) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) > + $(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) > > xenstore-control: xenstore_control.o $(LIBXENSTORE) > - $(CC) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) > + $(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) > > xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o > - $(CC) $(LDFLAGS) $^ -o $@ $(APPEND_LDFLAGS) > + $(CC) $^ $(LDFLAGS) -o $@ $(APPEND_LDFLAGS) > > libxenstore.so: libxenstore.so.$(MAJOR) > ln -sf $< $@