--- xen-4.17.1/tools/ocaml/common.make.orig 2023-04-27 06:53:19.000000000 -0600 +++ xen-4.17.1/tools/ocaml/common.make 2023-06-20 09:47:25.250969763 -0600 @@ -11,9 +11,9 @@ OCAMLFIND ?= ocamlfind CFLAGS += -fPIC -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 +OCAMLOPTFLAG_G := -g +OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F -I +unix +OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F -I +unix VERSION := 4.1 --- xen-4.17.1/tools/ocaml/libs/xentoollog/xentoollog_stubs.c.orig 2023-04-27 06:53:19.000000000 -0600 +++ xen-4.17.1/tools/ocaml/libs/xentoollog/xentoollog_stubs.c 2023-06-20 09:04:30.375263358 -0600 @@ -33,7 +33,7 @@ /* The following is equal to the CAMLreturn macro, but without the return */ #define CAMLdone do{ \ -caml_local_roots = caml__frame; \ +CAML_LOCAL_ROOTS = caml__frame; \ }while (0) #define XTL ((xentoollog_logger *) Xtl_val(handle)) --- xen-4.17.1/tools/ocaml/libs/xl/xenlight_stubs.c.orig 2023-04-27 06:53:19.000000000 -0600 +++ xen-4.17.1/tools/ocaml/libs/xl/xenlight_stubs.c 2023-06-20 09:34:09.550454354 -0600 @@ -43,14 +43,14 @@ #ifndef CAMLreturnT #define CAMLreturnT(type, result) do { \ type caml__temp_result = (result); \ - caml_local_roots = caml__frame; \ + CAML_LOCAL_ROOTS = caml__frame; \ return (caml__temp_result); \ } while (0) #endif /* The following is equal to the CAMLreturn macro, but without the return */ #define CAMLdone do{ \ -caml_local_roots = caml__frame; \ +CAML_LOCAL_ROOTS = caml__frame; \ }while (0) #define Ctx_val(x)(*((libxl_ctx **) Data_custom_val(x))) --- xen-4.17.1/tools/ocaml/Makefile.rules.orig 2023-04-27 06:53:19.000000000 -0600 +++ xen-4.17.1/tools/ocaml/Makefile.rules 2023-06-20 10:00:58.769235173 -0600 @@ -59,9 +59,9 @@ quiet-command = $(if $(V),$1,@printf " % mk-caml-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $1 $2 $3,MLA,$1) mk-caml-lib-bytecode = $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -a -o $1 $2 $3,MLA,$1) -mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1) +mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -g -o `basename $1 .a` $2,MKLIB,$1) mk-caml-lib-stubs = \ - $(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1) + $(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -g -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1) # define a library target .cmxa and .cma define OCAML_LIBRARY_template --- xen-4.17.1/tools/ocaml/xenstored/disk.ml.orig 2023-04-27 06:53:19.000000000 -0600 +++ xen-4.17.1/tools/ocaml/xenstored/disk.ml 2023-06-20 09:49:44.361963710 -0600 @@ -30,7 +30,7 @@ let undec c = | _ -> raise (Failure "undecify") let unhex c = - let c = Char.lowercase c in + let c = Char.lowercase_ascii c in match c with | '0' .. '9' -> (Char.code c) - (Char.code '0') | 'a' .. 'f' -> (Char.code c) - (Char.code 'a') + 10