Red Hat Bugzilla – Full Text Bug Listing
|Summary:||can't statically link programs that use libxml++|
|Product:||[Fedora] Fedora||Reporter:||Dimitri Maziuk <dmaziuk>|
|Component:||libxml++||Assignee:||Konstantin Ryabitsev <icon>|
|Status:||CLOSED NOTABUG||QA Contact:||Fedora Extras Quality Assurance <extras-qa>|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2008-05-13 05:36:23 EDT||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
Description Dimitri Maziuk 2008-05-08 16:45:09 EDT
Description of problem: libxml++.a missing from -devel rpm Version-Release number of selected component (if applicable): 2.20.0-1.fc8 How reproducible: always Steps to Reproduce: 1. link w/ -static -lxml (or -lxml-2.6, see below) Actual results: /usr/bin/ld: cannot find -lxml collect2: ld returned 1 exit status make: *** [all] Error 1 Additional info: main package contains libxml++-2.6.so, but there is no libxml++.so symlink. Is that deliberate? (i.e. must link with -lxml-2.6 rather than -lxml -- note that neither works with -static.)
Comment 1 Denis Leroy 2008-05-13 05:36:23 EDT
To compile or link with libxml++, you need to have the -devel package installed. The *.so file is contained in the -devel package for that reason. The compiled executable links directly to the versioned libxml.so.x file, which is how libtool works and is very much intentional since it guarantees ABI compatiblity can be maintained by RPM. So I'm not sure I understand your issue. I just reviewed the libxml spec and it's pretty standard.
Comment 2 Dimitri Maziuk 2008-05-13 10:21:33 EDT
You missed "-static" -- it's not .so, it's .a I'm talking about. In case you still don't get it, I need to deploy the application on a compute cluster of umpteen hundred nodes and installing all required .so's on each and every one of them is way too much work. What you normally do is link all library code in, so the binary is self contained, no .so's required. That's what "-static" is for. However, I since found out that it's not doable on fedora since .a's are missing from half the packages including glibc (libnss is not there).
Comment 3 Denis Leroy 2008-05-13 12:55:43 EDT
Fedora intentionally doesn't ship static libraries, with very few (unusual) exceptions. The whole point of yum-based distros is that installing dependencies is done automatically... Having said this, it's not hard to modify the libxml++ spec file to also include static libraries: just remove the --disable-static configure option and add the *.a file in package %files section.