glue for libraries?
agesen at CS.stanford.edu
Wed Dec 2 21:42:32 UTC 1992
Rob Reiss asks:
> Is is possible to create glue for just a couple functions that are
> part of a larger pre-compiled standard library.
Yes - I've done this quite successfully for large bits of Xlib with
the standard release Self compiler.
> But when I try to call the function in Self the functions bomb because
> they are not linked to the libcps.so file. Can I link the libcps.so
> file into this one somehow?
The trick is to _statically_ link the library into the .o file while
making the .so file. Given your SmallFile.o
ld -o SmallFile.so SmallFile.o -Bstatic -lcps
Yes, this should be the safest bet. However, under SunOs 4.1.2 the Bstatic
should not be needed since the 4.1.2 version of ld.so has been extended
to do "transitive closure" of dynamic libraries. You'll still need the -lcps,
just not the -Bstatic.
No guarantees, though....
This worked for me under SunOS and gcc - of course, your mileage may
vary. (At least we don't need sed on the assembler any more :-)
James Noble, Graduate Student, Computer Science Department
Victoria University, Box 600, Wellington 1, New Zealand
kjx at comp.vuw.ac.nz
More information about the Self-interest