When trying to build libxml2 manually from source, process described in
https://github.com/msys2/MSYS2-packages/blob/master/libxml2/PKGBUILD fails.

What i did:

1. downloaded sources for libxml2-2.9.10;
2. applied patches;
3. run autoreconf;
4. configured with options proposed, with:

>  ../configure --prefix=/usr --build=x86_64-pc-msys --enable-shared
--sysconfdir=/etc --localstatedir=/var --host=x86_64-pc-msys
--target=x86_64-pc-msys --enable-ipv6 --with-history --with-icu
--with-python=/usr/bin/python2

When running make, i get the following output:

```

> *** Warning: linker path does not have real file for library -lpthread.
> *** I have the capability to make that library automatically link in when
> *** you link to this library.  But I can only do this if you have a
> *** shared version of the library, which you do not appear to have
> *** because I did check the linker path looking for a file starting
> *** with libpthread and none of the candidates passed a file format test
> *** using a file magic. Last file checked: /usr/lib/libpthread.a
> *** The inter-library dependencies that have been dropped here will be
> *** automatically added whenever a program is linked with this library
> *** or is declared to -dlopen it.
>
> *** Since this library must not contain undefined symbols,
> *** because either the platform does not support them or
> *** it was explicitly requested with -no-undefined,
> *** libtool will only create a static version of it.

then number of undefined references:

>   CCLD     xmllint.exe
> /usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld:
xmllint.o: in function `xmllintExternalEntityLoader':
> /e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:310:
undefined reference to `__imp_xmlFree'
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:310:(.text+0xb25):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__imp_xmlFree'
> /usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld:
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:307:
undefined reference to `__imp_xmlFree'
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:307:(.text+0xcd2):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__imp_xmlFree'
> /usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld:
xmllint.o: in function `myStrdupFunc':
> /e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:381:
undefined reference to `__imp_xmlFree'
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:381:(.text+0xd48):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__imp_xmlFree'
> /usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld:
xmllint.o: in function `processNode':
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:1803:
undefined reference to `__imp_xmlFree'
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:1803:(.text+0x106e):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__imp_xmlFree'
> /usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld:
xmllint.o: in function `xmlHTMLEncodeSend':
> /e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:534:
undefined reference to `__imp_xmlFree'
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:534:(.text+0x1c3c):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__imp_xmlFree'
> /usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld:
xmllint.o:/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:2625:
more undefined references to `__imp_xmlFree' follow
> xmllint.o: in function `parseAndPrintFile':
>
/e/work/unix_env/sources_packages/libxml2-2.9.10/build2/../xmllint.c:2625:(.text+0x2313):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__imp_xmlFree'

What goes wrong and how can the issue be resolved?

>From searching in the internet it seems that unresolved externals issue can
be solved by passing a flag to compilation. as per
https://github.com/msys2/MSYS2-packages/issues/171.
That seems wrong, for during build of the library all appropriate or needed
flags should be passed by the configuration system.
But failure to build shared library due to "missing" "real shared lpthread"
is somnething mysterious to me
_______________________________________________
Msys2-users mailing list
Msys2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to