Bug 445750 - can't statically link programs that use libxml++
Summary: can't statically link programs that use libxml++
Alias: None
Product: Fedora
Classification: Fedora
Component: libxml++
Version: 8
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Konstantin Ryabitsev
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-05-08 20:45 UTC by Dimitri Maziuk
Modified: 2008-05-13 16:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-05-13 09:36:23 UTC
Type: ---

Attachments (Terms of Use)

Description Dimitri Maziuk 2008-05-08 20:45:09 UTC
Description of problem:
libxml++.a missing from -devel rpm

Version-Release number of selected component (if applicable):

How reproducible:

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 09:36:23 UTC
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 14:21:33 UTC
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 16:55:43 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.