[arch-general] makepkg breaks the build when building binaries manually doesn't
I am trying to build/install libguestfs [1] from git. There is already am AUR package [2] but not the git version 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 with a PKBUILD and wrote one. 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 build part of PKGBUILD: build(){ cd "$srcdir/libguestfs" ./autogen.sh ./configure --someOptions make } I can't figure out why the binaries build manually and not using makepkg. I suspect this could be a path error at one point, but can't see why. Thank you for any suggestion. [1]http://libguestfs.org/ [2]https://aur.archlinux.org/packages/libguestfs -- google.com/+arnaudgabourygabx
On 11.08.2014 12:07, arnaud gaboury wrote:
../src/.libs/libutils.a( libutils_la-cleanup.o): In function `guestfs___cleanup_xmlBufferFree': cleanup.c:(.text+0x79): undefined reference to `xmlBufferFree'
makepkg sets a couple environment variables that are listed in /etc/makepkg.conf. By default this includes LDFLAGS="-Wl,--as-needed" which I believe normally produces these kinds of errors. You'll have to make sure that the gcc command that is run has all necessary -lfoo arguments at the end of the command line (after the output file iirc). So `gcc foo.c -o foo -lbar -lblub` I haven't dealt with those in months so this information may not be entirely correct.
makepkg sets a couple environment variables that are listed in /etc/makepkg.conf. By default this includes LDFLAGS="-Wl,--as-needed" which I believe normally produces these kinds of errors. You'll have to make sure that the gcc command that is run has all necessary -lfoo arguments at the end of the command line (after the output file iirc). So `gcc foo.c -o foo -lbar -lblub`
I haven't dealt with those in months so this information may not be entirely correct.
In fact, it is the way to investigate. I am comparing the two generated libguestfs/src/Makefile, and I can find some diff in flags.
participants (2)
-
arnaud gaboury
-
Florian Pritz