From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 12789 invoked from network); 2 Jul 2000 02:08:06 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Jul 2000 02:08:06 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id WAA09470 for ; Sat, 1 Jul 2000 22:08:05 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.9.3/8.9.3) id UAA03812 for axp-list@redhat.com; Sat, 1 Jul 2000 20:08:02 -0600 From: Michal Jaegermann Message-Id: <200007020208.UAA03812@ellpspace.math.ualberta.ca> Subject: SOLVED (sort of): Problems when compiling -static To: axp-list@redhat.com Date: Sat, 1 Jul 2000 20:08:02 -0600 (MDT) X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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