From: Ian Jackson Subject: Re: libxenstore.so Makefile dependency issue Date: Tue, 21 Feb 2012 18:24:06 +0000 Message-ID: <20291.57670.186303.970388@mariner.uk.xensource.com> References: <20120220192655.GA8280@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120220192655.GA8280@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: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Olaf Hering writes ("[Xen-devel] libxenstore.so Makefile dependency issue"): > > This is the second time I run into this linking issue. A few days ago it > happend with a make -j 4 or 8 during automated rpm package build. Now it > happend with a fresh tree. My local system is openSuSE 11.4 with make > 3.82, the failed automated build was either openSUSE 11.4 or 12.1. > > For some reason the libxenstore.so symlink is created after > init-xenstore-domain is about to be linked. The ln command is not > visible in this output, I saw the ln invocation in the rpm build log. > > Hmm, and for some reason the symlink was not created anyway in my local > build. A second make run worked ok, libxenstore.so was created. It > looks like I can reproduce it by running make clean in tools/xenstore. > > Looking at the Makefile, init-xenstore-domain depends on LIBXENSTORE, > and libxenstore.so is also a target. So its not clear to me how make can > miss that, or how the dependencies should be listed. This is indeed mysterious. I haven't managed to reproduce it either. I tried the patch below, with make -j1000, and everything worked the way it should do. Ian. diff -r 6a34a42a2b5d tools/xenstore/Makefile --- a/tools/xenstore/Makefile Tue Feb 21 18:01:04 2012 +0000 +++ b/tools/xenstore/Makefile Tue Feb 21 18:23:46 2012 +0000 @@ -82,7 +82,7 @@ libxenstore.so.$(MAJOR): libxenstore.so. xs.opic: CFLAGS += -DUSE_PTHREAD libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread $(APPEND_LDFLAGS) + set -x; while test ! -f go$$$$; do sleep 10; done; $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread $(APPEND_LDFLAGS) libxenstore.a: xs.o xs_lib.o $(AR) rcs $@ $^