Static linking of posix thread apps on Solaris 7

Static linking of posix thread apps on Solaris 7

Post by Marti » Thu, 01 Mar 2001 16:33:42



Quote:> >How do I statically link an app using Posix-threads?
> >Am aware of the -static flag but I guess I need
> >a libpthread.a file to link with, (not the libpthread.so.1).

> You can't.
> >The reason I need to do this is because I experience
> >certain problems when I copy the binary directly to
> >another Solaris.

> Static linking is not supported.

Intriguing... How come?
 
 
 

Static linking of posix thread apps on Solaris 7

Post by Alan Coopersmit » Thu, 01 Mar 2001 16:43:51



|The reason I need to do this is because I experience
|certain problems when I copy the binary directly to
|another Solaris.

Static linking increases the odds of having problems when moving between
systems.

--
________________________________________________________________________


  Working for, but definitely not speaking for, Sun Microsystems, Inc.

 
 
 

Static linking of posix thread apps on Solaris 7

Post by Casper H.S. Dik - Network Security Engine » Thu, 01 Mar 2001 17:27:31


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>Intriguing... How come?

The main reason to no longer support static linking is the freedom
is gives us in changing the underlyign implementation.

There are published interfaces exported by libraries.  These use a variety
of public and private interfaces from other libraries and the kernel.

If we allow static linking, we can never change some parts of the
implementation even when we need to.

The thread library is also a very complicated beast; link it
statically and you may end up having bugs that you need to patch
with a libthread patch  *and* a recompile.  And the latter is impossible
for 3rd party binary products.

So in order to be able to guaramtee binary compatibility, we don't
guarantee it for statically linked programs.  But since ISVs have turned
out to be rather bone-headed at times, we simply no longer ship static
libraris for anything added after 2.4 or so, including all the 64 bit
libraries.

(The static socket library is an example of problems caused for ISVs
their programs wouldn't run in 2.6)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. Differences between Solaris threads and POSIX threads

Can anyone give me a list of the differences and/or a pointer to a document,
that describes the differences between Solaris threads and POSIX threads -
beyond that which is in the man page (man threads) ?

The one difference of which I am aware is that if a multi-threaded app
fork()s, in Pthreads, only the calling thread is duplicated, while in
Solaris threads, the whole thing is duplicated (which, incidentally, the
semantics of fork, if interpreted literally, requires).

2. Shell for exceuting HTTP/SMTP commands at windows command line

3. Difference between Posix Threads and Solaris threads

4. Good PS?

5. POSIX threads, thread-specific data: what about the "main" thread?

6. Project Management

7. static linked socket app won't run on 2.6

8. Sound card Ensoniq & PPP connection

9. Can't static link Motif app...

10. does linux JDK 1.1.x use posix threads (pthreads) or green threads?

11. Linking multi-threaded app for single- and multi-processor

12. Linux posix threads and X11R6's thread interface

13. LINUX POSIX threads - running 1500+ threads