AndreRH / hangover

Hangover runs simple Win32 applications on arm64 Linux
GNU Lesser General Public License v2.1
1.26k stars 92 forks source link

Aarch64 GNU/Linux Build error: undefined reference to 'xmlXPathNodeSetAddUnique'... and more #23

Closed ric96 closed 4 years ago

ric96 commented 5 years ago

gcc version 8.2-win32 20190215 (GCC) Complete Build log: https://pastebin.com/rif0iCxT

$ x86_64-w64-mingw32-gcc -v  
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-w64-mingw32/8.2-win32/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../../src/configure --build=aarch64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir='/usr/lib/aarch64-linux-gnu' --libexecdir='/usr/lib/aarch64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-shared --enable-static --disable-multilib --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --libdir=/usr/lib --enable-libstdcxx-time=yes --with-tune=generic --with-headers=/usr/x86_64-w64-mingw32/include --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libgomp --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-lto --with-plugin-ld --enable-threads=win32 --program-suffix=-win32 --program-prefix=x86_64-w64-mingw32- --target=x86_64-w64-mingw32 --with-as=/usr/bin/x86_64-w64-mingw32-as --with-ld=/usr/bin/x86_64-w64-mingw32-ld --enable-libatomic
Thread model: win32
gcc version 8.2-win32 20190215 (GCC) 
GrandBasis commented 5 years ago

I have encountered this problem, you are just missing build dependencies, if you work on ubuntu, you need sudo apt build-dep libxml2 libxslt libpng qemu wine But in the end it is still the problem https://github.com/AndreRH/hangover/issues/22

ric96 commented 5 years ago

sudo apt build-dep libxml2 libxslt libpng qemu wine that didn't help

stefand commented 5 years ago

The build deps should not be the issue in this case. Libxml and libxslt are compiled for the guest side (i.e., x86 and x86_64 windows) so that the guest side msxml.dll from Wine can link against it.

It seems that your libxslt does not find libxml. A few things to try:

) Don't use a parallel make, i.e., run just "make" and not "make -j XX". Start with a clean hangover tree. ) If that fails with the same error, build libxslt with V=1. Look for the libxslt dir in build/, cd into it and run "make V=1". It will give more details. Sorry, I don't have the exact name of the directory in my head.

ric96 commented 5 years ago

Errors with 'make V=1' https://pastebin.com/Wdz1Qq0W

savelov commented 5 years ago

my failed command was /bin/bash ../libtool --silent --tag=CC --mode=link x86_64-w64-mingw32-gcc -I/home/eugene/hangover/build/x86_64-w64-mingw32/include/libxml2 -I/home/eugene/hangover/build/x86_64-w64-mingw32/include -g -O2 -Wall -Wformat=2 -Wmissing-format-attribute -version-info 8:20:8 -no-undefined -o libexslt.la -rpath /home/eugene/hangover/build/x86_64-w64-mingw32/lib exslt.lo common.lo crypto.lo math.lo sets.lo functions.lo strings.lo date.lo saxon.lo dynamic.lo ../libxslt/libxslt.la I have added ../../libxml2_64/libxml2.la at the end to include libxml2 and apparently it fixed the build

stefand commented 5 years ago

It is not trying to link to libxml2. Is libxml2 built correctly?

stefand commented 5 years ago

Er, I did not read your last commend carefully enough. So libxml2 is there, although I think it should be built as a dynamic DLL, not a statically linked library. Something is certainly wrong - you shouldn't have to manually patch up build instructions...

savelov commented 5 years ago

so for building 64-bit libexslt.la I had to manually add ../../libxml2_64/libxml2.la to the cmd line, and for 32-bit libexslt.la - ../../libxml2_32/libxml2.la apparently root Makefile need to be amended to include those libraries for linking

stefand commented 5 years ago

pkgconfig should figure this out. We invoke libxslt's configure with a PKG_CONFIG_PATH that points to the location where the Win32/Win64 build of libxml2.dll is placed.

Do you have pkgconfig installed on your system? If it is missing it might explain the symptom, although I would expect libxslt's configure to fail because it isn't able to find libxml2.

savelov commented 5 years ago

did you mean pkg-config? it is present, but I assume this is for system libraries - but as I am on aarch64, local aarch64 libxml2 will not help, as I need x86_64 one to link

GrandBasis commented 5 years ago

As stefand said, the libxml2 static library was not found during the link phase, but it has been built correctly. You need to add the $(LIBXML_LIBS) parameter to the /hangover/libxslt64/libexslt/Makefile 144 line libexslt_la_LINK variable. This parameter is in the Makefile. Already defined but not used, I don't know why, after the generated libxslt32 also has the same problem

GrandBasis commented 5 years ago

I tried to add $(LIBXML_LIBS) in the hangover/libxslt/libexslt/Makefile.am 30 line variable libexslt_la_LIBADD, the libexslt.la dependency library is included, and the compilation is successful, I don't know if there is any impact on other locations.

AndreRH commented 4 years ago

fixed by 51c0399a04a1b668391be2028a09a72a4380fa62