issue when building/making package from git
I am trying to build/install libguestfs from git. My box is Archlinux, GCC 4.9.1 and all dev tools installed. If I manually $ gitclone gitUrl $ cd libguestfs $ ./autogen.sh $ ./configure --someOptions the build goes until the end and leaves me with binaries. ------------------------------ --- Now I want to install it properly on my machine. Arch use a makepkg [1] command to build and install packages not in the official repos. When running $ makepkg I have this structure which sounds correct: libguestfs-git/pkg/ libguestfs-git/src/AllNeededDir_cloned_here but at one time the build breaks with these errors: ----------------------------- ../src/.libs/libutils.a( libutils_la-cleanup.o): In function `guestfs___cleanup_xmlBufferFree': cleanup.c:(.text+0x79): undefined reference to `xmlBufferFree' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeDoc': cleanup.c:(.text+0x99): undefined reference to `xmlFreeDoc' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeURI': cleanup.c:(.text+0xb9): undefined reference to `xmlFreeURI' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeTextWriter': cleanup.c:(.text+0xd9): undefined reference to `xmlFreeTextWriter' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeContext': cleanup.c:(.text+0xf9): undefined reference to `xmlXPathFreeContext' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeObject': cleanup.c:(.text+0x119): undefined reference to `xmlXPathFreeObject' collect2: error: ld returned 1 exit status Makefile:1598: recipe for target 'virt-p2v' failed ------------------------------------- I can't figure out why the binaries build manually and not using makepkg(). The only things I see are CFLAGS and LDFLAGS passed to makepkg(). Here are part from /etc/makepkg.conf: ------------------------------ CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4" CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" #-- Make Flags: change this for DistCC/SMP systems MAKEFLAGS="-j 8" #-- Debugging flags DEBUG_CFLAGS="-g -fvar-tracking-assignments" DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" ------------------------------ Is there any flag which can prevent to build libguestfs? I even tried to add some more flags regarding xml2 (not sure it is worth) but it didn't change. ------------ -I/usr/include/libxml2 -lxml2 -lz -ldl -lm ------------------------ Thank you for any suggestion. [1]https://wiki.archlinux.org/index.php/Makepkg
On Mon, Aug 11, 2014 at 03:06:57PM +0200, arnaud gaboury wrote:
I am trying to build/install libguestfs from git. My box is Archlinux, GCC 4.9.1 and all dev tools installed.
If I manually $ gitclone gitUrl $ cd libguestfs $ ./autogen.sh $ ./configure --someOptions
the build goes until the end and leaves me with binaries.
Does p2v/virt-p2v (binary) exist?
Now I want to install it properly on my machine. Arch use a makepkg [1] command to build and install packages not in the official repos.
When running $ makepkg I have this structure which sounds correct: libguestfs-git/pkg/ libguestfs-git/src/AllNeededDir_cloned_here
but at one time the build breaks with these errors: ----------------------------- ../src/.libs/libutils.a( libutils_la-cleanup.o): In function `guestfs___cleanup_xmlBufferFree': cleanup.c:(.text+0x79): undefined reference to `xmlBufferFree' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeDoc': cleanup.c:(.text+0x99): undefined reference to `xmlFreeDoc' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeURI': cleanup.c:(.text+0xb9): undefined reference to `xmlFreeURI' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeTextWriter': cleanup.c:(.text+0xd9): undefined reference to `xmlFreeTextWriter' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeContext': cleanup.c:(.text+0xf9): undefined reference to `xmlXPathFreeContext' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeObject': cleanup.c:(.text+0x119): undefined reference to `xmlXPathFreeObject' collect2: error: ld returned 1 exit status Makefile:1598: recipe for target 'virt-p2v' failed
The error seems to be libxml2 missing. Now it builds OK using just a plain build, but not from makepkg. Can you get makepkg to add `V=1' flag to make, ie: make V=1 That should print the full compile/link commands.
I can't figure out why the binaries build manually and not using makepkg(). The only things I see are CFLAGS and LDFLAGS passed to makepkg(). Here are part from /etc/makepkg.conf: ------------------------------ CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4" CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" #-- Make Flags: change this for DistCC/SMP systems MAKEFLAGS="-j 8" #-- Debugging flags DEBUG_CFLAGS="-g -fvar-tracking-assignments" DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" ------------------------------
Is there any flag which can prevent to build libguestfs? I even tried to add some more flags regarding xml2 (not sure it is worth) but it didn't change. ------------ -I/usr/include/libxml2 -lxml2 -lz -ldl -lm ------------------------
Thank you for any suggestion.
I'll see if I can build it on my ArchLinux VM. 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
Does p2v/virt-p2v (binary) exist?
NO
Now I want to install it properly on my machine. Arch use a makepkg [1] command to build and install packages not in the official repos.
When running $ makepkg I have this structure which sounds correct: libguestfs-git/pkg/ libguestfs-git/src/AllNeededDir_cloned_here
but at one time the build breaks with these errors: ----------------------------- ../src/.libs/libutils.a( libutils_la-cleanup.o): In function `guestfs___cleanup_xmlBufferFree': cleanup.c:(.text+0x79): undefined reference to `xmlBufferFree' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeDoc': cleanup.c:(.text+0x99): undefined reference to `xmlFreeDoc' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeURI': cleanup.c:(.text+0xb9): undefined reference to `xmlFreeURI' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeTextWriter': cleanup.c:(.text+0xd9): undefined reference to `xmlFreeTextWriter' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeContext': cleanup.c:(.text+0xf9): undefined reference to `xmlXPathFreeContext' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeObject': cleanup.c:(.text+0x119): undefined reference to `xmlXPathFreeObject' collect2: error: ld returned 1 exit status Makefile:1598: recipe for target 'virt-p2v' failed
The error seems to be libxml2 missing. Now it builds OK using just a plain build, but not from makepkg.
No, libxml2-2.1-5 is installed
Can you get makepkg to add `V=1' flag to make, ie:
make V=1
That should print the full compile/link commands.
I will do shortly
Patch applied. ------- ==> Creating package "libguestfs-git"... -> Generating .PKGINFO file... -> Generating .MTREE file... -> Compressing package... ==> Leaving fakeroot environment. ==> Finished making: libguestfs-git 1.27.25.12.gbbae613-1 (Mon Aug 11 18:24:54 CEST 2014) ---------------------- martinus@gerbillous ➤➤ ~aur/libguestfs-git % ls -al src/libguestfs/v2v | grep virt-v2v 41:-rw-r--r-- 1 martinus martinus 0 Aug 11 18:24 stamp-virt-v2v.pod 71:-rwxr-xr-x 1 martinus martinus 2.3M Aug 11 18:24 virt-v2v* 72:-rw-r--r-- 1 martinus martinus 19K Aug 11 18:24 virt-v2v.1 75:-rw-r--r-- 1 martinus martinus 13K Aug 11 18:19 virt-v2v.pod ------------------------------------------------------------- A big thank you. Now, let's start to learn the command. I am virtualizing a w8 partition using libvirt qemu/kvm and would like to create a virtual image from physical partition.
On Mon, Aug 11, 2014 at 06:29:34PM +0200, arnaud gaboury wrote:
Patch applied.
------- ==> Creating package "libguestfs-git"... -> Generating .PKGINFO file... -> Generating .MTREE file... -> Compressing package... ==> Leaving fakeroot environment. ==> Finished making: libguestfs-git 1.27.25.12.gbbae613-1 (Mon Aug 11 18:24:54 CEST 2014) ---------------------- martinus@gerbillous ➤➤ ~aur/libguestfs-git % ls -al src/libguestfs/v2v | grep virt-v2v 41:-rw-r--r-- 1 martinus martinus 0 Aug 11 18:24 stamp-virt-v2v.pod 71:-rwxr-xr-x 1 martinus martinus 2.3M Aug 11 18:24 virt-v2v* 72:-rw-r--r-- 1 martinus martinus 19K Aug 11 18:24 virt-v2v.1 75:-rw-r--r-- 1 martinus martinus 13K Aug 11 18:19 virt-v2v.pod -------------------------------------------------------------
A big thank you. Now, let's start to learn the command. I am virtualizing a w8 partition using libvirt qemu/kvm and would like to create a virtual image from physical partition.
This is extremely alpha code, so good luck. If it fails, then you should capture the virt-v2v output with the -x and -v flags, and post the complete output here. (For virt-p2v there is a button in the user interface which does effectively the same thing). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Hi, On Monday 11 August 2014 15:06:57 arnaud gaboury wrote:
I am trying to build/install libguestfs from git. My box is Archlinux, GCC 4.9.1 and all dev tools installed.
If I manually $ gitclone gitUrl $ cd libguestfs $ ./autogen.sh $ ./configure --someOptions
the build goes until the end and leaves me with binaries. ------------------------------ ---
Now I want to install it properly on my machine. Arch use a makepkg [1] command to build and install packages not in the official repos.
When running $ makepkg I have this structure which sounds correct: libguestfs-git/pkg/ libguestfs-git/src/AllNeededDir_cloned_here
but at one time the build breaks with these errors: ----------------------------- ../src/.libs/libutils.a( libutils_la-cleanup.o): In function `guestfs___cleanup_xmlBufferFree': cleanup.c:(.text+0x79): undefined reference to `xmlBufferFree' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeDoc': cleanup.c:(.text+0x99): undefined reference to `xmlFreeDoc' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeURI': cleanup.c:(.text+0xb9): undefined reference to `xmlFreeURI' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlFreeTextWriter': cleanup.c:(.text+0xd9): undefined reference to `xmlFreeTextWriter' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeContext': cleanup.c:(.text+0xf9): undefined reference to `xmlXPathFreeContext' ../src/.libs/libutils.a(libutils_la-cleanup.o): In function `guestfs___cleanup_xmlXPathFreeObject': cleanup.c:(.text+0x119): undefined reference to `xmlXPathFreeObject' collect2: error: ld returned 1 exit status Makefile:1598: recipe for target 'virt-p2v' failed -------------------------------------
This could seem like https://bugzilla.redhat.com/show_bug.cgi?id=1102447 Can you please check my suggestion in comment #2? (Note you will need to run autogen.sh + configure, or you can patch the clean sources from Git before starting the build.) Thanks, -- Pino Toscano
I agree with Pino this is likely to be bug 1102447. Does the patch help? https://bugzilla.redhat.com/show_bug.cgi?id=1102447#c3 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On Mon, Aug 11, 2014 at 3:54 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
I agree with Pino this is likely to be bug 1102447.
Does the patch help? https://bugzilla.redhat.com/show_bug.cgi?id=1102447#c3
I will try shortly and post result.
participants (3)
-
arnaud gaboury -
Pino Toscano -
Richard W.M. Jones