MAINSAIL System-Specific User's Guides, Appendix D

previous   next   top   contents   index   framed top   this page unframed


D. Putting CONF and FLI Compiler Output into a Shared Library

It is possible to put the .s files output by CONF and by the FLI compilers into a shared library only on SOLRS. XIDAK has not found it possible to do so on other platforms. It is possible that the instructions for SOLRS also work on PSOLRS, but XIDAK has not tested this.

Example D–1 shows examples of dynamically linked CONF and FLI output linked with (static) bootstrap files on the MAINSAIL directory. The example assumes that you have a file of C routines, foo.c, that you wish to call through an FLI MODULE, foofli.s, that has been produced by the MAINSAIL FLI compiler. It assumes that the main routine is located in a file foom.c that calls into MAINSAIL through an FLI MODULE, fcallfoo.s, produced by the entry FLI compiler. It also assumes that you have run CONF to create a bootstrap file myboot.s that specifies FOOFLI as a foreign MODULE and specifies that foreign code starts execution. The environment variable $M is assumed to point to the MAINSAIL directory.

Example D–1. Commands to Put CONF and FLI Output into a Shared Library on SOLRS
/opt/SUNWspro/bin/cc -K PIC -c foo.c<eol>
as -P -o myboot.o myboot.s<eol>
as -P -o foofli.o foofli.s<eol>
as -P -o fcallfoo.o fcallfoo.s<eol>
/
opt/SUNWspro/bin/cc -G -o libfooshared.so foo.o myboot.o foofli.o fcallfoo.o<eol>
/
opt/SUNWspro/bin/cc -o myboot foom.c $M/f.o -lsocket -lnsl -L. -R. -lfooshared<eol>


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL System-Specific User's Guides, Appendix D