ocaml/examples: Link examples to gnulib
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 11 Sep 2021 08:36:08 +0000 (09:36 +0100)
committerAntonio Terceiro <terceiro@debian.org>
Sat, 4 Dec 2021 15:11:35 +0000 (15:11 +0000)
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

Gbp-Pq: Name ocaml-examples-Link-examples-to-gnulib.patch

ocaml/examples/Makefile.am

index 19cbebdf9c15e57f58e4efd54504d42948550661..d8c3dd4c5d7b1e4464dbc27844983cba986dc870 100644 (file)
@@ -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