List Info

Thread: Static compiling




Static compiling
user name
2006-09-30 00:39:12
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:

configure:20640: gcc -o conftest -g -O2
-I/home/pierre-luc/staticxml2//include/libxml2  -static
conftest.c -L/
home/pierre-luc/staticxml2//lib -lxml2 -lz -lm  >&5
/home/pierre-luc/staticxml2//lib/libxml2.a(nanohttp.o)(.text
+0xc1b):
In function `xmlNanoHTTPConnectHost':
/home/pierre-luc/Desktop/libxml2-2.6.26/nanohttp.c:1004:
warning:
Using 'getaddrinfo' in statically linked app
lications requires at runtime the shared libraries from the
glibc
version used for linking
/home/pierre-luc/staticxml2//lib/libxml2.a(nanohttp.o)(.text
+0xce5):/home/pierre-luc/Desktop/libxml2-2.6.26/na
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
same as with the normal system library. I did the same on 3
different
computers without much more success (two of them running
Slackware and
the other under Ubuntu).

Would this be related the way ices2 implements libtool ?
Should I recompile libxml2 in another way ?

-- 
Pierre-Luc Bacon
www.aqra.ca
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
Static compiling
user name
2006-09-30 08:50:53
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.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
Static compiling
user name
2006-09-30 08:58:17
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.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
Static compiling
user name
2006-09-30 13:52:06
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 <veillardredhat.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.
>
> Daniel
>
> --
> Red Hat Virtualization group http://redhat.com/v
irtualization/
> Daniel Veillard      | virtualization library  http://libvirt.org/
> veillardredhat.com  | libxml GNOME XML XSLT
toolkit  http://xmlsoft.org/
> http://veillard.com/
| Rpmfind RPM search engine  http://rpmfind.net/
>


-- 
Pierre-Luc Bacon
www.aqra.ca
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )