xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] oxenstored: link in the systemd system library
@ 2015-07-22 22:02 Jonathan Creekmore
  2015-07-23  8:41 ` Ian Campbell
  2015-07-23  9:02 ` [PATCH] " Dave Scott
  0 siblings, 2 replies; 8+ messages in thread
From: Jonathan Creekmore @ 2015-07-22 22:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Jonathan Creekmore, dave.scott

If systemd is configured for use AND you are building oxenstored, the C
systemd library must be linked in to the oxenstored binary instead of
just into the static ocaml stub.

Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
---
 tools/ocaml/xenstored/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index d861f11..38ca347 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -64,9 +64,11 @@ XENSTOREDLIBS = \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xb $(OCAML_TOPLEVEL)/libs/xb/xenbus.cmxa \
 	-ccopt -L -ccopt $(XEN_ROOT)/tools/libxc
 
+XENSTORED_LDFLAGS-$(CONFIG_SYSTEMD) += -cclib $(SYSTEMD_LIBS)
+
 PROGRAMS = oxenstored
 
-oxenstored_LIBS = $(XENSTOREDLIBS)
+oxenstored_LIBS = $(XENSTOREDLIBS) $(XENSTORED_LDFLAGS-y)
 oxenstored_OBJS = $(OBJS)
 
 OCAML_PROGRAM = oxenstored
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] oxenstored: link in the systemd system library
  2015-07-22 22:02 [PATCH] oxenstored: link in the systemd system library Jonathan Creekmore
@ 2015-07-23  8:41 ` Ian Campbell
  2015-07-23 13:40   ` [PATCH v2] " Jonathan Creekmore
  2015-07-23  9:02 ` [PATCH] " Dave Scott
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2015-07-23  8:41 UTC (permalink / raw)
  To: Jonathan Creekmore, xen-devel; +Cc: dave.scott

On Wed, 2015-07-22 at 17:02 -0500, Jonathan Creekmore wrote:
> If systemd is configured for use AND you are building oxenstored, the 
> C
> systemd library must be linked in to the oxenstored binary instead of
> just into the static ocaml stub.

I can't see where it is linked into the static ocaml stub at all,
compared with tools/ocaml/libs/* there is no LIBS_systemd declared in
tools/ocaml/xenstore/Makefile. AIUI this is supposed to cause the
underlying library to be referenced by the cxma such that you don't
need it at application link time.

It's also the case that we don't seem to link xenstored against any
other libraries in this way, they get picked up via the cxma.

So I think the right fix is probably to set LIBS_systemd, or otherwise
arrange for this argument to be used when creating the systemd.cxma.

Ian.

> 
> Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
> ---
>  tools/ocaml/xenstored/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/ocaml/xenstored/Makefile 
> b/tools/ocaml/xenstored/Makefile
> index d861f11..38ca347 100644
> --- a/tools/ocaml/xenstored/Makefile
> +++ b/tools/ocaml/xenstored/Makefile
> @@ -64,9 +64,11 @@ XENSTOREDLIBS = \
>  	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xb 
> $(OCAML_TOPLEVEL)/libs/xb/xenbus.cmxa \
>  	-ccopt -L -ccopt $(XEN_ROOT)/tools/libxc
>  
> +XENSTORED_LDFLAGS-$(CONFIG_SYSTEMD) += -cclib $(SYSTEMD_LIBS)
> +
>  PROGRAMS = oxenstored
>  
> -oxenstored_LIBS = $(XENSTOREDLIBS)
> +oxenstored_LIBS = $(XENSTOREDLIBS) $(XENSTORED_LDFLAGS-y)
>  oxenstored_OBJS = $(OBJS)
>  
>  OCAML_PROGRAM = oxenstored

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] oxenstored: link in the systemd system library
  2015-07-22 22:02 [PATCH] oxenstored: link in the systemd system library Jonathan Creekmore
  2015-07-23  8:41 ` Ian Campbell
@ 2015-07-23  9:02 ` Dave Scott
  1 sibling, 0 replies; 8+ messages in thread
From: Dave Scott @ 2015-07-23  9:02 UTC (permalink / raw)
  To: Jonathan Creekmore; +Cc: Xen-devel


> On 22 Jul 2015, at 23:02, Jonathan Creekmore <jonathan.creekmore@gmail.com> wrote:
> 
> If systemd is configured for use AND you are building oxenstored, the C
> systemd library must be linked in to the oxenstored binary instead of
> just into the static ocaml stub.

This sounds sensible to me,

Acked-by: David Scott <dave.scott@citrix.com>

> 
> Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
> ---
> tools/ocaml/xenstored/Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
> index d861f11..38ca347 100644
> --- a/tools/ocaml/xenstored/Makefile
> +++ b/tools/ocaml/xenstored/Makefile
> @@ -64,9 +64,11 @@ XENSTOREDLIBS = \
> 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xb $(OCAML_TOPLEVEL)/libs/xb/xenbus.cmxa \
> 	-ccopt -L -ccopt $(XEN_ROOT)/tools/libxc
> 
> +XENSTORED_LDFLAGS-$(CONFIG_SYSTEMD) += -cclib $(SYSTEMD_LIBS)
> +
> PROGRAMS = oxenstored
> 
> -oxenstored_LIBS = $(XENSTOREDLIBS)
> +oxenstored_LIBS = $(XENSTOREDLIBS) $(XENSTORED_LDFLAGS-y)
> oxenstored_OBJS = $(OBJS)
> 
> OCAML_PROGRAM = oxenstored
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] oxenstored: link in the systemd system library
  2015-07-23  8:41 ` Ian Campbell
@ 2015-07-23 13:40   ` Jonathan Creekmore
  2015-07-23 14:00     ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Creekmore @ 2015-07-23 13:40 UTC (permalink / raw)
  To: xen-devel; +Cc: Jonathan Creekmore, dave.scott

If systemd is configured for use AND you are building oxenstored, the C
systemd library must be linked in to the systemd.cxma library.

Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>

---
Changed since v1:
  * Link the systemd library in to the systemd.cxma instead of the final
  binary.
---
 tools/ocaml/xenstored/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index d861f11..59875f7 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -30,6 +30,8 @@ systemd_OBJS = systemd
 systemd_C_OBJS = systemd_stubs
 OCAML_LIBRARY += systemd
 
+LIBS_systemd += $(LDFLAGS-y)
+
 OBJS = define \
 	stdext \
 	trie \
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] oxenstored: link in the systemd system library
  2015-07-23 13:40   ` [PATCH v2] " Jonathan Creekmore
@ 2015-07-23 14:00     ` Ian Campbell
  2015-07-23 14:03       ` Jonathan Creekmore
  2015-07-24 11:04       ` Ian Campbell
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Campbell @ 2015-07-23 14:00 UTC (permalink / raw)
  To: Jonathan Creekmore, xen-devel; +Cc: dave.scott

On Thu, 2015-07-23 at 08:40 -0500, Jonathan Creekmore wrote:
> If systemd is configured for use AND you are building oxenstored, the 
> C
> systemd library must be linked in to the systemd.cxma library.
> 
> Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

OOI what was the failure mode for you without this? Runtime rather than
build time I suspect?

> ---
> Changed since v1:
>   * Link the systemd library in to the systemd.cxma instead of the 
> final
>   binary.
> ---
>  tools/ocaml/xenstored/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/ocaml/xenstored/Makefile 
> b/tools/ocaml/xenstored/Makefile
> index d861f11..59875f7 100644
> --- a/tools/ocaml/xenstored/Makefile
> +++ b/tools/ocaml/xenstored/Makefile
> @@ -30,6 +30,8 @@ systemd_OBJS = systemd
>  systemd_C_OBJS = systemd_stubs
>  OCAML_LIBRARY += systemd
>  
> +LIBS_systemd += $(LDFLAGS-y)
> +
>  OBJS = define \
>  	stdext \
>  	trie \

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] oxenstored: link in the systemd system library
  2015-07-23 14:00     ` Ian Campbell
@ 2015-07-23 14:03       ` Jonathan Creekmore
  2015-07-23 14:06         ` Ian Campbell
  2015-07-24 11:04       ` Ian Campbell
  1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Creekmore @ 2015-07-23 14:03 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, dave.scott


> On Jul 23, 2015, at 9:00 AM, Ian Campbell <ian.campbell@citrix.com> wrote:
> 
> On Thu, 2015-07-23 at 08:40 -0500, Jonathan Creekmore wrote:
>> If systemd is configured for use AND you are building oxenstored, the 
>> C
>> systemd library must be linked in to the systemd.cxma library.
>> 
>> Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> OOI what was the failure mode for you without this? Runtime rather than
> build time I suspect?

No, it was build-time. It failed to link the oxenstored binary due to missing symbols. 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] oxenstored: link in the systemd system library
  2015-07-23 14:03       ` Jonathan Creekmore
@ 2015-07-23 14:06         ` Ian Campbell
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-07-23 14:06 UTC (permalink / raw)
  To: Jonathan Creekmore; +Cc: xen-devel, dave.scott

On Thu, 2015-07-23 at 09:03 -0500, Jonathan Creekmore wrote:
> > 
> > On Jul 23, 2015, at 9:00 AM, Ian Campbell <ian.campbell@citrix.com> 
> > wrote:
> > 
> > On Thu, 2015-07-23 at 08:40 -0500, Jonathan Creekmore wrote:
> > > If systemd is configured for use AND you are building oxenstored, 
> > > the 
> > > C
> > > systemd library must be linked in to the systemd.cxma library.
> > > 
> > > Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
> > 
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > OOI what was the failure mode for you without this? Runtime rather 
> > than
> > build time I suspect?
> 
> No, it was build-time. It failed to link the oxenstored binary due to 
> missing symbols. 

Interesting, that (surprisingly) works for me. I suspect differing
toolchain versions then!

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] oxenstored: link in the systemd system library
  2015-07-23 14:00     ` Ian Campbell
  2015-07-23 14:03       ` Jonathan Creekmore
@ 2015-07-24 11:04       ` Ian Campbell
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-07-24 11:04 UTC (permalink / raw)
  To: Jonathan Creekmore, xen-devel; +Cc: dave.scott

On Thu, 2015-07-23 at 15:00 +0100, Ian Campbell wrote:
> On Thu, 2015-07-23 at 08:40 -0500, Jonathan Creekmore wrote:
> > If systemd is configured for use AND you are building oxenstored, 
> > the 
> > C
> > systemd library must be linked in to the systemd.cxma library.
> > 
> > Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

+ applied, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-24 11:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22 22:02 [PATCH] oxenstored: link in the systemd system library Jonathan Creekmore
2015-07-23  8:41 ` Ian Campbell
2015-07-23 13:40   ` [PATCH v2] " Jonathan Creekmore
2015-07-23 14:00     ` Ian Campbell
2015-07-23 14:03       ` Jonathan Creekmore
2015-07-23 14:06         ` Ian Campbell
2015-07-24 11:04       ` Ian Campbell
2015-07-23  9:02 ` [PATCH] " Dave Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).