bug-glibc
[Top][All Lists]
Advanced

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

Re: (no subject)


From: Andreas Jaeger
Subject: Re: (no subject)
Date: Wed, 10 Apr 2002 17:40:39 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux)

"Reetesh Ranjan" <address@hidden> writes:

>
>>Description:
>       I am using MIT kerberos version 1.2.2 libraries (not the default RPMs
>       and all kerberos RPMs are removed before we proceed). It can be con-
>       figured for producing and linking with either static libraries or dy-
>       namic libraries. When static libraries are produced and programs are
>       linked with it, running these programs works fine. But when we create
>       dynamic libraries and link with them, at run-time we get an error of
>       'error in loading shared libraries : <path of a library we built>: un-
>       defined symbol : stat', for the same programs.
>
>       I also tried to check for the symbol 'stat' in the different versions
>       of the libraries and the programs. For both static and dynamic libra-
>       ries, the symbol stat is shown as 'U stat' (output of nm). Also, for
>       the same program linked with either the static or dynamic libraries,
>       ouput of nm on the program shows 'U stat'. However, for the case of the
>       program linked with static libraries we do not get any loading problem.
>       Strange though, it works like that!
>
>       We also tried to dig in the stat.h file and libc. /lib/libc.so.6 does
>       not seem to have the symbol 'stat'. /usr/lib/libc.a has it as 'W stat'
>       in the file stat.o in the archive.
>
>       I also tried to see the gcc -E output of a kerberos .c with all other
>       compile options/flags as used by kerberos build. This .c is including
>       sys/stat.h. The gcc -E output shows an 'extern __inline__ int stat'
>       prototype and an 'extern __inline__ int stat' definition for stat. I
>       tried the gcc -E output for a test file with no flags which kerberos
>       build uses, rather with no flags/options absolutely and got the same
>       result. Then I called 'stat' in my test .c and build an executable.
>       The nm output on this executable again shows 'U stat'; however, it runs
>       perfectly.

Read the glibc FAQ, it mentions stat:

2.7.    Looking through the shared libc file I haven't found the
        functions `stat', `lstat', `fstat', and `mknod' and while
        linking on my Linux system I get error messages.  How is
        this supposed to work?

{RM} Believe it or not, stat and lstat (and fstat, and mknod) are supposed
to be undefined references in libc.so.6!  Your problem is probably a missing
or incorrect /usr/lib/libc.so file; note that this is a small text file now,
not a symlink to libc.so.6.  It should look something like this:

GROUP ( libc.so.6 libc_nonshared.a )


Andreas
-- 
 Andreas Jaeger
  SuSE Labs address@hidden
   private address@hidden
    http://www.suse.de/~aj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]