next up previous contents
Next: 8.7 Alien Function Calls Up: 8 Alien Objects Previous: 8.5 Alien Data Structure

8.6 Loading Unix Object Files

Foreign object files are loaded into the running Lisp process by load-foreign. First, it runs the linker on the files and libraries, creating an absolute Unix object file. This object file is then loaded into into the currently running Lisp. The external symbols defining routines and variables are made available for future external references (e.g. by extern-alien.) load-foreign must be run before any of the defined symbols are referenced.

Note that if a Lisp core image is saved (using  save-lisp (page gif)), all loaded foreign code is lost when the image is restarted.

[Function]
alien: load-foreign files &key :libraries :base-file :env

files is a simple-string or list of simple-strings specifying the names of the object files. libraries is a list of simple-strings specifying libraries in a format that ld, the Unix linker, expects. The default value for libraries is ("-lc") (i.e., the standard C library). base-file is the file to use for the initial symbol table information. The default is the Lisp start up code: `path:lisp'. env should be a list of simple strings in the format of Unix environment variables (i.e., A=B, where A is an environment variable and B is its value). The default value for env is the environment information available at the time Lisp was invoked. Unless you are certain that you want to change this, you should just use the default.



Raymond Toy
Mon Jul 14 09:11:27 EDT 1997