70cfe51
--- xen-4.17.1/tools/ocaml/common.make.orig	2023-04-27 06:53:19.000000000 -0600
70cfe51
+++ xen-4.17.1/tools/ocaml/common.make	2023-06-20 09:47:25.250969763 -0600
70cfe51
@@ -11,9 +11,9 @@ OCAMLFIND ?= ocamlfind
70cfe51
 
70cfe51
 CFLAGS += -fPIC -I$(shell ocamlc -where)
70cfe51
 
70cfe51
-OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
70cfe51
-OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
70cfe51
-OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
70cfe51
+OCAMLOPTFLAG_G := -g
70cfe51
+OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F -I +unix
70cfe51
+OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F -I +unix
70cfe51
 
70cfe51
 VERSION := 4.1
70cfe51
 
70cfe51
--- xen-4.17.1/tools/ocaml/Makefile.rules.orig	2023-04-27 06:53:19.000000000 -0600
70cfe51
+++ xen-4.17.1/tools/ocaml/Makefile.rules	2023-06-20 10:00:58.769235173 -0600
70cfe51
@@ -59,9 +59,9 @@ quiet-command = $(if $(V),$1,@printf " %
70cfe51
 mk-caml-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $1 $2 $3,MLA,$1)
70cfe51
 mk-caml-lib-bytecode = $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -a -o $1 $2 $3,MLA,$1)
70cfe51
 
70cfe51
-mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1)
70cfe51
+mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -g -o `basename $1 .a` $2,MKLIB,$1)
70cfe51
 mk-caml-lib-stubs = \
70cfe51
-	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
70cfe51
+	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -g -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
70cfe51
 
70cfe51
 # define a library target <name>.cmxa and <name>.cma
70cfe51
 define OCAML_LIBRARY_template
70cfe51
--- xen-4.17.1/tools/ocaml/xenstored/disk.ml.orig	2023-04-27 06:53:19.000000000 -0600
70cfe51
+++ xen-4.17.1/tools/ocaml/xenstored/disk.ml	2023-06-20 09:49:44.361963710 -0600
70cfe51
@@ -30,7 +30,7 @@ let undec c =
99dc35f
   | _          -> raise (Failure "undecify")
70cfe51
 
70cfe51
 let unhex c =
99dc35f
-  let c = Char.lowercase c in
99dc35f
+  let c = Char.lowercase_ascii c in
99dc35f
   match c with
99dc35f
   | '0' .. '9' -> (Char.code c) - (Char.code '0')
99dc35f
   | 'a' .. 'f' -> (Char.code c) - (Char.code 'a') + 10