From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] build/xenstore: Correct static link failure for xenstore
Date: Mon, 15 Oct 2012 16:42:54 +0100 [thread overview]
Message-ID: <507C2EFE.8060806@citrix.com> (raw)
In-Reply-To: <1350315108.18058.73.camel@zakaz.uk.xensource.com>
On 15/10/12 16:31, Ian Campbell wrote:
> On Mon, 2012-10-15 at 16:24 +0100, Andrew Cooper wrote:
>> There is support for building xenstore clients statically. However,
>> recent changes to the makefiles have rendered the static build broken.
>>
>> tools/xenstore/Makefile sets LIBXENSTORE depending on whether
>> XENSTORE_STATIC_CLIENTS is specified, but will unconditionally try to
>> link against libxenstore.so by use of the LDLIBS_libxenstore variable.
>>
>> This patch doubles the logic already present to select the appropriate
>> library target.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> --
>> This is a bit of a hack, but seems to be the only reliable way,
>> espcially when linking with the LDLIBS_libxenstore variable in
>> toos/misc.
> I think it would be cleaner to define LDLIBS_libxenstore_static in
> Rules.mk alongside the existing thing and make the appropriate selection
> in the xenstore Makefile. That keeps the fugliness next to where it is
> used.
But that then requires patching for *every* consumer of
LDLIBS_libxenstore, which is a substantially larger and more invasive.
~Andrew
>
>> diff -r 099589002239 -r 952b1ef29246 tools/Rules.mk
>> --- a/tools/Rules.mk
>> +++ b/tools/Rules.mk
>> @@ -28,7 +28,11 @@ LDLIBS_libxenguest = $(XEN_LIBXC)/libxen
>> SHLIB_libxenguest = -Wl,-rpath-link=L$(XEN_LIBXC)
>>
>> CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude)
>> +ifneq ($(XENSTORE_STATIC_CLIENTS),y)
>> LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore.so
>> +else
>> +LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore.a
>> +endif
>> SHLIB_libxenstore = -Wl,-rpath-link=$(XEN_XENSTORE)
>>
>> CFLAGS_libxenstat = -I$(XEN_LIBXENSTAT)
>
--
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com
next prev parent reply other threads:[~2012-10-15 15:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 15:24 [PATCH] build/xenstore: Correct static link failure for xenstore Andrew Cooper
2012-10-15 15:31 ` Ian Campbell
2012-10-15 15:42 ` Andrew Cooper [this message]
2012-10-15 15:53 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=507C2EFE.8060806@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.