diff options
author | bouyer <bouyer@pkgsrc.org> | 2021-02-04 11:45:53 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2021-02-04 11:45:53 +0000 |
commit | c705d7f7b89feb43d5bf4333f0944159c83c8af7 (patch) | |
tree | 92ede16c0220084c7fec11de02338731e72a0982 | |
parent | ed0dc6766ddf775097bacd29b863e637d5f71e41 (diff) | |
download | pkgsrc-c705d7f7b89feb43d5bf4333f0944159c83c8af7.tar.gz |
Fix build with newer ocaml.
Fix xenstored leaking file descriptors and busy-looping over them.
-rw-r--r-- | sysutils/xentools411/Makefile | 4 | ||||
-rw-r--r-- | sysutils/xentools411/distinfo | 6 | ||||
-rw-r--r-- | sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules | 13 | ||||
-rw-r--r-- | sysutils/xentools411/patches/patch-tools_ocaml_common.make | 20 | ||||
-rw-r--r-- | sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c | 29 |
5 files changed, 52 insertions, 20 deletions
diff --git a/sysutils/xentools411/Makefile b/sysutils/xentools411/Makefile index 153702c544d..b4489f0b726 100644 --- a/sysutils/xentools411/Makefile +++ b/sysutils/xentools411/Makefile @@ -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 --git a/sysutils/xentools411/distinfo b/sysutils/xentools411/distinfo index a96636b9b3d..0f70c801b25 100644 --- a/sysutils/xentools411/distinfo +++ b/sysutils/xentools411/distinfo @@ -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_dom.c) = 0c4a96523d13de65aaa71ef705c3579ee8d641f3 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_qemu-xen_qemu-doc.texi) = e72d480ec29829055f01226eaf020d4cbd10 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 --git a/sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules b/sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules new file mode 100644 index 00000000000..b6057a89f3d --- /dev/null +++ b/sysutils/xentools411/patches/patch-tools_ocaml_Makefile.rules @@ -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 --git a/sysutils/xentools411/patches/patch-tools_ocaml_common.make b/sysutils/xentools411/patches/patch-tools_ocaml_common.make index 433297eb277..2e87d6ba00b 100644 --- a/sysutils/xentools411/patches/patch-tools_ocaml_common.make +++ b/sysutils/xentools411/patches/patch-tools_ocaml_common.make @@ -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 @@ Add -unsafe-string to fix build with ocaml-4.06.0 and later 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 --git a/sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c b/sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c new file mode 100644 index 00000000000..02ac8447161 --- /dev/null +++ b/sysutils/xentools411/patches/patch-tools_xenstore_xenstored_core.c @@ -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> +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) |