Bug 1657151 - Build issue in libguestfs 1.36.10 on RHEL 6
Summary: Build issue in libguestfs 1.36.10 on RHEL 6
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: x86_64
OS: All
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2018-12-07 09:35 UTC by Abinaya
Modified: 2019-09-25 13:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-09-25 13:47:38 UTC

Attachments (Terms of Use)

Description Abinaya 2018-12-07 09:35:43 UTC
Facing issue while building "libguestfs- 1.36.10" on RHEL - 6 server.

Steps to Reproduce: we are using below build steps to build libguestfs

%configure --disable-appliance --disable-daemon --without-libvirt --with-qemu="qemu-kvm qemu-system-x86_64 qemu" --enable-python --prefix=%{_prefix} --with-python-installdir=%{_libdir64}/python3.5/site-packages

make %{?_smp_mflags}


Actual results:

  CC       ../common/visit/libmllib_a-visit.o
  CC       ../common/options/libmllib_a-decrypt.o
  CC       ../common/options/libmllib_a-keys.o
  CC       ../common/options/libmllib_a-uri.o
  CC       ../common/progress/libmllib_a-progress.o
  OCAMLOPT stringMap.cmx
  OCAMLOPT getopt.cmx
  OCAMLOPT unix_utils.cmx
  OCAMLOPT progress.cmx
  OCAMLOPT visit.cmx
  OCAMLOPT planner.cmx
  OCAMLCMI regedit.cmi
  OCAMLCMI xpath_helpers.cmi
  OCAMLOPT common_utils.cmx
/tmp/camlasmc0ac26.s: Assembler messages:
/tmp/camlasmc0ac26.s: Error: .size expression for camlCommon_utils__human_size_593 does not evaluate to a constant
/tmp/camlasmc0ac26.s: Error: .size expression for camlCommon_utils__size_scaled_586 does not evaluate to a constant
/tmp/camlasmc0ac26.s: Error: .size expression for camlCommon_utils__size_scaled_571 does not evaluate to a constant
/tmp/camlasmc0ac26.s: Error: .size expression for camlCommon_utils__fun_1268 does not evaluate to a constant
File "common_utils.ml", line 1, characters 0-1:
Error: Assembler error, input left in file /tmp/camlasmc0ac26.s
make[2]: *** [common_utils.cmx] Error 2
make[2]: Leaving directory `/root/rpmbuild/BUILD/libguestfs-1.36.10/mllib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/libguestfs-1.36.10'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.Zn51EF (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Zn51EF (%build)

Expected results:

1. Our request is to build and install libguestfs - 1.36.10 on RHEL6 servers.
So we have tried to build the same with above mentioned build steps but facing some issue which is related to Ocaml.

Please find below installed version of ocaml in our server [ default version provided by RedHat repository ]

[root@abinaya-libguest-r6 ~]$ rpm -qa | grep ocaml

As per my understanding this libguestfs - 1.36.10 needs ocaml 3.12 and higher but still i couldn't get any official doc for the dependencies.

Additional info:

We have done successful build on RHEL7 now the issue is only on RHEL6.

Please let us know some workaround for this issue.

Thanks in Advance!.

Comment 2 Richard W.M. Jones 2018-12-07 10:07:57 UTC
The requirements are documented here:


OCaml 4.01 is required now so it's going to be some effort to
make this work on RHEL 6.  You may have more luck going back a
few releases.  For example libguestfs 1.36 requires OCaml 3.11.

Comment 3 Richard W.M. Jones 2018-12-07 10:08:39 UTC
OK, I misread the subject line.  Anyway yes it should work, it's a strange
compiler error.  Could you capture the assembly file?

Comment 4 Richard W.M. Jones 2018-12-07 10:10:25 UTC
It's probably the same as this bug:


It requires a small OCaml compiler patch.

Comment 5 Abinaya 2018-12-07 10:51:57 UTC
Hi Richard,

Thanks for the update.

So if my understand correct you are suggesting us to apply some patch on libguestfs 1.36.10 to fix the ocaml issue.

Am I right?

Comment 6 Richard W.M. Jones 2018-12-07 11:08:45 UTC
No, you have to patch the OCaml compiler.  Please read bug 691896 in detail.

Comment 7 Abinaya 2018-12-07 11:40:53 UTC
Hi Richard,

As per my understanding the patch which all are mentioned in (https://bugzilla.redhat.com/show_bug.cgi?id=691896) for Fedora ocaml 3.12.

On our case the issue is in RedHat 6 ocaml, the version is 3.11.

Can you please confirm,  do we have the patch for RedHat 6 Ocaml-3.11.

Comment 8 Richard W.M. Jones 2018-12-07 12:27:48 UTC
Yes you will need to backport this patch:
(same as https://github.com/ocaml/ocaml/commit/80384c6d8401cdd897e7ff4c75a7a7b1a12b5585 )
to OCaml in RHEL 6.

Comment 9 Abinaya 2018-12-10 10:52:34 UTC
Hi Richard,

Thanks for the update.

As per your suggestion we have build ocaml with your patch and now issue seems different.

ocamlfind mklib -package str,unix -I ../common/utils/.libs -I ../lib/.libs -I ../gnulib/lib/.libs -I ../ocaml -I .  \
            guestfs_config.cmx ../mllib/bytes.cmx stringMap.cmx common_gettext.cmx getopt.cmx unix_utils.cmx common_utils.cmx progress.cmx URI.cmx visit.cmx planner.cmx registry.cmx regedit.cmx JSON.cmx curl.cmx checksums.cmx xml.cmx xpath_helpers.cmx ../common/visit/libmllib_a-visit.o ../common/options/libmllib_a-decrypt.o ../common/options/libmllib_a-keys.o ../common/options/libmllib_a-uri.o ../common/progress/libmllib_a-progress.o libmllib_a-common_utils-c.o libmllib_a-getopt-c.o libmllib_a-progress-c.o libmllib_a-unix_utils-c.o libmllib_a-uri-c.o libmllib_a-visit-c.o libmllib_a-xml-c.o -o mllib
Usage: ocamlfind query        [-help | other options] <package_name> ...
   or: ocamlfind ocamlc       [-help | other options] <file> ...
   or: ocamlfind ocamlcp      [-help | other options] <file> ...
   or: ocamlfind ocamlmktop   [-help | other options] <file> ...
   or: ocamlfind ocamlopt     [-help | other options] <file> ...
   or: ocamlfind ocamldep     [-help | other options] <file> ...
   or: ocamlfind ocamlbrowser [-help | other options]
   or: ocamlfind ocamldoc     [-help | other options] <file> ...
   or: ocamlfind install      [-help | other options] <package_name> <file> ...
   or: ocamlfind remove       [-help | other options] <package_name>
   or: ocamlfind printconf    [-help] [variable]
   or: ocamlfind list
   or: ocamlfind pkg/cmd arg ...
Select toolchain with:
  ocamlfind -toolchain <t> <command>
  e.g. ocamlfind opt instead of ocamlfind ocamlopt
make[2]: *** [mllib.cmxa] Error 2
make[2]: Leaving directory `/root/rpmbuild_lib/BUILD/libguestfs-1.36.10/mllib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild_lib/BUILD/libguestfs-1.36.10'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.3eUENW (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.3eUENW (%build)
[root@abinaya-libguest-r6 rpmbuild_lib]$

Can you help us here too.


Comment 10 Richard W.M. Jones 2018-12-10 11:08:08 UTC
Yes indeed.  Looks like the ocamlfind mklib subcommand wasn't added to
findlib until 2011, and the version of ocaml-findlib in RHEL 6 is older
than this.


Basically this is a bit of a fool's errand I'm afraid.  You need to use a
version of RHEL which is supported by libguestfs, and RHEL 6 ain't.

Comment 11 Pino Toscano 2019-09-25 13:47:38 UTC
As Rich explained in comment 10, RHEL 6 is no more a supported platform.
If you really want to build newer versions of libguestfs on RHEL 6 (which is not recommended), then you must backport all the newer versions of the toolchain.

In any case, not a libguestfs issue.

Note You need to log in before you can comment on or make changes to this bug.