[plug] building static binaries

James Devenish devenish at guild.uwa.edu.au
Mon Dec 29 16:23:05 WST 2003


In message <3FEFE19B.1090805 at postnewspapers.com.au>
on Mon, Dec 29, 2003 at 04:11:07PM +0800, Craig Ringer wrote:
> >0=[15:57:34]luke at lukenew:~/src/etherape-0.9.0$ nm -s
> >/usr/lib/libresolv.a  |grep res_mkquery
> >__res_mkquery in res_data.o
> >__res_nmkquery in res_mkquery.o
> >000000a0 T __res_mkquery
> >res_mkquery.o:
> 
> Actually... isn't __res_mkquery a different symbol to res_mkquery? I 
> have vague memories about __ being used to indicate a private symbol or 
> something like that. It may be obvious that I'm no C programmer.

You are not exactly incorrect, but the situation is thus:
% fgrep res_mkquery `locate resolv.h`
#define res_mkquery             __res_mkquery
int res_mkquery __P((int, const char *, int, int, const u_char *,

So, __res_mkquery happens to be correct in this case. But the
./configure test doesn't use the prototype from the resolv.h header,
it uses its own prototype.

> James Devenish wrote:
> > Hehe...I see that ./configure uses one-liner compilation/linking, so
> > I'm not sure how you can work
> > around this, other than to ./configure without -static and then insert
> > -static into the Makefiles or Makedefs files.
> 
> I've done something similar before, ugly though it is. Generally I just 
> do a dynamic build, note what `ld` command it uses to link the final 
> binary, and rerun it with '-static' . It seems to work, but ... *ick* .

Hehe. "I compiled software that used libtool and all I got was this
lousy headache".





More information about the plug mailing list