pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xentools411 Fix build with newer ocaml.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c649354d0e12
branches:  trunk
changeset: 446116:c649354d0e12
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Thu Feb 04 11:45:53 2021 +0000

description:
Fix build with newer ocaml.
Fix xenstored leaking file descriptors and busy-looping over them.

diffstat:

 sysutils/xentools411/Makefile                                      |   4 +-
 sysutils/xentools411/distinfo                                      |   6 +-
 sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules      |  13 ++++
 sysutils/xentools411/patches/patch-tools_ocaml_common.make         |  20 +-----
 sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c |  29 ++++++++++
 5 files changed, 52 insertions(+), 20 deletions(-)

diffs (124 lines):

diff -r c7583267e250 -r c649354d0e12 sysutils/xentools411/Makefile
--- a/sysutils/xentools411/Makefile     Thu Feb 04 11:41:38 2021 +0000
+++ b/sysutils/xentools411/Makefile     Thu Feb 04 11:45:53 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.24 2020/12/17 16:48:12 bouyer Exp $
+# $NetBSD: Makefile,v 1.25 2021/02/04 11:45:53 bouyer Exp $
 #
 # VERSION is set in version.mk as it is shared with other packages
-PKGREVISION=   2
+PKGREVISION=   3
 .include       "version.mk"
 
 DIST_IPXE=     ipxe-git-${VERSION_IPXE}.tar.gz
diff -r c7583267e250 -r c649354d0e12 sysutils/xentools411/distinfo
--- a/sysutils/xentools411/distinfo     Thu Feb 04 11:41:38 2021 +0000
+++ b/sysutils/xentools411/distinfo     Thu Feb 04 11:45:53 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.15 2020/12/17 16:48:12 bouyer Exp $
+$NetBSD: distinfo,v 1.16 2021/02/04 11:45:53 bouyer Exp $
 
 SHA1 (xen411/ipxe-git-356f6c1b64d7a97746d1816cef8ca22bdd8d0b5d.tar.gz) = 272b8c904dc0127690eca2c5c20c67479e40da34
 RMD160 (xen411/ipxe-git-356f6c1b64d7a97746d1816cef8ca22bdd8d0b5d.tar.gz) = cfcb4a314c15da19b36132b27126f3bd9699d0e5
@@ -62,7 +62,8 @@
 SHA1 (patch-tools_libxl_libxl_event.c) = 8147122d03102eccc45c48a7d6ca1aa5d6286040
 SHA1 (patch-tools_libxl_libxl_internal.h) = 613edc0fa055b23f5dc2a2448456d3d6005337fe
 SHA1 (patch-tools_libxl_libxl_uuid.c) = 1eb8c027dbeb7e67df7475ee6e4d87220140c65b
-SHA1 (patch-tools_ocaml_common.make) = 4b845bdf3a013852109749ee18dfe28e3440d951
+SHA1 (patch-tools_ocaml_Makefile.rules) = 2198396f896999adb8ea05f100a0a5ec36733b1a
+SHA1 (patch-tools_ocaml_common.make) = 731744c8acd9ec4d04ef585c31348d498ac861b0
 SHA1 (patch-tools_ocaml_libs_xentoollog_xentoollog__stubs.c) = adee03d87168e735cb0d42ce06d0c31a14315b8d
 SHA1 (patch-tools_ocaml_libs_xl__xenlight_stubs.c) = cc612908524670f650a294af133a5912f955f39e
 SHA1 (patch-tools_ocaml_xenstored_Makefile) = b267702cf4090c7b45bba530e60327fced24e3e5
@@ -87,6 +88,7 @@
 SHA1 (patch-tools_xenpaging_xenpaging.c) = 0a154b97f1f452a5f80f7c9a835a1f216f12f7e1
 SHA1 (patch-tools_xenpmd_xenpmd.c) = 851ce7a295e2f41ffcd966850d8003c82670c751
 SHA1 (patch-tools_xenstore_xc.c) = cf49b65cba064667e13bb041d1f0099c76ab6a40
+SHA1 (patch-tools_xenstore_xenstored_core.c) = f3d3011cb945772f298404b3505ca032a8bc06ea
 SHA1 (patch-tools_xenstore_xs_lib.c) = e3a8f6e3b149c3ab0f4ec8dcfa455983f94e6c16
 SHA1 (patch-tools_xentrace_xentrace.c) = f964c7555f454358a39f28a2e75db8ee100a4243
 SHA1 (patch-tools_xl_Makefile) = dd4fa8cc66c74eea8b022cd6129aa2831776f2a8
diff -r c7583267e250 -r c649354d0e12 sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules     Thu Feb 04 11:45:53 2021 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-tools_ocaml_Makefile.rules,v 1.1 2021/02/04 11:45:53 bouyer Exp $
+
+--- tools/ocaml/Makefile.rules.orig    2021-01-08 22:48:10.638776688 +0100
++++ tools/ocaml/Makefile.rules 2021-01-08 22:49:05.627085243 +0100
+@@ -34,7 +34,7 @@
+       $(call quiet-command, $(OCAMLYACC) -q $<,MLYACC,$@)
+ 
+ %.o: %.c
+-      $(call quiet-command, $(CC) $(CFLAGS) -c -o $@ $<,CC,$@)
++      $(call quiet-command, $(CC) $(CFLAGS) -Wno-error=discarded-qualifiers -c -o $@ $<,CC,$@)
+ 
+ META: META.in
+       sed 's/@VERSION@/$(VERSION)/g' < $< $o
diff -r c7583267e250 -r c649354d0e12 sysutils/xentools411/patches/patch-tools_ocaml_common.make
--- a/sysutils/xentools411/patches/patch-tools_ocaml_common.make        Thu Feb 04 11:41:38 2021 +0000
+++ b/sysutils/xentools411/patches/patch-tools_ocaml_common.make        Thu Feb 04 11:45:53 2021 +0000
@@ -1,11 +1,6 @@
-$NetBSD: patch-tools_ocaml_common.make,v 1.1 2018/07/24 13:40:11 bouyer Exp $
-
-Handle ocaml-findlib 1.7.3 already appending destdir
-Add -unsafe-string to fix build with ocaml-4.06.0 and later
-
---- tools/ocaml/common.make.orig       2018-01-23 13:49:58.000000000 +0000
-+++ tools/ocaml/common.make
-@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
+--- tools/ocaml/common.make.orig       2020-04-17 13:58:20.000000000 +0200
++++ tools/ocaml/common.make    2021-02-04 11:25:02.393221932 +0100
+@@ -3,7 +3,7 @@
  CC ?= gcc
  OCAMLOPT ?= ocamlopt
  OCAMLC ?= ocamlc
@@ -14,14 +9,7 @@
  OCAMLDEP ?= ocamldep
  OCAMLLEX ?= ocamllex
  OCAMLYACC ?= ocamlyacc
-@@ -12,11 +12,11 @@ OCAMLFIND ?= ocamlfind
- CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
- 
- OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
--OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
--OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
-+OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -unsafe-string -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
-+OCAMLCFLAGS += -unsafe-string -g $(OCAMLINCLUDE) -w F -warn-error F
+@@ -17,6 +17,6 @@
  
  VERSION := 4.1
  
diff -r c7583267e250 -r c649354d0e12 sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c        Thu Feb 04 11:45:53 2021 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-tools_xenstore_xenstored_core.c,v 1.1 2021/02/04 11:45:53 bouyer Exp $
+
+On error, don't keep socket connection in ignored state but close them.
+When the remote end of a socket is closed, xenstored will flag it as an
+error and switch the connection to ignored. But on some OSes (e.g.
+NetBSD), poll(2) will return only POLLIN in this case, so sockets in ignored
+state will stay open forever in xenstored (and it will loop with CPU 100%
+busy).
+
+Signed-off-by: Manuel Bouyer <bouyer%netbsd.org@localhost>
+Fixes: d2fa370d3ef9cbe22d7256c608671cdcdf6e0083
+---
+ tools/xenstore/xenstored_core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
+index 1ab6f162cb..0fea598352 100644
+--- tools/xenstore/xenstored_core.c.orig
++++ tools/xenstore/xenstored_core.c
+@@ -1440,6 +1440,9 @@ static void ignore_connection(struct connection *conn)
+ 
+       talloc_free(conn->in);
+       conn->in = NULL;
++      /* if this is a socket connection, drop it now */
++      if (conn->fd >= 0)
++              talloc_free(conn);
+ }
+ 
+ static const char *sockmsg_string(enum xsd_sockmsg_type type)



Home | Main Index | Thread Index | Old Index