Daniel P. Berrangé
2020-Feb-24 11:23 UTC
[Libguestfs] [PATCH] docs: fix instructions for building from git
On current Fedora releases the ocaml modules will fail to link unless CFLAGS contains -fPIC. The autogen.sh script only updates the 'gnulib' submodule, and so the build will fail due to the missing 'common' submodule. This needs to be manually initialized at checkout. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- The above was required for me to build on Fedora 31, but I don't think it is entirely satisfactory. IMHO, configure ought to add -fPIC automatically if it is needed by the distro. I also expected autogen.sh to update the submodules besides just gnulib. docs/guestfs-building.pod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod index 4bed86391..005626515 100644 --- a/docs/guestfs-building.pod +++ b/docs/guestfs-building.pod @@ -414,7 +414,8 @@ git. git clone https://github.com/libguestfs/libguestfs cd libguestfs - ./autogen.sh + git submodule update --init + CFLAGS=-fPIC ./autogen.sh make =head1 BUILDING FROM TARBALLS -- 2.24.1
Richard W.M. Jones
2020-Feb-24 13:26 UTC
Re: [Libguestfs] [PATCH] docs: fix instructions for building from git
On Mon, Feb 24, 2020 at 11:23:25AM +0000, Daniel P. Berrangé wrote:> On current Fedora releases the ocaml modules will fail to > link unless CFLAGS contains -fPIC. > > The autogen.sh script only updates the 'gnulib' submodule, > and so the build will fail due to the missing 'common' > submodule. This needs to be manually initialized at checkout. > > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> > --- > > The above was required for me to build on Fedora 31, but I > don't think it is entirely satisfactory. IMHO, configure > ought to add -fPIC automatically if it is needed by the > distro. I also expected autogen.sh to update the submodules > besides just gnulib. > > docs/guestfs-building.pod | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod > index 4bed86391..005626515 100644 > --- a/docs/guestfs-building.pod > +++ b/docs/guestfs-building.pod > @@ -414,7 +414,8 @@ git. > > git clone https://github.com/libguestfs/libguestfs > cd libguestfs > - ./autogen.sh > + git submodule update --init > + CFLAGS=-fPIC ./autogen.sh > make > > =head1 BUILDING FROM TARBALLSThanks - pushed it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org