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