[comp.sys.apollo] Installable libraries for X runtime

oj@apollo.HP.COM (Ellis Oliver Jones) (12/06/89)

In article <178@sdipl.oz> andrews@sdipl.sdi.oz.au (Andrew Schonberger) writes:
>In article <4671c36f.20b6d@apollo.HP.COM> dawson@apollo.HP.COM (Keith Dawson) 
>writes:
>    >At SR10.2, Domain/X11 (the "share-mode" server) v1.2 will be bundled
>    >with base software. This is an R3 server in all the ways that matter.
>    >All supplied clients are the R3 versions, as are all the libraries
>    >(libXt, libX11, libXaw, ...). 
>
>Did anyone think about making these libraries 'installed' ones?
Yes, at SR10.2 you will find these files on your node, for the
XV11R3 Xlib, XV11R3 Xt intrinsics, and XV11R3 X Athena Widgets:
   /lib/x11lib
   /lib/xtlib
   /lib/xawlib

If you purchase OSF/Motif for Domain/OS (NOT bundled with
SR10.2), you'll also get these for the Motif widgets and OSF 
version of the Intrinsics (trivia question:  how many distinct
binary-incompatible versions of the Xt Intrinsics exist?):
   /lib/xmlib1.0  
   /lib/xtlib1.0

/usr/lib/libX11.a is a stub, so everybody gets to use /lib/x11lib.
In other words, calls like XOpenDisplay and XDrawLines are available
to all Domain/OS programs (but don't get paged in unless needed).

If you want to use the installable libraries for XV11R3 Xt it's best
to include the following option when you issue a "cc" command for C compilation:

   cc  -W0,-inlib,/lib/xtlib

This informs the compiler that you want it to refer to the named
installable library.  The "inlib" instruction gets placed in the
COFF file emitted by the compiler, and then the loader "ld" uses it to
resolve symbols.  Finally, when you run the program, the library
gets installed for you.  All programs running Xt on the same
node wind up sharing the same xtlib pages in memory.

Notice that "ld" lets you specify the inlib as well,
using "-A inlib,/lib/xtlib" , but it's better to let the compiler know
because the compiler can tell the difference between programs and data,
whereas the loader can't.  Beware: saying "-A inlib,/lib/xtlib" in
the CC command passes it to the loader; you have to use the -W0 form.

If you want to use the installable libraries for XV11R3 xaw,
include the following option when you call for C compilation:

   cc  -W0,-inlib,/lib/xawlib

The same goes for our Domain/OS OSF/Motif kit, except you say
   -W0,-inlib,/lib/xmlib1.0 
to get the OSF/Motif widgets and the OSF version of Xt intrinsics.

xawlib itself knows to use xtlib, and xmlib1.0 knows to use xtlib1.0 .

If you want to know, for a given object or executable, what libraries
it requires to run, say

   /usr/apollo/bin/coffdump -Ai filename

The clients we shipped with SR10.2 were compiled and loaded with
shareable libraries where possible.   For example:

        % coffdump -Ai /usr/X11/bin/xterm /lib/xawlib /lib/xtlib 
        
        			***INLIB INFORMATION***
        	    Res1     Res2     Res3   Offset Name
        /usr/X11/bin/xterm:
        	       0        0        0      236 /lib/xtlib
        	       0        0        0      247 /lib/xawlib
        /lib/xawlib:
        	       0        0        0     2308 /lib/xtlib
        /lib/xtlib:

        
>I thought about doing it myself, but there are some signs suggesting it's 
>not a trivial task.
It's not totally impossible either;  remember there are
  (1) "inlib"able libraries, like /lib/xawlib and /lib/xtlib
  (2) automatically inlib'ed libraries, like /lib/x11lib .
  (3) global libraries, like /lib/syslib.881 and /lib/gprlib .

The global libraries are the hard ones, because the loading of statically initialized
data is very strange (not to say almost impossible.)

>I'd rather like to have this done by Apollo, just as
>they did with the C library. 
Righto!  Get SR10.2!

/Ollie Jones (speaking for myself, not necessarily for HP Apollo Systems Division)