All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] tools, build: Build xenstore in rump kernel
@ 2014-06-30 15:51 Ian Jackson
  2014-06-30 15:51 ` [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread Ian Jackson
                   ` (11 more replies)
  0 siblings, 12 replies; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:51 UTC (permalink / raw)
  To: xen-devel

These miscellaneous build system and tools patches make it possible to
build libxc and libxenstore in the NetBSD Xen rump kernel environment.

   01/11 xenstore: Use $(PTHREAD_LIBS) not -lpthread
   02/11 xenstore: In xenstore_client, avoid stack buffer in recursive function
   03/11 rump kernels: Start introducing new XEN_OS NetBSDRump
   04/11 libxc: rump kernels: Use standard xc_osdep_get_info
   05/11 xenstore: rump kernels: Look for /dev/xen/xenbus
   06/11 xenstore: Make building of xenstored optional
   07/11 build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB
   08/11 build system: Introduce libextension variable
   09/11 build system: Introduce nosharedlibs variable.
   10/11 rump kernels: Handle rumpxen host in configure
   11/11 tools/Makefile: Build only a subset of things for rump kernels

With these patches and the corresponding rumpuser-xen series (just
pushed) it is possible to build parts of the Xen management tools.

Specifically,
   .../rumpuser-xen/app-tools/rumpuserxen-app-configure ./configure
   .../rumpuser-xen/app-tools/rumpuserxen-app-make make -j4 tools
yields a xenstore client utility in xen.git/tools/xenstore/xenstore.

Running that utility with an xl config file containing
   extra="ls -fp device"
gives the expected listing of the domain's xenstore device subtree.
I have also done some (rather minimal) testing of watches.

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

* [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
@ 2014-06-30 15:51 ` Ian Jackson
  2014-07-09 17:14   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 02/11] xenstore: In xenstore_client, avoid stack buffer in recursive function Ian Jackson
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:51 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xenstore/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index e34bd41..e8c2f62 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -87,7 +87,7 @@ libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
 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)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(SOCKET_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 libxenstore.a: xs.o xs_lib.o
 	$(AR) rcs $@ $^
-- 
1.7.10.4

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

* [PATCH 02/11] xenstore: In xenstore_client, avoid stack buffer in recursive function
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
  2014-06-30 15:51 ` [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:16   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump Ian Jackson
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

do_ls is recursive.  It had a buffer of size around 5K allocated on
the stack.  This combination is not a very good idea: some
environments (eg, Mini-OS) have limited stack sizes (eg 64K).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xenstore/xenstore_client.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 56b9309..1054f18 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -128,11 +128,15 @@ static int show_whole_path = 0;
 static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms)
 {
     char **e;
-    char newpath[STRING_MAX], *val;
+    char *newpath, *val;
     int newpath_len;
     int i;
     unsigned int num, len;
 
+    newpath = malloc(STRING_MAX);
+    if (!newpath)
+      err(1, "malloc in do_ls");
+
     e = xs_directory(h, XBT_NULL, path, &num);
     if (e == NULL)
         err(1, "xs_directory (%s)", path);
@@ -144,7 +148,7 @@ static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms
         int linewid;
 
         /* Compose fullpath */
-        newpath_len = snprintf(newpath, sizeof(newpath), "%s%s%s", path, 
+        newpath_len = snprintf(newpath, STRING_MAX, "%s%s%s", path,
                 path[strlen(path)-1] == '/' ? "" : "/", 
                 e[i]);
 
@@ -161,7 +165,7 @@ static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms
         }
 
 	/* Fetch value */
-        if ( newpath_len < sizeof(newpath) ) {
+        if ( newpath_len < STRING_MAX ) {
             val = xs_read(h, XBT_NULL, newpath, &len);
         }
         else {
@@ -217,6 +221,7 @@ static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms
         do_ls(h, newpath, cur_depth+1, show_perms); 
     }
     free(e);
+    free(newpath);
 }
 
 static void
-- 
1.7.10.4

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

* [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
  2014-06-30 15:51 ` [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread Ian Jackson
  2014-06-30 15:52 ` [PATCH 02/11] xenstore: In xenstore_client, avoid stack buffer in recursive function Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:18   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info Ian Jackson
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Provide an entry in config/, and a copy of xen-sys privcmd.h.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 config/NetBSDRump.mk                       |    8 +++++++
 tools/include/xen-sys/NetBSDRump/privcmd.h |   31 ++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 config/NetBSDRump.mk
 create mode 100644 tools/include/xen-sys/NetBSDRump/privcmd.h

diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
new file mode 100644
index 0000000..e063272
--- /dev/null
+++ b/config/NetBSDRump.mk
@@ -0,0 +1,8 @@
+include $(XEN_ROOT)/config/StdGNU.mk
+
+DLOPEN_LIBS =
+PTHREAD_LIBS =
+
+XEN_LOCK_DIR = /var/lib
+
+WGET = ftp
diff --git a/tools/include/xen-sys/NetBSDRump/privcmd.h b/tools/include/xen-sys/NetBSDRump/privcmd.h
new file mode 100644
index 0000000..efdcae9
--- /dev/null
+++ b/tools/include/xen-sys/NetBSDRump/privcmd.h
@@ -0,0 +1,31 @@
+
+#ifndef __NetBSDRump_PRIVCMD_H__
+#define __NetBSDRump_PRIVCMD_H__
+
+typedef struct privcmd_hypercall
+{
+    unsigned long op;
+    unsigned long arg[5];
+    long retval;
+} privcmd_hypercall_t;
+
+typedef struct privcmd_mmap_entry {
+    unsigned long va;
+    unsigned long mfn;
+    unsigned long npages;
+} privcmd_mmap_entry_t; 
+
+typedef struct privcmd_mmap {
+    int num;
+    domid_t dom; /* target domain */
+    privcmd_mmap_entry_t *entry;
+} privcmd_mmap_t; 
+
+typedef struct privcmd_mmapbatch {
+    int num;     /* number of pages to populate */
+    domid_t dom; /* target domain */
+    unsigned long addr;  /* virtual address */
+    unsigned long *arr; /* array of mfns - top nibble set on err */
+} privcmd_mmapbatch_t; 
+
+#endif
-- 
1.7.10.4

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

* [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (2 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:19   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 05/11] xenstore: rump kernels: Look for /dev/xen/xenbus Ian Jackson
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Do not try to support the dlopen-based xc indirection.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_private.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index a3da614..359d0d8 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -50,7 +50,7 @@
 static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
 {
     int rc = -1;
-#ifndef __MINIOS__
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
     const char *lib = getenv(XENCTRL_OSDEP);
     xc_osdep_info_t *pinfo;
     void *dl_handle = NULL;
@@ -94,7 +94,7 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
 
     rc = 0;
 
-#ifndef __MINIOS__
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
 out:
     if ( dl_handle && rc == -1 )
         dlclose(dl_handle);
@@ -105,7 +105,7 @@ out:
 
 static void xc_osdep_put(xc_osdep_info_t *info)
 {
-#ifndef __MINIOS__
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
     if ( info->dl_handle )
         dlclose(info->dl_handle);
 #endif
-- 
1.7.10.4

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

* [PATCH 05/11] xenstore: rump kernels: Look for /dev/xen/xenbus
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (3 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:19   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 06/11] xenstore: Make building of xenstored optional Ian Jackson
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xenstore/xs_lib.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index f7076cc..9a78755 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -79,8 +79,9 @@ const char *xs_domain_dev(void)
 	char *s = getenv("XENSTORED_PATH");
 	if (s)
 		return s;
-
-#if defined(__linux__)
+#if defined(__RUMPUSER_XEN__)
+	return "/dev/xen/xenbus";
+#elif defined(__linux__)
 	return "/proc/xen/xenbus";
 #elif defined(__NetBSD__)
 	return "/kern/xen/xenbus";
-- 
1.7.10.4

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

* [PATCH 06/11] xenstore: Make building of xenstored optional
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (4 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 05/11] xenstore: rump kernels: Look for /dev/xen/xenbus Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:20   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 07/11] build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB Ian Jackson
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

In principle it would be possible to make a rumpuser-xen-based stub
xenstored, but all the necessary pieces do not yet exist.

So provide a facility to disable compilation of xenstored, and use it
to disable it on rump kernels.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 config/NetBSDRump.mk    |    2 ++
 tools/Rules.mk          |    2 ++
 tools/xenstore/Makefile |    7 ++++++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
index e063272..e32c1cd 100644
--- a/config/NetBSDRump.mk
+++ b/config/NetBSDRump.mk
@@ -6,3 +6,5 @@ PTHREAD_LIBS =
 XEN_LOCK_DIR = /var/lib
 
 WGET = ftp
+
+XENSTORE_XENSTORED=n
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 13d8fc1..0a8dd3e 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -19,6 +19,8 @@ XEN_LIBVCHAN       = $(XEN_ROOT)/tools/libvchan
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
+XENSTORE_XENSTORED ?= y
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl.so
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index e8c2f62..6a1ad77 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -28,7 +28,10 @@ LIBXENSTORE := libxenstore.a
 xenstore xenstore-control: CFLAGS += -static
 endif
 
-ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored
+ALL_TARGETS = libxenstore.so libxenstore.a clients
+ifeq ($(XENSTORE_XENSTORED),y)
+ALL_TARGETS += xs_tdb_dump xenstored
+endif
 
 ifeq ($(CONFIG_Linux),y)
 ALL_TARGETS += init-xenstore-domain
@@ -114,8 +117,10 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
+ifeq ($(XENSTORE_XENSTORED),y)
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
 	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
+endif
 	$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
 	$(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
 	set -e ; for c in $(CLIENTS) ; do \
-- 
1.7.10.4

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

* [PATCH 07/11] build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (5 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 06/11] xenstore: Make building of xenstored optional Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:21   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 08/11] build system: Introduce libextension variable Ian Jackson
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

INSTALL_SHLIB is like INSTALL_PROG but used only for shared libraries.
SYMLINK_SHLIB is the ln -sf rune for shared library symlinks.

Use these in the appropriate places in tools/libxc and tools/xenstore.

No functional change right now.  In a forthcoming patch these
variables might take on different values.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/Rules.mk          |    3 +++
 tools/libxc/Makefile    |   20 ++++++++++----------
 tools/libxl/Makefile    |   20 ++++++++++----------
 tools/xenstore/Makefile |    2 +-
 4 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0a8dd3e..cbdd741 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -21,6 +21,9 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
 XENSTORE_XENSTORED ?= y
 
+INSTALL_SHLIB = $(INSTALL_PROG)
+SYMLINK_SHLIB = ln -sf
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl.so
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 63be3d3..8b9cac6 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -136,15 +136,15 @@ libs: $(LIB)
 install: build
 	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
-	ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
-	ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
+	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
 	$(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
-	ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
-	ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
+	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
 	$(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: TAGS
@@ -174,9 +174,9 @@ libxenctrl.a: $(CTRL_LIB_OBJS)
 	$(AR) rc $@ $^
 
 libxenctrl.so: libxenctrl.so.$(MAJOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
 	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
@@ -187,9 +187,9 @@ libxenguest.a: $(GUEST_LIB_OBJS)
 	$(AR) rc $@ $^
 
 libxenguest.so: libxenguest.so.$(MAJOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 
 ifeq ($(CONFIG_MiniOS),y)
 zlib-options =
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 7fc42c8..5dedf15 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -190,10 +190,10 @@ _libxl_type%.h _libxl_type%_json.h _libxl_type%.c: libxl_type%.idl gentypes.py i
 	$(call move-if-changed,__libxl_type$*.c,_libxl_type$*.c)
 
 libxenlight.so: libxenlight.so.$(MAJOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 
 libxenlight.so.$(MAJOR): libxenlight.so.$(MAJOR).$(MINOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 
 libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS)
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
@@ -205,10 +205,10 @@ libxenlight.a: $(LIBXL_OBJS)
 	$(AR) rcs libxenlight.a $^
 
 libxlutil.so: libxlutil.so.$(XLUMAJOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 
 libxlutil.so.$(XLUMAJOR): libxlutil.so.$(XLUMAJOR).$(XLUMINOR)
-	ln -sf $< $@
+	$(SYMLINK_SHLIB) $< $@
 
 libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS)
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXLU_LIBS) $(APPEND_LDFLAGS)
@@ -237,13 +237,13 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
 	$(INSTALL_PROG) xl $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(PRIVATE_BINDIR)
-	$(INSTALL_PROG) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
-	ln -sf libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenlight.so.$(MAJOR)
-	ln -sf libxenlight.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenlight.so
+	$(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
+	$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenlight.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenlight.so
 	$(INSTALL_DATA) libxenlight.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_PROG) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)
-	ln -sf libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)/libxlutil.so.$(XLUMAJOR)
-	ln -sf libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(LIBDIR)/libxlutil.so
+	$(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)
+	$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)/libxlutil.so.$(XLUMAJOR)
+	$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(LIBDIR)/libxlutil.so
 	$(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 6a1ad77..7303a5f 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -127,7 +127,7 @@ endif
 		ln -f $(DESTDIR)$(BINDIR)/xenstore $(DESTDIR)$(BINDIR)/$${c} ; \
 	done
 	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
-	$(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_SHLIB) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-- 
1.7.10.4

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

* [PATCH 08/11] build system: Introduce libextension variable
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (6 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 07/11] build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:22   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 09/11] build system: Introduce nosharedlibs variable Ian Jackson
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This variable is the suffix to use for finding libraries when doing
compile-time linking.  For now we always set it to ".so" - so no
functional change.

In a forthcoming patch it may take on different values.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/Rules.mk |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index cbdd741..327d2b4 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -23,21 +23,22 @@ XENSTORE_XENSTORED ?= y
 
 INSTALL_SHLIB = $(INSTALL_PROG)
 SYMLINK_SHLIB = ln -sf
+libextension = .so
 
 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
-LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl.so
+LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
-LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest.so
+LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
 
 CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude)
-LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore.so
+LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension)
 SHLIB_libxenstore  = -Wl,-rpath-link=$(XEN_XENSTORE)
 
 CFLAGS_libxenstat  = -I$(XEN_LIBXENSTAT)
-LDLIBS_libxenstat  = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(XEN_LIBXENSTAT)/libxenstat.so
+LDLIBS_libxenstat  = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(XEN_LIBXENSTAT)/libxenstat$(libextension)
 SHLIB_libxenstat  = -Wl,-rpath-link=$(XEN_LIBXENSTAT)
 
 CFLAGS_libxenvchan = -I$(XEN_LIBVCHAN)
@@ -61,7 +62,7 @@ SHLIB_libblktapctl  =
 endif
 
 CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
-LDLIBS_libxenlight = $(XEN_XENLIGHT)/libxenlight.so $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libblktapctl)
+LDLIBS_libxenlight = $(XEN_XENLIGHT)/libxenlight$(libextension) $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libblktapctl)
 SHLIB_libxenlight  = -Wl,-rpath-link=$(XEN_XENLIGHT)
 
 CFLAGS += -D__XEN_TOOLS__
-- 
1.7.10.4

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

* [PATCH 09/11] build system: Introduce nosharedlibs variable.
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (7 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 08/11] build system: Introduce libextension variable Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:25   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 10/11] rump kernels: Handle rumpxen host in configure Ian Jackson
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Introduce a new build variable "nosharedlibs".

In tools/libxc use it instead of $(stubdom).
In tools/xenstore honour it, and build static clients.

If shared libs are disabled, do not try to install or symlink them.

Set nosharedlibs when building for MiniOS or NetBSDRump.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 config/MiniOS.mk        |    1 +
 config/NetBSDRump.mk    |    1 +
 tools/Rules.mk          |    7 +++++++
 tools/libxc/Makefile    |    6 +++---
 tools/xenstore/Makefile |    5 ++++-
 5 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/config/MiniOS.mk b/config/MiniOS.mk
index fc02b70..32260ad 100644
--- a/config/MiniOS.mk
+++ b/config/MiniOS.mk
@@ -7,3 +7,4 @@ LDFLAGS += $(DEF_LDFLAGS) $(ARCH_LDFLAGS)
 
 # Override settings for this OS
 PTHREAD_LIBS =
+nosharedlibs=y
diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
index e32c1cd..8daade8 100644
--- a/config/NetBSDRump.mk
+++ b/config/NetBSDRump.mk
@@ -8,3 +8,4 @@ XEN_LOCK_DIR = /var/lib
 WGET = ftp
 
 XENSTORE_XENSTORED=n
+nosharedlibs=y
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 327d2b4..9229f9f 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -21,9 +21,16 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
 XENSTORE_XENSTORED ?= y
 
+ifneq ($(nosharedlibs),y)
 INSTALL_SHLIB = $(INSTALL_PROG)
 SYMLINK_SHLIB = ln -sf
 libextension = .so
+else
+INSTALL_SHLIB = : install-shlib
+SYMLINK_SHLIB = : symlink-shlib
+libextension = .a
+XENSTORE_STATIC_CLIENTS=y
+endif
 
 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 8b9cac6..36f646f 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -109,16 +109,16 @@ $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
 $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS) : CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
 LIB := libxenctrl.a
-ifneq ($(stubdom),y)
+ifneq ($(nosharedlibs),y)
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
 endif
 
 LIB += libxenguest.a
-ifneq ($(stubdom),y)
+ifneq ($(nosharedlibs),y)
 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
 endif
 
-ifneq ($(stubdom),y)
+ifneq ($(nosharedlibs),y)
 LIB += xenctrl_osdep_ENOSYS.so
 endif
 
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 7303a5f..9945027 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -28,7 +28,10 @@ LIBXENSTORE := libxenstore.a
 xenstore xenstore-control: CFLAGS += -static
 endif
 
-ALL_TARGETS = libxenstore.so libxenstore.a clients
+ALL_TARGETS = libxenstore.a clients
+ifneq ($(nosharedlibs),y)
+ALL_TARGETS += libxenstore.so
+endif
 ifeq ($(XENSTORE_XENSTORED),y)
 ALL_TARGETS += xs_tdb_dump xenstored
 endif
-- 
1.7.10.4

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

* [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (8 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 09/11] build system: Introduce nosharedlibs variable Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:28   ` Ian Campbell
  2014-06-30 15:52 ` [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels Ian Jackson
  2014-07-08 16:18 ` [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Support
   ./configure --host=i386-rumpxen-netbsd

Setting --host tells configure we are cross compiling and therefore
has various automatic effects.

But in this patch we make some deliberate changes as well:
 * We disable a large number of configure tests for libraries
   etc. which don't exist.
 * We set CONFIG_RUMP in Tools.mk.
 * Hence, we automatically set XEN_OS.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 config/Tools.mk.in |    5 +++++
 tools/configure    |   12 ++++++++++++
 tools/configure.ac |   15 +++++++++++++--
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 84b2612..ae7eac2 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -1,3 +1,8 @@
+CONFIG_RUMP         := @CONFIG_RUMP@
+ifeq ($(CONFIG_RUMP),y)
+XEN_OS              := NetBSDRump
+endif
+
 # Prefix and install folder
 prefix              := @prefix@
 PREFIX              := $(prefix)
diff --git a/tools/configure b/tools/configure
index c3a6824..60bc961 100755
--- a/tools/configure
+++ b/tools/configure
@@ -705,6 +705,7 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+CONFIG_RUMP
 host_os
 host_vendor
 host_cpu
@@ -2319,6 +2320,12 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+case $host_vendor in
+rumpxen) CONFIG_RUMP=y; rump=true ;;
+*)       CONFIG_RUMP=n; rump=false ;;
+esac
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6635,6 +6642,8 @@ LDLFAGS=$ac_previous_ldflags
 
 fi
 
+if ! $rump; then
+
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7504,6 +7513,7 @@ fi
 
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
 if ${ac_cv_lib_aio_io_setup+:} false; then :
@@ -8084,6 +8094,8 @@ fi
 done
 
 
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/tools/configure.ac b/tools/configure.ac
index 9db798b..e4aa50c 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -20,6 +20,12 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 
 AC_CANONICAL_HOST
 
+case $host_vendor in
+rumpxen) CONFIG_RUMP=y; rump=true ;;
+*)       CONFIG_RUMP=n; rump=false ;;
+esac
+AC_SUBST(CONFIG_RUMP)
+
 AC_SYS_LARGEFILE
 
 case $ac_cv_sys_file_offset_bits in #(
@@ -34,11 +40,11 @@ AC_SUBST(FILE_OFFSET_BITS)
 m4_include([../m4/savevar.m4])
 m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
+m4_include([../m4/checkpolicy.m4])
+m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/python_version.m4])
 m4_include([../m4/python_devel.m4])
 m4_include([../m4/ocaml.m4])
-m4_include([../m4/checkpolicy.m4])
-m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/uuid.m4])
 m4_include([../m4/pkg.m4])
 m4_include([../m4/curses.m4])
@@ -215,6 +221,8 @@ AS_IF([test "$cross_compiling" != yes], [
     AX_CHECK_PYTHON_DEVEL()
 ])
 
+if ! $rump; then
+
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
@@ -244,6 +252,7 @@ AC_CHECK_HEADER([lzo/lzo1x.h], [
 AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
 ])
 AC_SUBST(zlib)
+
 AC_CHECK_LIB([aio], [io_setup], [], [AC_MSG_ERROR([Could not find libaio])])
 AC_SUBST(system_aio)
 AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])])
@@ -267,5 +276,7 @@ esac
 # Checks for header files.
 AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
 
+fi
+
 AC_OUTPUT()
 
-- 
1.7.10.4

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

* [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (9 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 10/11] rump kernels: Handle rumpxen host in configure Ian Jackson
@ 2014-06-30 15:52 ` Ian Jackson
  2014-07-09 17:29   ` Ian Campbell
  2014-07-08 16:18 ` [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
  11 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-06-30 15:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Override the set of tools/ subdirectories for rump kernel builds.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/Makefile |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index 63382b1..f229368 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -47,6 +47,10 @@ SUBDIRS-y += pygrub
 SUBDIRS-$(OCAML_TOOLS) += ocaml
 endif
 
+ifeq ($(CONFIG_RUMP),y)
+SUBDIRS-y := include libxc xenstore
+endif
+
 # For the sake of linking, set the sys-root
 ifneq ($(CROSS_COMPILE),)
 CROSS_BIN_PATH ?= /usr/$(CROSS_COMPILE:-=)/bin
-- 
1.7.10.4

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

* Re: [PATCH 00/11] tools, build: Build xenstore in rump kernel
  2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
                   ` (10 preceding siblings ...)
  2014-06-30 15:52 ` [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels Ian Jackson
@ 2014-07-08 16:18 ` Ian Jackson
  11 siblings, 0 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-08 16:18 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell

Ian Jackson writes ("[PATCH 00/11] tools, build: Build xenstore in rump kernel"):
> These miscellaneous build system and tools patches make it possible to
> build libxc and libxenstore in the NetBSD Xen rump kernel environment.
> 
>    01/11 xenstore: Use $(PTHREAD_LIBS) not -lpthread
>    02/11 xenstore: In xenstore_client, avoid stack buffer in recursive function
>    03/11 rump kernels: Start introducing new XEN_OS NetBSDRump
>    04/11 libxc: rump kernels: Use standard xc_osdep_get_info
>    05/11 xenstore: rump kernels: Look for /dev/xen/xenbus
>    06/11 xenstore: Make building of xenstored optional
>    07/11 build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB
>    08/11 build system: Introduce libextension variable
>    09/11 build system: Introduce nosharedlibs variable.
>    10/11 rump kernels: Handle rumpxen host in configure
>    11/11 tools/Makefile: Build only a subset of things for rump kernels
> 
> With these patches and the corresponding rumpuser-xen series (just
> pushed) it is possible to build parts of the Xen management tools.
> 
> Specifically,
>    .../rumpuser-xen/app-tools/rumpuserxen-app-configure ./configure
>    .../rumpuser-xen/app-tools/rumpuserxen-app-make make -j4 tools
> yields a xenstore client utility in xen.git/tools/xenstore/xenstore.
> 
> Running that utility with an xl config file containing
>    extra="ls -fp device"
> gives the expected listing of the domain's xenstore device subtree.
> I have also done some (rather minimal) testing of watches.

These are all tools patches, but it appears I forgot to CC Ian C.
Rather than reposting the whole series with extra CCs, I'll just send
this message ...

Thanks,
Ian.

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

* Re: [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread
  2014-06-30 15:51 ` [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread Ian Jackson
@ 2014-07-09 17:14   ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:14 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:51 +0100, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

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

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

* Re: [PATCH 02/11] xenstore: In xenstore_client, avoid stack buffer in recursive function
  2014-06-30 15:52 ` [PATCH 02/11] xenstore: In xenstore_client, avoid stack buffer in recursive function Ian Jackson
@ 2014-07-09 17:16   ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:16 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> do_ls is recursive.  It had a buffer of size around 5K allocated on
> the stack.  This combination is not a very good idea: some
> environments (eg, Mini-OS) have limited stack sizes (eg 64K).
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

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

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

* Re: [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump
  2014-06-30 15:52 ` [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump Ian Jackson
@ 2014-07-09 17:18   ` Ian Campbell
  2014-07-10 10:12     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:18 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> Provide an entry in config/, and a copy of xen-sys privcmd.h.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Seems ok, but wrt privcmd.h -- since you need the rump kernel to link
against is it worth duplicating it here? Or maybe it's not duplicated,
but I'd have more expected it to live in the rumpkernels side next to
the driver.

In any case it's not a big deal:
Acked-by: Ian Campbell <ian.campbell@citrix.com>

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

* Re: [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info
  2014-06-30 15:52 ` [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info Ian Jackson
@ 2014-07-09 17:19   ` Ian Campbell
  2014-07-10 10:17     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:19 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> Do not try to support the dlopen-based xc indirection.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

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

But maybe you would prefer to avoid the repetition with
#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
#define DO_DYNAMIC_OSDEP
#endif
?

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

* Re: [PATCH 05/11] xenstore: rump kernels: Look for /dev/xen/xenbus
  2014-06-30 15:52 ` [PATCH 05/11] xenstore: rump kernels: Look for /dev/xen/xenbus Ian Jackson
@ 2014-07-09 17:19   ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:19 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

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

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

* Re: [PATCH 06/11] xenstore: Make building of xenstored optional
  2014-06-30 15:52 ` [PATCH 06/11] xenstore: Make building of xenstored optional Ian Jackson
@ 2014-07-09 17:20   ` Ian Campbell
  2014-07-10 10:18     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:20 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> In principle it would be possible to make a rumpuser-xen-based stub
> xenstored, but all the necessary pieces do not yet exist.

Do you plan to do this eventually?

> So provide a facility to disable compilation of xenstored, and use it
> to disable it on rump kernels.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

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

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

* Re: [PATCH 07/11] build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB
  2014-06-30 15:52 ` [PATCH 07/11] build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB Ian Jackson
@ 2014-07-09 17:21   ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:21 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> INSTALL_SHLIB is like INSTALL_PROG but used only for shared libraries.
> SYMLINK_SHLIB is the ln -sf rune for shared library symlinks.
> 
> Use these in the appropriate places in tools/libxc and tools/xenstore.
> 
> No functional change right now.  In a forthcoming patch these
> variables might take on different values.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

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

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

* Re: [PATCH 08/11] build system: Introduce libextension variable
  2014-06-30 15:52 ` [PATCH 08/11] build system: Introduce libextension variable Ian Jackson
@ 2014-07-09 17:22   ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:22 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> This variable is the suffix to use for finding libraries when doing
> compile-time linking.  For now we always set it to ".so" - so no
> functional change.
> 
> In a forthcoming patch it may take on different values.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

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

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

* Re: [PATCH 09/11] build system: Introduce nosharedlibs variable.
  2014-06-30 15:52 ` [PATCH 09/11] build system: Introduce nosharedlibs variable Ian Jackson
@ 2014-07-09 17:25   ` Ian Campbell
  2014-07-10 10:21     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:25 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> diff --git a/tools/Rules.mk b/tools/Rules.mk
> index 327d2b4..9229f9f 100644
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -21,9 +21,16 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
>  
>  XENSTORE_XENSTORED ?= y
>  
> +ifneq ($(nosharedlibs),y)
>  INSTALL_SHLIB = $(INSTALL_PROG)
>  SYMLINK_SHLIB = ln -sf
>  libextension = .so
> +else
> +INSTALL_SHLIB = : install-shlib
> +SYMLINK_SHLIB = : symlink-shlib

I don't see install-shlib or symlink-shlib neither in our build system
nor installed on my usual build machine.

Are these a (Rump)BSD-ism? In which case I expect they won't work for
minios builds on Linux?

> +libextension = .a
> +XENSTORE_STATIC_CLIENTS=y

Not in tools/xenstored/Makefile?

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-06-30 15:52 ` [PATCH 10/11] rump kernels: Handle rumpxen host in configure Ian Jackson
@ 2014-07-09 17:28   ` Ian Campbell
  2014-07-10 10:28     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:28 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> Support
>    ./configure --host=i386-rumpxen-netbsd

Are things happy without some sort of update to config.{sub,guess,blah}?
Debian keep having to update those for a new arch. Maybe that's for when
--host isn't used though?

Why i386-* and not x86_64-*?

Ian.

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

* Re: [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels
  2014-06-30 15:52 ` [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels Ian Jackson
@ 2014-07-09 17:29   ` Ian Campbell
  2014-07-10 10:31     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-09 17:29 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> Override the set of tools/ subdirectories for rump kernel builds.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

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

Is this the biggest list you envisage or do you expect it to grow? It
might become unwieldy but we can deal with that as and when...

Ian.

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

* Re: [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump
  2014-07-09 17:18   ` Ian Campbell
@ 2014-07-10 10:12     ` Ian Jackson
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 10:12 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump"):
> On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > Provide an entry in config/, and a copy of xen-sys privcmd.h.
> > 
> > Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> Seems ok, but wrt privcmd.h -- since you need the rump kernel to link
> against is it worth duplicating it here? Or maybe it's not duplicated,
> but I'd have more expected it to live in the rumpkernels side next to
> the driver.

You would have thought so, wouldn't you ?  But it seems that all of
these headers are in xen.git/tools/include/xen-sys/.

> In any case it's not a big deal:
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Thanks,
Ian.

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

* Re: [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info
  2014-07-09 17:19   ` Ian Campbell
@ 2014-07-10 10:17     ` Ian Jackson
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 10:17 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info"):
> On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > Do not try to support the dlopen-based xc indirection.
> > 
> > Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> But maybe you would prefer to avoid the repetition with
> #if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
> #define DO_DYNAMIC_OSDEP
> #endif
> ?

Good idea, thanks.

Ian.

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

* Re: [PATCH 06/11] xenstore: Make building of xenstored optional
  2014-07-09 17:20   ` Ian Campbell
@ 2014-07-10 10:18     ` Ian Jackson
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 10:18 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH 06/11] xenstore: Make building of xenstored optional"):
> On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > In principle it would be possible to make a rumpuser-xen-based stub
> > xenstored, but all the necessary pieces do not yet exist.
> 
> Do you plan to do this eventually?

Yes, but probably not soon.  I'm currently trying to work towards an
upstream qemu stubdom.

Ian.

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

* Re: [PATCH 09/11] build system: Introduce nosharedlibs variable.
  2014-07-09 17:25   ` Ian Campbell
@ 2014-07-10 10:21     ` Ian Jackson
  2014-07-10 11:15       ` Ian Campbell
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 10:21 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH 09/11] build system: Introduce nosharedlibs variable."):
> On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > +ifneq ($(nosharedlibs),y)
> >  INSTALL_SHLIB = $(INSTALL_PROG)
> >  SYMLINK_SHLIB = ln -sf
> >  libextension = .so
> > +else
> > +INSTALL_SHLIB = : install-shlib
> > +SYMLINK_SHLIB = : symlink-shlib
> 
> I don't see install-shlib or symlink-shlib neither in our build system
> nor installed on my usual build machine.

They don't exist.  If they are called it is a bug.  Clearly this is
too confusing.  How about
  +INSTALL_SHLIB = : install-shlib-unsupported-fail
?

I could write
  +INSTALL_SHLIB = : false install shlib unsupported
but "false" doesn't print anything to stderr if it is executed, which
would make the failure more obscure.

> Are these a (Rump)BSD-ism? In which case I expect they won't work for
> minios builds on Linux?
> 
> > +libextension = .a
> > +XENSTORE_STATIC_CLIENTS=y
> 
> Not in tools/xenstored/Makefile?

No.  I felt that XENSTORE_STATIC_CLIENTS was a knob that is exposed by
tools/xenstore/Makefile to the rest of the build system.  And putting
it here puts all the "disable shared libraries" options in the same
place.

Thanks,
Ian.

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-09 17:28   ` Ian Campbell
@ 2014-07-10 10:28     ` Ian Jackson
  2014-07-10 11:12       ` Ian Campbell
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 10:28 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH 10/11] rump kernels: Handle rumpxen host in configure"):
> On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > Support
> >    ./configure --host=i386-rumpxen-netbsd
> 
> Are things happy without some sort of update to config.{sub,guess,blah}?
> Debian keep having to update those for a new arch. Maybe that's for when
> --host isn't used though?

Yes, they don't need updating.  This is one reason to choose this
rather than (eg) i386-unknown-rumpxen.

Indeed, earlier I had this exchange with the rumpkernel folks:

  Justin Cormack writes:
  > I think i386-unknown-rumpxen is probably more correct, as it is not
  > strictly netbsd even if it is netbsd like.

  I have two counterarguments to that.

  Firstly, that causes config.sub to fail with:
    checking host system type... Invalid configuration
       `i386-unknown-rumpxen': system `rumpxen' not recognized
  We need something that will work with existing configure scripts.
  Now `i386-rumpxen-none' would work, but:

  Secondly, the point of this is to cause a configure script of a naive
  userland program (which is what we are trying to compile) to do the
  right thing.  The rumpuserxen application environment is much more
  like NetBSD than anything else.  It has a NetBSD libc and a good
  number of the NetBSD system calls.

  If a program is choosing between multiple implementation/interfaces to
  try to use, then if it chooses NetBSD there is a good chance that it
  will build and even a hope that it will work.

  "none" is much less accurate.


> Why i386-* and not x86_64-*?

There's no particular reason why I mentioned that rather than the
other in the commit message.  I think it ought to work with either.

Should I mention both ?  I haven't tested x86_64, although if and when
I plumb this new stuff into osstest that will end up being tested.

Thanks,
Ian.

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

* Re: [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels
  2014-07-09 17:29   ` Ian Campbell
@ 2014-07-10 10:31     ` Ian Jackson
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 10:31 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels"):
> On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > Override the set of tools/ subdirectories for rump kernel builds.
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Thanks.

> Is this the biggest list you envisage or do you expect it to grow? It
> might become unwieldy but we can deal with that as and when...

I don't think it is going to grow very much, but I could be wrong.

As you say, if it does, we will have to do something different,
probably by transposing the representation (which would be a big and
quite annoying patch).

Ian.

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 10:28     ` Ian Jackson
@ 2014-07-10 11:12       ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-10 11:12 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, 2014-07-10 at 11:28 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH 10/11] rump kernels: Handle rumpxen host in configure"):
> > On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > > Support
> > >    ./configure --host=i386-rumpxen-netbsd
> > 
> > Are things happy without some sort of update to config.{sub,guess,blah}?
> > Debian keep having to update those for a new arch. Maybe that's for when
> > --host isn't used though?
> 
> Yes, they don't need updating.  This is one reason to choose this
> rather than (eg) i386-unknown-rumpxen.
> 
> Indeed, earlier I had this exchange with the rumpkernel folks:

Got it, thanks.

> > Why i386-* and not x86_64-*?
> 
> There's no particular reason why I mentioned that rather than the
> other in the commit message.  I think it ought to work with either.
> 
> Should I mention both ?  I haven't tested x86_64, although if and when
> I plumb this new stuff into osstest that will end up being tested.

OK. For the most part I think only x86_64 is interesting for this stuff
these days. (To the extent that if we were to only end up support x86_64
rump kernels I wouldn't blink).

Ian.

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

* Re: [PATCH 09/11] build system: Introduce nosharedlibs variable.
  2014-07-10 10:21     ` Ian Jackson
@ 2014-07-10 11:15       ` Ian Campbell
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-10 11:15 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, 2014-07-10 at 11:21 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH 09/11] build system: Introduce nosharedlibs variable."):
> > On Mon, 2014-06-30 at 16:52 +0100, Ian Jackson wrote:
> > > +ifneq ($(nosharedlibs),y)
> > >  INSTALL_SHLIB = $(INSTALL_PROG)
> > >  SYMLINK_SHLIB = ln -sf
> > >  libextension = .so
> > > +else
> > > +INSTALL_SHLIB = : install-shlib
> > > +SYMLINK_SHLIB = : symlink-shlib
> > 
> > I don't see install-shlib or symlink-shlib neither in our build system
> > nor installed on my usual build machine.
> 
> They don't exist.  If they are called it is a bug.  Clearly this is
> too confusing.

Ah, that's what "do no try to install" in the commit message meant, of
course.

>   How about
>   +INSTALL_SHLIB = : install-shlib-unsupported-fail
> ?

That plus a comment
        # These don't exist in order to force a failure if they are used
perhaps?

> 
> I could write
>   +INSTALL_SHLIB = : false install shlib unsupported
> but "false" doesn't print anything to stderr if it is executed, which
> would make the failure more obscure.
> 
> > Are these a (Rump)BSD-ism? In which case I expect they won't work for
> > minios builds on Linux?
> > 
> > > +libextension = .a
> > > +XENSTORE_STATIC_CLIENTS=y
> > 
> > Not in tools/xenstored/Makefile?
> 
> No.  I felt that XENSTORE_STATIC_CLIENTS was a knob that is exposed by
> tools/xenstore/Makefile to the rest of the build system.  And putting
> it here puts all the "disable shared libraries" options in the same
> place.

OK

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 16:53       ` David Vrabel
@ 2014-07-10 17:21         ` Ian Jackson
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 17:21 UTC (permalink / raw)
  To: David Vrabel; +Cc: xen-devel, Ian Campbell

David Vrabel writes ("Re: [Xen-devel] [PATCH 10/11] rump kernels: Handle rumpxen host in configure"):
> On 10/07/14 17:43, Ian Jackson wrote:
> > +fi # ! $trump
> 
> Extra T?

Oops!  Fixed, thanks.

Ian.

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 16:43     ` Ian Jackson
  2014-07-10 16:45       ` Ian Campbell
@ 2014-07-10 16:53       ` David Vrabel
  2014-07-10 17:21         ` Ian Jackson
  1 sibling, 1 reply; 38+ messages in thread
From: David Vrabel @ 2014-07-10 16:53 UTC (permalink / raw)
  To: Ian Jackson, Ian Campbell; +Cc: xen-devel

On 10/07/14 17:43, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure"):
>  
> +if ! $rump; then
> +
>  # Extract the first word of "xgettext", so it can be a program name with args.
>  set dummy xgettext; ac_word=$2
>  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> @@ -8160,6 +8169,8 @@ fi
>  done
>  
>  
> +fi # ! $trump

Extra T?

Also below.

> +if ! $rump; then
> +
>  AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
>  dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
>  dnl "host" here means the platform on which the hypervisor and tools is
> @@ -287,5 +295,7 @@ esac
>  # Checks for header files.
>  AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
>  
> +fi # ! $trump
> +
>  AC_OUTPUT()
>  
> 

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 16:43     ` Ian Jackson
@ 2014-07-10 16:45       ` Ian Campbell
  2014-07-10 16:53       ` David Vrabel
  1 sibling, 0 replies; 38+ messages in thread
From: Ian Campbell @ 2014-07-10 16:45 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, 2014-07-10 at 17:43 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure"):
> ...
> > Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
> 
> Thanks.
> 
> > > +fi
> > 
> > Perhaps this would benefit from a trailing "# ! $rump" since it is so
> > far from the if.
> 
> Yes.  Here's the result.  I've kept your ack.  If this is OK with you,
> I will now push this whole series.

Sure, go for it.

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 16:29   ` Ian Campbell
@ 2014-07-10 16:43     ` Ian Jackson
  2014-07-10 16:45       ` Ian Campbell
  2014-07-10 16:53       ` David Vrabel
  0 siblings, 2 replies; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 16:43 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure"):
...
> Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

Thanks.

> > +fi
> 
> Perhaps this would benefit from a trailing "# ! $rump" since it is so
> far from the if.

Yes.  Here's the result.  I've kept your ack.  If this is OK with you,
I will now push this whole series.

Thanks,
Ian.

>From 84560875f95322be15d0f0a47be33593260ac89f Mon Sep 17 00:00:00 2001
From: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Wed, 28 May 2014 17:04:52 +0100
Subject: [PATCH] rump kernels: Handle rumpxen host in configure

Support
   ./configure --host=x86_64-rumpxen-netbsd
   ./configure --host=i386-rumpxen-netbsd

Setting --host tells configure we are cross compiling and therefore
has various automatic effects.

But in this patch we make some deliberate changes as well:
 * We disable a large number of configure tests for libraries
   etc. which don't exist.
 * We set CONFIG_RUMP in Tools.mk.
 * Hence, we automatically set XEN_OS.

(I have only tested the 32-bit build but I think the 64-bit build
should work just as well.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

---
v3: Add comment to `fi'
v2: Mention x86_64.
    Drop an erroneous whitespace change.
---
 config/Tools.mk.in |    5 +++++
 tools/configure    |   11 +++++++++++
 tools/configure.ac |   14 ++++++++++++--
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 852c941..748cc69 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -1,3 +1,8 @@
+CONFIG_RUMP         := @CONFIG_RUMP@
+ifeq ($(CONFIG_RUMP),y)
+XEN_OS              := NetBSDRump
+endif
+
 # Prefix and install folder
 prefix              := @prefix@
 PREFIX              := $(prefix)
diff --git a/tools/configure b/tools/configure
index 20f1aa9..04841e3 100755
--- a/tools/configure
+++ b/tools/configure
@@ -706,6 +706,7 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+CONFIG_RUMP
 host_os
 host_vendor
 host_cpu
@@ -2323,6 +2324,12 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+case $host_vendor in
+rumpxen) CONFIG_RUMP=y; rump=true ;;
+*)       CONFIG_RUMP=n; rump=false ;;
+esac
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6704,6 +6711,8 @@ LDLFAGS=$ac_previous_ldflags
 
 fi
 
+if ! $rump; then
+
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -8160,6 +8169,8 @@ fi
 done
 
 
+fi # ! $trump
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/tools/configure.ac b/tools/configure.ac
index 6d70f04..aeb88c7 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -20,6 +20,12 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 
 AC_CANONICAL_HOST
 
+case $host_vendor in
+rumpxen) CONFIG_RUMP=y; rump=true ;;
+*)       CONFIG_RUMP=n; rump=false ;;
+esac
+AC_SUBST(CONFIG_RUMP)
+
 AC_SYS_LARGEFILE
 
 case $ac_cv_sys_file_offset_bits in #(
@@ -34,11 +40,11 @@ AC_SUBST(FILE_OFFSET_BITS)
 m4_include([../m4/savevar.m4])
 m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
+m4_include([../m4/checkpolicy.m4])
+m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/python_version.m4])
 m4_include([../m4/python_devel.m4])
 m4_include([../m4/ocaml.m4])
-m4_include([../m4/checkpolicy.m4])
-m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/uuid.m4])
 m4_include([../m4/pkg.m4])
 m4_include([../m4/curses.m4])
@@ -233,6 +239,8 @@ AS_IF([test "$cross_compiling" != yes], [
     AX_CHECK_PYTHON_DEVEL()
 ])
 
+if ! $rump; then
+
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
@@ -287,5 +295,7 @@ esac
 # Checks for header files.
 AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
 
+fi # ! $trump
+
 AC_OUTPUT()
 
-- 
1.7.10.4

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

* Re: [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 16:14 ` [PATCH 10/11] rump kernels: Handle rumpxen host in configure Ian Jackson
@ 2014-07-10 16:29   ` Ian Campbell
  2014-07-10 16:43     ` Ian Jackson
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Campbell @ 2014-07-10 16:29 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, 2014-07-10 at 17:14 +0100, Ian Jackson wrote:
> Support
>    ./configure --host=x86_64-rumpxen-netbsd
>    ./configure --host=i386-rumpxen-netbsd
> 
> Setting --host tells configure we are cross compiling and therefore
> has various automatic effects.
> 
> But in this patch we make some deliberate changes as well:
>  * We disable a large number of configure tests for libraries
>    etc. which don't exist.
>  * We set CONFIG_RUMP in Tools.mk.
>  * Hence, we automatically set XEN_OS.
> 
> (I have only tested the 32-bit build but I think the 64-bit build
> should work just as well.)
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

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

> @@ -8160,6 +8169,8 @@ fi
>  done
>  
> 
> +fi

Perhaps this would benefit from a trailing "# ! $rump" since it is so
far from the if.

Ian.

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

* [PATCH 10/11] rump kernels: Handle rumpxen host in configure
  2014-07-10 16:14 [PATCH v2 " Ian Jackson
@ 2014-07-10 16:14 ` Ian Jackson
  2014-07-10 16:29   ` Ian Campbell
  0 siblings, 1 reply; 38+ messages in thread
From: Ian Jackson @ 2014-07-10 16:14 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

Support
   ./configure --host=x86_64-rumpxen-netbsd
   ./configure --host=i386-rumpxen-netbsd

Setting --host tells configure we are cross compiling and therefore
has various automatic effects.

But in this patch we make some deliberate changes as well:
 * We disable a large number of configure tests for libraries
   etc. which don't exist.
 * We set CONFIG_RUMP in Tools.mk.
 * Hence, we automatically set XEN_OS.

(I have only tested the 32-bit build but I think the 64-bit build
should work just as well.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>

---
v2: Mention x86_64.
    Drop an erroneous whitespace change.
---
 config/Tools.mk.in |    5 +++++
 tools/configure    |   11 +++++++++++
 tools/configure.ac |   14 ++++++++++++--
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 852c941..748cc69 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -1,3 +1,8 @@
+CONFIG_RUMP         := @CONFIG_RUMP@
+ifeq ($(CONFIG_RUMP),y)
+XEN_OS              := NetBSDRump
+endif
+
 # Prefix and install folder
 prefix              := @prefix@
 PREFIX              := $(prefix)
diff --git a/tools/configure b/tools/configure
index 20f1aa9..a1bddb7 100755
--- a/tools/configure
+++ b/tools/configure
@@ -706,6 +706,7 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+CONFIG_RUMP
 host_os
 host_vendor
 host_cpu
@@ -2323,6 +2324,12 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+case $host_vendor in
+rumpxen) CONFIG_RUMP=y; rump=true ;;
+*)       CONFIG_RUMP=n; rump=false ;;
+esac
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6704,6 +6711,8 @@ LDLFAGS=$ac_previous_ldflags
 
 fi
 
+if ! $rump; then
+
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -8160,6 +8169,8 @@ fi
 done
 
 
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/tools/configure.ac b/tools/configure.ac
index 6d70f04..44ba32f 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -20,6 +20,12 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 
 AC_CANONICAL_HOST
 
+case $host_vendor in
+rumpxen) CONFIG_RUMP=y; rump=true ;;
+*)       CONFIG_RUMP=n; rump=false ;;
+esac
+AC_SUBST(CONFIG_RUMP)
+
 AC_SYS_LARGEFILE
 
 case $ac_cv_sys_file_offset_bits in #(
@@ -34,11 +40,11 @@ AC_SUBST(FILE_OFFSET_BITS)
 m4_include([../m4/savevar.m4])
 m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
+m4_include([../m4/checkpolicy.m4])
+m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/python_version.m4])
 m4_include([../m4/python_devel.m4])
 m4_include([../m4/ocaml.m4])
-m4_include([../m4/checkpolicy.m4])
-m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/uuid.m4])
 m4_include([../m4/pkg.m4])
 m4_include([../m4/curses.m4])
@@ -233,6 +239,8 @@ AS_IF([test "$cross_compiling" != yes], [
     AX_CHECK_PYTHON_DEVEL()
 ])
 
+if ! $rump; then
+
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
@@ -287,5 +295,7 @@ esac
 # Checks for header files.
 AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
 
+fi
+
 AC_OUTPUT()
 
-- 
1.7.10.4

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

end of thread, other threads:[~2014-07-10 17:21 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30 15:51 [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
2014-06-30 15:51 ` [PATCH 01/11] xenstore: Use $(PTHREAD_LIBS) not -lpthread Ian Jackson
2014-07-09 17:14   ` Ian Campbell
2014-06-30 15:52 ` [PATCH 02/11] xenstore: In xenstore_client, avoid stack buffer in recursive function Ian Jackson
2014-07-09 17:16   ` Ian Campbell
2014-06-30 15:52 ` [PATCH 03/11] rump kernels: Start introducing new XEN_OS NetBSDRump Ian Jackson
2014-07-09 17:18   ` Ian Campbell
2014-07-10 10:12     ` Ian Jackson
2014-06-30 15:52 ` [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info Ian Jackson
2014-07-09 17:19   ` Ian Campbell
2014-07-10 10:17     ` Ian Jackson
2014-06-30 15:52 ` [PATCH 05/11] xenstore: rump kernels: Look for /dev/xen/xenbus Ian Jackson
2014-07-09 17:19   ` Ian Campbell
2014-06-30 15:52 ` [PATCH 06/11] xenstore: Make building of xenstored optional Ian Jackson
2014-07-09 17:20   ` Ian Campbell
2014-07-10 10:18     ` Ian Jackson
2014-06-30 15:52 ` [PATCH 07/11] build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB Ian Jackson
2014-07-09 17:21   ` Ian Campbell
2014-06-30 15:52 ` [PATCH 08/11] build system: Introduce libextension variable Ian Jackson
2014-07-09 17:22   ` Ian Campbell
2014-06-30 15:52 ` [PATCH 09/11] build system: Introduce nosharedlibs variable Ian Jackson
2014-07-09 17:25   ` Ian Campbell
2014-07-10 10:21     ` Ian Jackson
2014-07-10 11:15       ` Ian Campbell
2014-06-30 15:52 ` [PATCH 10/11] rump kernels: Handle rumpxen host in configure Ian Jackson
2014-07-09 17:28   ` Ian Campbell
2014-07-10 10:28     ` Ian Jackson
2014-07-10 11:12       ` Ian Campbell
2014-06-30 15:52 ` [PATCH 11/11] tools/Makefile: Build only a subset of things for rump kernels Ian Jackson
2014-07-09 17:29   ` Ian Campbell
2014-07-10 10:31     ` Ian Jackson
2014-07-08 16:18 ` [PATCH 00/11] tools, build: Build xenstore in rump kernel Ian Jackson
2014-07-10 16:14 [PATCH v2 " Ian Jackson
2014-07-10 16:14 ` [PATCH 10/11] rump kernels: Handle rumpxen host in configure Ian Jackson
2014-07-10 16:29   ` Ian Campbell
2014-07-10 16:43     ` Ian Jackson
2014-07-10 16:45       ` Ian Campbell
2014-07-10 16:53       ` David Vrabel
2014-07-10 17:21         ` Ian Jackson

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.