|
Bela Lubkin, in the newsgroup, wrote:
The OpenServer 5.0.4 development system adds a few function calls which
were absent in 5.0.0 and 5.0.2. Most of these were actually intended to
be in 5.0.0, but weren't ready in time. Kernel support for all of them
is already present in 5.0.0, so programs compiled in 5.0.4 would work on
5.0.0, except that there are potential shared library issues.
Of the new functions in 5.0.4, only four of them represent new entry
points in the shared libraries. These are fattach(), fdetach(),
makecontext(), and mkstemp(). As long as you don't call any of those, I
can think of no reason that your programs compiled on 5.0.4 would not
work on 5.0.0/5.0.2.
If you *do* call any of those functions, your programs will only work if
you avoid calling the dynamic shared object versions of the functions.
There are three ways to do so:
1. Compile COFF binaries (the default compilation mode). Advantages:
if you stick to the right subset of system calls, COFF binaries
will work on SCO Unix 3.2v4.2 and earlier; also, statically links
in functions which will work on 5.0.0/5.0.2 kernels, but which are
not in the shared objects on those systems. Disadvantage: binaries
much larger.
2. Compile static ELF binaries (`cc -belf -dn`). Advantage:
statically links in functions which will work on 5.0.0/5.0.2
kernels, but which are not in the shared objects on those systems.
Disadvantage: binaries much larger.
3. Compile dynamic ELF binaries (`cc -belf`), but statically link in
those functions. Technique:
$ mkdir /tmp/newlib
$ cd /tmp/newlib
$ ar xv /usr/lib/libc.a fattach.o fdetach.o makectxt.o mktemp.o
$ ar rv libstatic-stuff.a *.o
$ mv libstatic-stuff.a /local/lib
...
$ cc -belf foo.o bar.o -L/local/lib -lstatic-stuff -o foo
Advantage: preserves binary size advantage (and cross-OS-
compatibility) of dynamic ELF, while avoiding symbols that won't
resolve on 5.0.0/5.0.2. Disadvantage: more effort.
>Bela<
robertlipe@usa.net |