[comp.unix.wizards] SVr3 shared lib followup

dave@micropen (David F. Carlson) (01/06/88)

I posted a message to unix.questions, unix.wizards, comp.unix.xenix on how to
make shared libraries for SVr3.  I got zero.zero reponses except my UNIX
vendor Microport.  At least someone cares! :-)

To recap: Trouble with shared libs given some of the quirky things: 

The system call stat(2) requires a structure stat that /lib/cpp makes a mess
of because the idea of the shared libary is to resolve external function calls
like stat(2) at run time to a private pre-allocated placeholder.  In this case
the structure stat was also being (erroneously) made into the placeholder for
stat(2).  Stdio fopen(3) is of type FILE * but FILE * is defined in stdio.h in 
which _iob[] needs to be replaced in order to make the shared library work.  
This results in a /lib/cpp chicken or the egg problem.

At long last, what is probably the correct answer to this dilemma:  ATT messed
up.  In fact, unless awful non-portable assumptions are made with regard to
stdio.h (FILE *) the stdio cases just don't resolve.  The stat(2) case has
a workaround (provided to me by the usually excellent Microport tech support
channels (namely Dean)) that requires lots of changes to source code and an
extra level of indirection in the function calls to stat(2).  That is, make
a private version of stat(2) in a non-shared library routine that would actually
call stat(2), thus the preprocessor wouldn't munge things.  I don't like it
but it would work.  The stdio/FILE * problem is pretty tough and I am still
unable to find a resolution.  Anyone else out there care to suggest a solution
or even know what the issues are?  (Did AT&T blow shared libraries in SVr3?)


-- 
David F. Carlson, Micropen, Inc.
...!{ames|harvard|rutgers|topaz|...}!rochester!ur-valhalla!micropen!dave

"The faster I go, the behinder I get." --Lewis Carroll