[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glue for libraries?



	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

	James Noble, Graduate Student, Computer Science Department
	Victoria University, Box 600, Wellington 1, New Zealand
	kjx@comp.vuw.ac.nz

Ole