* Help with problem with *libc_r.a*
@ 1993-10-01 14:38 Marty J. Sirkin
1993-10-04 17:01 ` Steve Huston
1993-10-07 17:08 ` Jeff Carter
0 siblings, 2 replies; 3+ messages in thread
From: Marty J. Sirkin @ 1993-10-01 14:38 UTC (permalink / raw)
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.
Does anyone out there have an idea? I'd appreciate any suggestions either
via E-mail or posting.
Thanks in advance,
Marty Sirkin
Disclaimer: I work for IBM, and sure wish they'd let me speak for them...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with problem with *libc_r.a*
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
1 sibling, 0 replies; 3+ messages in thread
From: Steve Huston @ 1993-10-04 17:01 UTC (permalink / raw)
Well, I'm no threads expert, but I do have threaded stuff working, so
I can relate the trouble I had.
- Did you #include <pthread.h> in each module, before including other
files that reference std library things?
- Did you link with -lpthread -lc_r -lmach ?
--
Steve Huston CompuCraft
CompuServe: 72133,2372 61 Nadeau Drive
Internet: 72133.2372@CompuServe.COM Wrentham, MA 02093-1618
huston@icecub.ako.dec.com (508) 384-5770
Currently on contract to Digital Equipment Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with problem with *libc_r.a*
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
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Carter @ 1993-10-07 17:08 UTC (permalink / raw)
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).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1993-10-07 17:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox