CMUCL is able to load foreign object files at runtime, using the
load-foreign. This function is able to load shared
libraries (that are typically named .so) via the dlopen
mechanism. It can also load .a or .o object files by
calling the linker on the files and libraries to create a loadable
object file. Once loaded, the external symbols that define routines
and variables are made available for future external references (e.g.
load-foreign must be run before any of
the defined symbols are referenced.
Note that if a Lisp core image is saved (using
loaded foreign code is lost when the image is restarted.
files is a
simple-string or list of
simple-strings specifying the names of the object files. If
files is a simple-string, the file that it designates is
loaded using the platform’s dlopen mechanism. If it is a list of
strings, the platform linker
ld is invoked to transform the
object files into a loadable object file. libraries is a list
simple-strings specifying libraries in a format that the
platform 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
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.