From 711fab172ca2b2cad5d91636cd408dcefc5cea44 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 15 Jan 2020 12:52:29 +0000 Subject: [PATCH] ocaml: Fix test for -runtime-variant _pic. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fails with Fedora 32, and possibly earlier versions: checking if OCaml ‘-runtime-variant _pic’ works... no The reason is: $ ocamlc -runtime-variant _pic test.ml -o test File "test.ml", line 1: Error: Cannot find file camlheader_pic which may even be a packaging error in the Fedora package. However it makes no sense to test the bytecode compiler since we don't use it on any architecture we care about and bytecode doesn't even contain a linked runtime. Changing the test to use ocamlopt instead of ocamlc fixes the problem. --- m4/guestfs-ocaml.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4 index 1ba487f96..f8de169aa 100644 --- a/m4/guestfs-ocaml.m4 +++ b/m4/guestfs-ocaml.m4 @@ -67,7 +67,7 @@ if test "x$OCAMLC" != "xno"; then AC_MSG_CHECKING([if OCaml ‘-runtime-variant _pic’ works]) rm -f conftest.ml contest echo 'print_endline "hello world"' > conftest.ml - if $OCAMLC conftest.ml -runtime-variant _pic -o conftest >&5 2>&5 ; then + if $OCAMLOPT conftest.ml -runtime-variant _pic -o conftest >&5 2>&5 ; then AC_MSG_RESULT([yes]) OCAML_RUNTIME_VARIANT_PIC_OPTION="-runtime-variant _pic" else