1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>Loading Unix Object Files</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.4" /><link rel="home" href="index.html" title="SBCL User Manual" /><link rel="up" href="ffi.html" title="Chapter5.The Foreign Function Interface" /><link rel="previous" href="foreign-data-structure.html" title="Foreign Data Structure Examples" /><link rel="next" href="foreign-function-calls.html" title="Foreign Function Calls" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Loading Unix Object Files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="foreign-data-structure.html">Prev</a></td><th width="60%" align="center">Chapter5.The Foreign Function Interface</th><td width="20%" align="right"><a accesskey="n" href="foreign-function-calls.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="load-object"></a>Loading Unix Object Files</h2></div></div><div></div></div><p>
Foreign object files can be loaded into the running Lisp process by
calling the functions <tt class="function">load-foreign</tt> or
<tt class="function">load-1-foreign</tt>.
</p><p> The <tt class="function">sb-alien:load-1-foreign</tt> function is the more
primitive of the two operations. It loads a single object file. into
the currently running Lisp. The external symbols defining routines and
variables are made available for future external references (e.g. by
<tt class="function">extern-alien</tt>). Forward references to foreign symbols
aren't supported: <tt class="function">load-1-foreign</tt> must be run before any
of the defined symbols are referenced.
</p><p><tt class="function">sb-alien:load-foreign</tt> is built in terms of
<tt class="function">load-1-foreign</tt> and some other machinery
like <tt class="function">sb-ext:run-program</tt>.
It accepts a list of files and libraries,
and runs the linker on the files and
libraries, creating an absolute Unix object file which is then
processed by <tt class="function">load-1-foreign</tt>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>As of <span class="application">SBCL</span> 0.7.5, all foreign code (code loaded
with <tt class="function">load-1-function</tt> or <tt class="function">load-function</tt>) is
lost when a Lisp core is saved with
<tt class="function">sb-ext:save-lisp-and-die</tt>, and no attempt is made to
restore it when the core is loaded. Historically this has been an
annoyance both for <span class="application">SBCL</span> users and for <span class="application">CMU CL</span> users.
It's hard to solve this problem completely cleanly, but some
generally-reliable partial solution might be useful. Once someone in
either camp gets sufficiently annoyed to create it, <span class="application">SBCL</span> is
likely to adopt some mechanism for automatically restoring foreign
code when a saved core is loaded.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="foreign-data-structure.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="ffi.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="foreign-function-calls.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Foreign Data Structure Examples</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Foreign Function Calls</td></tr></table></div></body></html>
|