Re: [xml] Static compiling

In the case I'm concerned about, dynamic linking shouldn't be used
since it's for an embedded system with a little memory available.
Since the app isn't too big, it's propably the best thing to do.

So from what you say, I can understand that the error comes from the
way the "configure" script works.

Basically, what I do is:
LDFLAGS=-static ./configure

and then, it stops at:
checking for XML configuration
checking for xml2-config... /usr/bin/xml2-config
checking for xmlParseFile... no
configure: error: Unable to link with libxml

2006/9/30, Daniel Veillard <veillard redhat com>:
On Sat, Sep 30, 2006 at 04:50:53AM -0400, Daniel Veillard wrote:
> On Fri, Sep 29, 2006 at 08:39:12PM -0400, Pierre-Luc Bacon wrote:
> > I can't get a program (ices2) that uses libxml2 to compile statically
> > with this library. It fails in "./configure" process exposing this in
> > config.log:
> >
> [...]
> > nohttp.c:1050: warning: Using 'gethostbyname' in statically linked
> > applications requires at runtime the shared
> >  libraries from the glibc version used for linking
> >
> > I tried building libxml2 with --disable-shared and it was doing the
>   No idea, I always compile statically in my devel tree and never saw this
> when linking xmllint statically for example. Check with your OS/distro
> they must know about it.

  If the application tries to link statically all the stack including
the libc, then it can be a problem, and I guess it's what is being raised in
the warning. The fact that libxml2 uses the resolver trigger this, but
fundamentally compiling the whole application static is asking for troubles
especially for a large app.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

Pierre-Luc Bacon

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]