Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build shared library for libxml2 #1917

Open
Kurvivor19 opened this issue Apr 7, 2020 · 3 comments
Open

Cannot build shared library for libxml2 #1917

Kurvivor19 opened this issue Apr 7, 2020 · 3 comments

Comments

@Kurvivor19
Copy link

Kurvivor19 commented Apr 7, 2020

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?

@Kurvivor19 Kurvivor19 added the bug label Apr 7, 2020
@Kurvivor19 Kurvivor19 changed the title [BUG] cannot build shared library for libxml2 Cannot build shared library for libxml2 Apr 7, 2020
@elieux
Copy link
Member

elieux commented Apr 8, 2020

Seems like the issue comes from icu:

$ pkg-config --libs icu-i18n
-licui18n -licuuc -licudata -lpthread -lm

But there's also a Python2 issue:

mv: cannot stat '/w/dev/msys2-packages/libxml2/src/dest/usr/lib/python2.7/site-packages/msys-xml2mod.dll': No such file or directory

@Alexpux
Copy link
Member

Alexpux commented Apr 8, 2020

The problem I think is from new binutils. You need add befor configure:
export lt_cv_deplibs_check_method=“pass_all”

@lazka
Copy link
Member

lazka commented Apr 17, 2020

export lt_cv_deplibs_check_method=“pass_all”

this works

edit: I'll look into fixing this an moving things to Python 3

lazka added a commit to lazka/MSYS2-packages that referenced this issue Apr 17, 2020
lazka added a commit to lazka/MSYS2-packages that referenced this issue Apr 17, 2020
lazka added a commit to lazka/MSYS2-packages that referenced this issue Apr 17, 2020
lazka added a commit to lazka/MSYS2-packages that referenced this issue Apr 17, 2020
Alexpux pushed a commit that referenced this issue Apr 18, 2020
* libxml2: fix the build

See #1917

* libxml2-python: Build with Python 3

* itstool: Build with Python 3

* libxslt: fix the build

See #1917

* libxslt: Drop libxslt-python

* yelp-xsl: Don't depend on libxslt-python

Doesn't look like it is used

* yelp-tools: Don't depend on libxslt-python

Doesn't seem to be used

* rarian: Don't depend on libxslt-python

libxslt seems enough
@lazka lazka removed the bug label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants