Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
21827b0a
Commit
21827b0a
authored
33 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Changed LOAD-FOREIGN to be exported from ALIEN. Changed it have keyword args
instead of optionals. Deleted obsolete linker argument.
parent
d6a0826f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/foreign.lisp
+18
-22
18 additions, 22 deletions
code/foreign.lisp
with
18 additions
and
22 deletions
code/foreign.lisp
+
18
−
22
View file @
21827b0a
...
...
@@ -7,16 +7,16 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/foreign.lisp,v 1.1
0
1992/03/0
2 02:27:23 wlott
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/foreign.lisp,v 1.1
1
1992/03/0
4 18:15:41 ram
Exp $"
)
;;;
;;; **********************************************************************
;;;
(
in-package
"SYSTEM"
)
(
in-package
"
EXT
"
)
(
in-package
"
ALIEN
"
)
(
export
'
(
load-foreign
))
(
in-package
"SYSTEM"
)
(
import
'
ext
:load-foreign
)
(
import
'
alien
:load-foreign
)
(
defvar
*previous-linked-object-file*
nil
)
(
defvar
*foreign-segment-free-pointer*
foreign-segment-start
)
...
...
@@ -164,30 +164,26 @@
(
setf
(
gethash
symbol
symbol-table
)
address
)))))
(
setf
lisp::*foreign-symbols*
symbol-table
)))
(
defun
load-foreign
(
files
&
optional
(
defun
load-foreign
(
files
&
key
(
libraries
'
(
"-lc"
))
(
linker
"library:load-foreign.csh"
)
(
base-file
"path:lisp"
)
(
env
ext:*environment-list*
))
"Load-foreign loads a list of C object files into a running Lisp. The
files argument should be a single file or a list of files. The files
may be specified as namestrings or as pathnames. The libraries
argument should be a list of library files as would be specified to
ld. They will be searched in the order given. The default is just
\"-lc\", i.e., the C library. The linker argument is used to specifier
the Unix linker to use to link the object files (the default is
/usr/cs/bin/ld). The base-file argument is used to specify a file to
use as the starting place for defined symbols. The default is the C
start up code for Lisp. The env argument is the Unix environment
variable definitions for the invocation of the linker. The default is
the environment passed to Lisp."
"Load-foreign loads a list of C object files into a running Lisp. The files
argument should be a single file or a list of files. The files may be
specified as namestrings or as pathnames. The libraries argument should be a
list of library files as would be specified to ld. They will be searched in
the order given. The default is just \"-lc\", i.e., the C library. The
base-file argument is used to specify a file to use as the starting place for
defined symbols. The default is the C start up code for Lisp. The env
argument is the Unix environment variable definitions for the invocation of
the linker. The default is the environment passed to Lisp."
(
let
((
output-file
(
pick-temporary-file-name
))
(
symbol-table-file
(
pick-temporary-file-name
))
(
error-output
(
make-string-output-stream
)))
(
format
t
";;; Running
~A.
..~%"
linker
)
(
format
t
";;; Running
library:load-foreign.csh
..
.
~%"
)
(
force-output
)
(
let
((
proc
(
ext:run-program
li
nker
(
let
((
proc
(
ext:run-program
"
li
brary:load-foreign.csh"
(
list*
(
or
*previous-linked-object-file*
(
namestring
(
truename
base-file
)))
(
format
nil
"~X"
...
...
@@ -203,11 +199,11 @@
:output
error-output
:error
:output
)))
(
unless
proc
(
error
"Could not run
~S"
linker
))
(
error
"Could not run
library:load-foreign.csh"
))
(
unless
(
zerop
(
ext:process-exit-code
proc
))
(
system:serve-all-events
0
)
(
error
"
~S
failed:~%~A"
linker
(
get-output-stream-string
error-output
)))
(
error
"
library:load-foreign.csh
failed:~%~A"
(
get-output-stream-string
error-output
)))
(
load-object-file
output-file
)
(
parse-symbol-table
symbol-table-file
)
(
unix:unix-unlink
symbol-table-file
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment