SHA256
1
0
forked from pool/libguestfs
libguestfs/489b14b7-ocaml-examples-Link-examples-to-gnulib.patch

43 lines
2.2 KiB
Diff

Subject: ocaml/examples: Link examples to gnulib
From: Richard W.M. Jones rjones@redhat.com Sat Sep 11 09:36:08 2021 +0100
Date: Sat Sep 11 09:36:08 2021 +0100:
Git: 489b14b75e5f30010d8a8c8d3a10ecc52b629563
It's unclear why exactly the OCaml library is using replacement
symbols, but it is so we need gnulib. Note this only applies in the
stable-1.44 branch since upstream we have finally got rid of gnulib,
because of exactly these kinds of problems that it causes everyone.
ocamlfind ocamlopt -cclib -L../../lib/.libs -package unix -linkpkg \
-warn-error A -I .. mlguestfs.cmxa create_disk.ml -o create_disk
../libmlguestfs.a(libguestfsocaml_a-guestfs-c.o): In function `guestfs_finalize':
/home/rjones/d/libguestfs-1.44/ocaml/guestfs-c.c:86: undefined reference to `rpl_free'
/home/rjones/d/libguestfs-1.44/ocaml/guestfs-c.c:88: undefined reference to `rpl_free'
../libmlguestfs.a(libguestfsocaml_a-guestfs-c.o): In function `guestfs_int_ocaml_set_event_callback':
/home/rjones/d/libguestfs-1.44/ocaml/guestfs-c.c:239: undefined reference to `rpl_free'
../libmlguestfs.a(libguestfsocaml_a-guestfs-c.o): In function `guestfs_int_ocaml_delete_event_callback':
/home/rjones/d/libguestfs-1.44/ocaml/guestfs-c.c:266: undefined reference to `rpl_free'
../libmlguestfs.a(libguestfsocaml_a-guestfs-c.o): In function `guestfs_int_ocaml_event_to_string':
/home/rjones/d/libguestfs-1.44/ocaml/guestfs-c.c:290: undefined reference to `rpl_free'
../libmlguestfs.a(libguestfsocaml_a-guestfs-c-actions.o):/home/rjones/d/libguestfs-1.44/ocaml/guestfs-c-actions.c:1188: more undefined references to `rpl_free' follow
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
make[2]: *** [Makefile:2272: create_disk] Error 2
diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am
index 19cbebdf9..d8c3dd4c5 100644
--- a/ocaml/examples/Makefile.am
+++ b/ocaml/examples/Makefile.am
@@ -48,7 +48,9 @@ if HAVE_OCAML
noinst_SCRIPTS = create_disk debug_logging inspect_vm
-OCAMLFINDFLAGS = -cclib -L$(top_builddir)/lib/.libs
+OCAMLFINDFLAGS = \
+ -cclib -L$(top_builddir)/lib/.libs \
+ -cclib -L$(top_builddir)/gnulib/lib/.libs -cclib -lgnu
if HAVE_OCAMLOPT
create_disk: create_disk.ml