oxenstored: link in the systemd system library
PATCH 1/1 oxenstored: link in the systemd system library
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.
--- tools/ocaml/xenstored/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/ocaml/xenstored/Makefile +3 -1
@@ -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
Signature · 1 line
2.1.4
Quoted 4 lines · Jonathan Creekmore
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.
Quoted 25 lines
Signed-off-by Jonathan Creekmore <[email protected]>--- tools/ocaml/xenstored/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)tools/ocaml/xenstored/Makefile +3
-1@@ -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
PATCH v2 1/1 oxenstored: link in the systemd system library
If systemd is configured for use AND you are building oxenstored, the C systemd library must be linked in to the systemd.cxma library.
---
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(+)
tools/ocaml/xenstored/Makefile +2 -0
@@ -30,6 +30,8 @@ systemd_OBJS = systemd systemd_C_OBJS = systemd_stubs OCAML_LIBRARY += systemd +LIBS_systemd += $(LDFLAGS-y) + OBJS = define \ stdext \ trie \
Signature · 1 line
2.1.4
Quoted 5 lines · Jonathan Creekmore
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 <[email protected]>
OOI what was the failure mode for you without this? Runtime rather than build time I suspect?
Quoted 23 lines
---
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(+)tools/ocaml/xenstored/Makefile +2
-0@@ -30,6 +30,8 @@ systemd_OBJS = systemd systemd_C_OBJS = systemd_stubs OCAML_LIBRARY += systemd +LIBS_systemd += $(LDFLAGS-y) + OBJS = define \ stdext \ trie \
Quoted 8 lines · Ian Campbell
Quoted 4 lines · Jonathan Creekmore
If systemd is configured for use AND you are building oxenstored, the C
systemd library must be linked in to the systemd.cxma library.
Quoted 6 lines
Quoted 1 line
Signed-off-by Jonathan Creekmore <[email protected]>Acked-by Ian Campbell <[email protected]>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.
Quoted 12 lines · Jonathan Creekmore
Quoted 12 lines
On Jul 23, 2015, at 9:00 AM, Ian Campbell <[email protected]> wrote:
Quoted 6 lines · Jonathan Creekmore
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 <[email protected]>
Quoted 8 lines
Quoted 5 lines
Acked-by Ian Campbell <[email protected]>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.
Quoted 9 lines · Ian Campbell
Quoted 6 lines · Jonathan Creekmore
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 <[email protected]>Acked-by Ian Campbell <[email protected]>
+ applied, thanks.
Quoted 6 lines · Jonathan Creekmore
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,
Quoted 26 lines
Signed-off-by Jonathan Creekmore <[email protected]>---
tools/ocaml/xenstored/Makefile| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)tools/ocaml/xenstored/Makefile +2
-0@@ -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
tools/ocaml/xenstored/Makefile +1
-1-oxenstored_LIBS = $(XENSTOREDLIBS) +oxenstored_LIBS = $(XENSTOREDLIBS) $(XENSTORED_LDFLAGS-y)
oxenstored_OBJS= $(OBJS)
OCAML_PROGRAM= oxenstoredSignature · 1 line
2.1.4