guestfs-tools build issues
Hi Rich, I've consistently been hitting issues with guestfs-tools builds. I have workarounds but they are annoying. 1) With a fresh checkout I run: $ git submodule init $ git submodule update $ autoreconf -if $ ./configure $ make -j8 I will get these errors: make[3]: Entering directory '/home/crobinso/src/guestfs-tools/builder' GEN virt-builder GEN virt-builder-repository /usr/bin/ld: virt_builder_repository-index-scan.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status File "caml_startup", line 1: Error: Error during linking (exit code 1) make[3]: *** [Makefile:1261: virt-builder-repository] Error 2 make[3]: *** Waiting for unfinished jobs.... /usr/bin/ld: virt_builder-index-scan.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status File "caml_startup", line 1: Error: Error during linking (exit code 1) make[3]: *** [Makefile:1257: virt-builder] Error 2 make[3]: Leaving directory '/home/crobinso/src/guestfs-tools/builder' I can fix it with `make -j8 CFLAGS="-fPIE -fPIC"` but only after doing a full `make clean`. 2) If I make a trivial change in common/, like adding whitespace in common/mlcustomize/customize_run.ml, subsequent guestfs-tools build will failu with: make[2]: Entering directory '/home/crobinso/src/guestfs-tools/customize' GEN virt-customize File "_none_", line 1: Error: Files customize_main.cmx and ../common/mlcustomize/mlcustomize.cmxa make inconsistent assumptions over implementation Customize_run Again, a `make clean` and rebuild will fix it. Are these expected, or is something wrong with my environment? Host is Fedora 41 Thanks, Cole
On Tue, Apr 08, 2025 at 11:34:40AM -0400, Cole Robinson wrote:
Hi Rich, I've consistently been hitting issues with guestfs-tools builds. I have workarounds but they are annoying.
1) With a fresh checkout I run:
$ git submodule init $ git submodule update $ autoreconf -if $ ./configure $ make -j8
I will get these errors:
make[3]: Entering directory '/home/crobinso/src/guestfs-tools/builder' GEN virt-builder GEN virt-builder-repository /usr/bin/ld: virt_builder_repository-index-scan.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
This happens because we compile the Fedora OCaml compiler with either -fPIE or -fPIC (I forget exactly which, maybe both). This is a slightly non-standard configuration so it breaks things. It doesn't happen on Debian. Anyway the fix is very trivial, just configure guestfs-tools and virt-v2v like this: ./configure CFLAGS="-O2 -g -fPIC" Actually I have a ./localconfigure script which wraps my very long and complex ./configure line (note that .gitignore ignores any file matching local* for exactly this reason).
2) If I make a trivial change in common/, like adding whitespace in common/mlcustomize/customize_run.ml, subsequent guestfs-tools build will failu with:
make[2]: Entering directory '/home/crobinso/src/guestfs-tools/customize' GEN virt-customize File "_none_", line 1: Error: Files customize_main.cmx and ../common/mlcustomize/mlcustomize.cmxa make inconsistent assumptions over implementation Customize_run
This is because we're missing a dependency somewhere, probably in ocaml-dep.sh.in, or one of the Makefile.am snippets that generates .depend in subdirectories, so yes it's a real bug!
Again, a `make clean` and rebuild will fix it.
Are these expected, or is something wrong with my environment? Host is Fedora 41
Expected, but also a bug. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On 4/8/25 11:41 AM, Richard W.M. Jones wrote:
On Tue, Apr 08, 2025 at 11:34:40AM -0400, Cole Robinson wrote:
Hi Rich, I've consistently been hitting issues with guestfs-tools builds. I have workarounds but they are annoying.
1) With a fresh checkout I run:
$ git submodule init $ git submodule update $ autoreconf -if $ ./configure $ make -j8
I will get these errors:
make[3]: Entering directory '/home/crobinso/src/guestfs-tools/builder' GEN virt-builder GEN virt-builder-repository /usr/bin/ld: virt_builder_repository-index-scan.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
This happens because we compile the Fedora OCaml compiler with either -fPIE or -fPIC (I forget exactly which, maybe both). This is a slightly non-standard configuration so it breaks things. It doesn't happen on Debian.
Anyway the fix is very trivial, just configure guestfs-tools and virt-v2v like this:
./configure CFLAGS="-O2 -g -fPIC"
Actually I have a ./localconfigure script which wraps my very long and complex ./configure line (note that .gitignore ignores any file matching local* for exactly this reason).
OK noted, thanks. Note I've never needed this for virt-v2v. But I do see some fPIC references in virt-v2v makefiles, so maybe it has a workaround already - Cole
participants (2)
-
Cole Robinson -
Richard W.M. Jones