* SOLVED (sort of): Problems when compiling -static
@ 2000-07-02 2:08 Michal Jaegermann
2000-07-02 16:30 ` Greg Lindahl
0 siblings, 1 reply; 3+ messages in thread
From: Michal Jaegermann @ 2000-07-02 2:08 UTC (permalink / raw)
To: axp-list
I was asking few days ago if somebody knows something about a problem
with libraries from RH 6.2 when a program linked dynamic behaves like
it should but linked static fails because 'getpwuid()' always returns
null.
The problem is real, all right, but you are not very likely to run
into it. :-) After digging deeply through sources of glibc and
prolonged debuggin sessions I found that a function
'do_lookup_versioned()' from dl-lookup.c was failing for some dynamic
loader symbol. A reason for that turn out to be that from some old
forgotten experiments I had a subdirectory /lib/old/ with a copy of an
old version of ld-linux.so.2 in it. I do not understand a mechanism
and why this copy was used in the first place (my /etc/ld.so.conf is
sane) but removing /lib/old made both versions of my test program to
behave.
To add to the confusion even if a program is compiled statically, and
'file' and 'ldd' say about exectutables "statically linked" and "not a
dynamic executable", turns out that libnss* libraries are still
dynamically loaded (different things may be consulted depending on what
you have in /etc/nsswitch.conf). Also nothing bad was happening before
an update, even if /lib/old/ was there all the time, and with a
dynamically linked version. Big sigh!
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: SOLVED (sort of): Problems when compiling -static
2000-07-02 2:08 SOLVED (sort of): Problems when compiling -static Michal Jaegermann
@ 2000-07-02 16:30 ` Greg Lindahl
2000-07-03 14:48 ` Maciej W. Rozycki
0 siblings, 1 reply; 3+ messages in thread
From: Greg Lindahl @ 2000-07-02 16:30 UTC (permalink / raw)
To: axp-list
> To add to the confusion even if a program is compiled statically, and
> 'file' and 'ldd' say about exectutables "statically linked" and "not a
> dynamic executable", turns out that libnss* libraries are still
> dynamically loaded
That's pretty evil. glibc calls dlopen() directly? I guess it's no surprise
that "file" and "ldd" don't know that dlopen() gets called...
-- g
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: SOLVED (sort of): Problems when compiling -static
2000-07-02 16:30 ` Greg Lindahl
@ 2000-07-03 14:48 ` Maciej W. Rozycki
0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2000-07-03 14:48 UTC (permalink / raw)
To: Greg Lindahl; +Cc: axp-list
On Sun, 2 Jul 2000, Greg Lindahl wrote:
> That's pretty evil. glibc calls dlopen() directly? I guess it's no surprise
> that "file" and "ldd" don't know that dlopen() gets called...
You may configure glibc so that there are also static libnss_* modules.
But then you can no longer choose services via nsswitch.conf for
statically linked binaries and also you must link all of them with
"-lnss_files -lnss_dns -lresolv" explicitly which is sort of annoying.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-07-03 14:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-02 2:08 SOLVED (sort of): Problems when compiling -static Michal Jaegermann
2000-07-02 16:30 ` Greg Lindahl
2000-07-03 14:48 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox