From: jeffc@soba.osf.org (Jeff Carter)
Subject: Re: Help with problem with *libc_r.a*
Date: 7 Oct 1993 17:08:43 GMT [thread overview]
Message-ID: <291ier$g9v@paperboy.osf.org> (raw)
In-Reply-To: 28hfdj$1a3@ahhnold.cs.utexas.edu
In article <28hfdj$1a3@ahhnold.cs.utexas.edu>, marty@cs.utexas.edu (Marty J. Sirkin) writes:
> I have a problem and am hoping that someone out there has an answer.
>
> I have an application which compiles, links and, runs with the standard
> libraries (including libc.a). The application can be either single or
> multi-threaded. When I run it with 2 threads (with libc.a) it quite
> reasonably fails at random locations.
>
> I then tried to link the program with the libc_r.a that comes with our
> OSF/1 distribution. I ran into quite a few unresolved externals (including
> memcpy and memset). Using "ar" to look at the libraries, I noticed that
> a number of functions (including the two above) are present in libc.a, but
> are missing in libc_r.a
>
> I suspect that either: 1) I have a bad copy of libc_r.a 2) There is another
> library out there with the thread-reentrant versions of the missing functions
> (although I doubt this - why would they break up libc.a?) or 3) There's a
> trick to this that I am missing.
libc_r.a is an "overlay" for libc.a: it contains only those functions that
have to change to be made thread safe. (The system call stub/errno problem
is handled rather "specially", so you don't actually end up with duplicate
syscall stubs).
The way that libpthreads.a and libc_r.a work to implement the reentrant
functions depends on replacing functions in libc that are called from other
functions within libc. (This is referred to as "hookable globals"). In order
for this to work, ROSE shared libraries cannot be used (libc.so), so the
program must be linked without shared libraries (-lnoshrlib or -lpic-none
depending on the compiler version).
prev parent reply other threads:[~1993-10-07 17:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-10-01 14:38 Help with problem with *libc_r.a* Marty J. Sirkin
1993-10-04 17:01 ` Steve Huston
1993-10-07 17:08 ` Jeff Carter [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox