ViewVC logotype

Log of /src/code/foreign.lisp

Parent Directory Parent Directory | Revision Log Revision Log

Links to HEAD: (view) (annotate)
Links to sparc_gencgc_merge: (view) (annotate)
Sticky Tag:

Revision 1.44 - (view) (annotate) - [select for diffs]
Mon May 26 14:16:58 2003 UTC (10 years, 10 months ago) by gerd
Branch: MAIN
CVS Tags: dynamic-extent-base, lisp-executable-base, mod-arith-base, snapshot-2003-10, snapshot-2003-11, snapshot-2003-12, snapshot-2004-04, sparc_gencgc, sparc_gencgc_merge
Branch point for: dynamic-extent, lisp-executable, mod-arith-branch, sparc_gencgc_branch
Changes since 1.43: +10 -2 lines
Diff to previous 1.43
	* src/code/foreign.lisp (load-object-file): Print more
	informative error messages.  From Lynn Quam, on cmucl-imp.

Revision 1.43 - (view) (annotate) - [select for diffs]
Tue Jan 21 20:55:49 2003 UTC (11 years, 2 months ago) by pw
Branch: MAIN
CVS Tags: cold-pcl-base, release-18e, release-18e-base, release-18e-pre1, release-18e-pre2, remove_negative_zero_not_zero
Branch point for: cold-pcl, release-18e-branch
Changes since 1.42: +2 -2 lines
Diff to previous 1.42
Fix system::alternate-global-address to actually pass the right
argument to dlsym (FreeBSD port). This may be source of some
segfault reports while trying to use foreign functions.

Revision 1.42 - (view) (annotate) - [select for diffs]
Wed Aug 28 07:16:36 2002 UTC (11 years, 7 months ago) by moore
Branch: MAIN
Branch point for: UNICODE-BRANCH
Changes since 1.41: +4 -4 lines
Diff to previous 1.41
Fix foregin object braindamage noted by Pierre Mai.

Revision 1.41 - (view) (annotate) - [select for diffs]
Tue Aug 27 22:18:24 2002 UTC (11 years, 7 months ago) by moore
Branch: MAIN
Changes since 1.40: +37 -7 lines
Diff to previous 1.40
On x86 FreeBSD and Linux, change the way foreign symbol addresses are resolved.
They now go through a table -- effectively a new space in the core file.
Function references are resolved lazily, data references are resolved on startup
and when a .so is loaded.  The end result is that cores can be dumped that
contain references to symbols in shared libraries.  Also, the dependence of the core on addresses in the Lisp runtime is broken.

The linkage table feature is controlled by :linkage-table and LINKAGE_TABLE in C
runtime.  Several foreign symbols are now Lisp static symbols, so a cross
compile is required whether or not the new stuff is used.  I've checked in
boot4-cross-foreign-linkage.lisp that builds the compiler for linkage table; do whatever you usually do for the non-linkage table case:)  Seriously, lets start
a discussion on standardizing "cross compilation," not to mention the general
build procedure.

Revision 1.40 - (view) (annotate) - [select for diffs]
Mon May 6 18:02:04 2002 UTC (11 years, 11 months ago) by pmai
Branch: MAIN
Changes since 1.39: +15 -14 lines
Diff to previous 1.39
Changed the OpenBSD port to use dlopen+ld for FFI linkage, like
current Linux and FreeBSD/ELF do, although OpenBSD is still non-ELF.
Also changed the handling of leading underscores in alien names, by
moving the underscore addition to extern-alien-name, where it belongs,
and not foreign-symbol-address-aux.  This brings the x86 port in line
with the other ports, modulo the PVE_stub_ magic.  The changes
necessitate some bootstrapping code for BSD non-ELF platforms.

Revision 1.39 - (view) (annotate) - [select for diffs]
Fri Mar 15 00:37:32 2002 UTC (12 years, 1 month ago) by moore
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38
Fixed #+ conditional so object file loading for the Elf static FreeBSD case
isn't built on other OSs.

Revision 1.38 - (view) (annotate) - [select for diffs]
Wed Mar 13 08:01:55 2002 UTC (12 years, 1 month ago) by moore
Branch: MAIN
Changes since 1.37: +7 -7 lines
Diff to previous 1.37
Support for dynamic loading in FreeBSD 4.0 and later.  This involves moving
the static space up, so a cross-compile is required to bootstrap these changes.

Revision 1.37 - (view) (annotate) - [select for diffs]
Wed Feb 13 22:30:49 2002 UTC (12 years, 2 months ago) by pmai
Branch: MAIN
Changes since 1.36: +62 -15 lines
Diff to previous 1.36
Made the checking of ELF OS/ABI information compliant with the ELF
specification.  This should fix at least some foreign loading issues
on current FreeBSD.

Revision 1.36 - (view) (annotate) - [select for diffs]
Mon Jan 28 20:17:09 2002 UTC (12 years, 2 months ago) by pmai
Branch: MAIN
Changes since 1.35: +9 -7 lines
Diff to previous 1.35
Added specialised port to NetBSD (1.5.2) on x86.  Since the code-base
was already cleaned up with the OpenBSD port, this doesn't require
massive changes.

Since current NetBSD is ELF-based by default, we don't make use of the
ELF feature, or in other words:  The presence of the NetBSD feature
implies ELF, since there is no support for non-ELF NetBSD.

Revision 1.35 - (view) (annotate) - [select for diffs]
Thu Dec 6 19:15:41 2001 UTC (12 years, 4 months ago) by pmai
Branch: MAIN
Changes since 1.34: +10 -9 lines
Diff to previous 1.34
Added specialised port to OpenBSD (2.9).  Many parts of the original
code which were previously conditionalized on :FreeBSD, are now
conditionalized on :BSD instead, with the :BSD feature now implying a
4.4BSD(lite2) derived OS.  This should make future BSD-ports easier.
FreeBSD and OpenBSD are differentiated by having either :FreeBSD or
:OpenBSD on the features list.

Currently the OpenBSD port does not have working ELF support, because
OpenBSD 2.9 is still non-ELF by default.  So don't put ELF on the
features list when building for OpenBSD, or fix the code to work
correctly in this case instead.

Revision 1.34 - (view) (annotate) - [select for diffs]
Tue Oct 30 22:14:36 2001 UTC (12 years, 5 months ago) by pmai
Branch: MAIN
Changes since 1.33: +8 -1 lines
Diff to previous 1.33
This change causes archives passed as a file argument to load-foreign
to be loaded in-full, which is the only useful behaviour when trying
to link with static libraries.  Currently this change only corrects
the situation for Linux and Solaris, since I don't know the relevant
flags for other platforms, and/or don't have access to machines for

Revision 1.33 - (view) (annotate) - [select for diffs]
Mon May 14 14:22:53 2001 UTC (12 years, 11 months ago) by toy
Branch: MAIN
Changes since 1.32: +19 -10 lines
Diff to previous 1.32
Add :verbose option to load-foreign to honor *load-verbose*.  (From
Stig Erik Sandoe)

Revision 1.32 - (view) (annotate) - [select for diffs]
Fri Jan 5 05:43:47 2001 UTC (13 years, 3 months ago) by dtc
Branch: MAIN
Changes since 1.31: +24 -9 lines
Diff to previous 1.31
o Signal an error if a file given to load-foreign is not found. Suggested
  by Colin Walters.

Revision 1.31 - (view) (annotate) - [select for diffs]
Wed Sep 27 11:10:00 2000 UTC (13 years, 6 months ago) by dtc
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30
The library files given to load-foreign are for input and
unix-namestring needs to try and verify their existence otherwise
search paths will not be enumerated and the files may not be found.

Revision 1.30 - (view) (annotate) - [select for diffs]
Wed Apr 19 11:33:13 2000 UTC (14 years ago) by pw
Branch: MAIN
Changes since 1.29: +151 -4 lines
Diff to previous 1.29
Add support for FreeBSD-ELF systems (FreeBSD version 3.x and 4.x).
Based on a contribution from Fred Gilham. Conditionalized by
#+(and freebsd elf). A new version of library:load-foreign.csh is included
in this code as a comment.

Revision 1.29 - (view) (annotate) - [select for diffs]
Sun Aug 30 04:56:49 1998 UTC (15 years, 7 months ago) by dtc
Branch: MAIN
Changes since 1.28: +5 -5 lines
Diff to previous 1.28
Revise the address map to better utilise the address space, allowing
larger heaps and stacks:

* There is now the potential for up to 2.75GB dynamic space on
FreeBSD, and 1.75GB on linux.  Since GENCGC statically allocates page
tables the default size is set at just 1GB.

* The Read-only and Static spaces have been increased to 256MB
allowing larger heaps to be purified. The Read-only and Static spaces
are in the same locations for both the FreeBSD and Linux ports to
avoid unnecessary binary incompatibility.

* The Control stack and Binking stack now have room for upto 128MB,
supporting deeply nested algorithms, and potentially giving room for
subdivision for thread stacks.

* There is a reserve for the FreeBSD static libraries in the event
that the FreeBSD lisp binary is dynamically linked, and the foreign
segment size for FreeBSD is now 32MB, up from just 4MB.

* There is now significantly more room for C allocated memory, roughly
128M on Linux and 224M on FreeBSD.

Revision 1.28 - (view) (annotate) - [select for diffs]
Fri May 1 01:21:37 1998 UTC (15 years, 11 months ago) by dtc
Branch: MAIN
Changes since 1.27: +14 -6 lines
Diff to previous 1.27
Update for the linux port from Peter VanEynde, adds preliminary
support for glibc2.

Revision 1.27 - (view) (annotate) - [select for diffs]
Sat Nov 15 11:03:27 1997 UTC (16 years, 5 months ago) by dtc
Branch: MAIN
Changes since 1.26: +16 -13 lines
Diff to previous 1.26
Move the definition of *global-table* before its first reference to
avoid a compiler warning.

Revision 1.26 - (view) (annotate) - [select for diffs]
Tue Nov 11 18:51:56 1997 UTC (16 years, 5 months ago) by dtc
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25
Cleanup the handling of foreign symbols on the x86 port.  Have the
FreeBSD port add the "_" prefix at load time rather than compile time
so that both the linux and freebsd binaries are compatible. Define an
x86 specific version of foreign-symbol-address-aux to do this mapping.

Revision 1.25 - (view) (annotate) - [select for diffs]
Sat Oct 25 16:31:55 1997 UTC (16 years, 5 months ago) by pw
Branch: MAIN
Changes since 1.24: +23 -8 lines
Diff to previous 1.24
From: Timothy Miller <tsm@cs.brown.edu>

Ok, here are the updated patches to make the same cmucl lisp.core work
across OS versions under irix, still by making tzname resolved at runtime
(on irix only).

Revision 1.24 - (view) (annotate) - [select for diffs]
Sat Aug 23 15:59:59 1997 UTC (16 years, 7 months ago) by pw
Branch: MAIN
Changes since 1.23: +23 -17 lines
Diff to previous 1.23
I just finished making load-foreign work on SGIs, along with fixing calling of
foreign functions taking floating-point arguments after integer arguments but
before the fourth argument (more or less; mips has unusual C calling
conventions), and making cmucl work on IRIX 6.2 on the Onyx (where the system
page size has changed). I've included the patches below, along with some
discussion of the changes and a couple of problems with cmucl's interaction with
dynamic loading. Also, there's a misc change to make ioctls work (I'm not sure
for what version the released code worked, but it doesn't work on anything I
have). The patches do not fix the R10000; cmucl continues to not work on it (O2
and Octane).

The fixes make cmucl on the sgi use shared libraries so it can use dlopen et al
in load-foreign; this is based on the solaris implementation. The problem with
this is that the addresses of foreign variables are included directly in the
dumped lisp image (without relocation on loading), which might result in a
problem if cmucl is run with newer shared libraries than those it was compiled
and dumped with. As far as I can tell, for the SGI at least, this does not
affect function calls because the addresses used (and included in the dumped
image) are those of stub routines that jump to the actual routines, thus are
located in the executable proper rather than in the shared libraries, and so
shouldn't be changed by a new version of the shared library.

Unfortunately, this is not the case for global variables. Fortunately, there
appear to only be two foreign variables used by cmucl in any of its system code
winding up in the dumped image: errno and tzname. Apparently, Solaris relocates
data references in dsos to match the program, while IRIX relocates data
references in the program to match the dso. Thus, on Solaris, you don't need to
do anything special for cmucl to work with a newer runtime libc, but on IRIX it
gets the wrong value of errno and tzname. Unfortunately, the address of errno is
different between irix 6.2, 6.3, and 6.4 (all of which we have to have because
SGI doesn't have a single cross-platform OS version yet), which would require a
different lisp.core for each machine (you just need to run mk-lisp, not
recompile) if it weren't for the hack below. But fortunately again, a lisp
compiled for one version seems to be able to run on another version well enough
to generate the new lisp.core (presumably the worst that would happen is that
error messages could be confusing). It would be really nice to avoid this
problem. Perhaps some kind of relocation table could be added to the dumped
image format? I don't know enough about the system to know how possible or
ridiculous that suggestion is, unfortunately. Is the Solaris behavior guaranteed
to be the same in future releases? If not, or if any other platforms have the
irix behavior, this might become a more general problem. In the meantime, we use
a hack: we *define* errno in undefineds.c rather than just referencing it; this
results in warnings from the linker, but it resolves the conflict in favor of
the definition in the program, relocating libc to match, thus fixing this
problem for errno. The other global variables, tzname et al, can't be fixed this
way as easily because they're listed as weak symbols, essentially aliases for
the real symbol, so redefining them wouldn't cause libc to reference the new
version. Thus, as long as you don't use tzname, there's no problem right now
(although there may be if any other library global variables are used in cmucl
in the future). The definition of tzname is in a progn preceeded by a comment
which says not to use it, so hopefully it's not in fact used and therefore not a

These patches have been tested on an R5000 O2 running irix 6.3 and a dual R4400
Onyx running irix 6.2. A previous version of these patches (for 17f) was tested
on the onyx when it was running 5.3 (I think, maybe 5.2). The patches here are
from the main branch of the CVS tar as of August 13. Incidentally, it was quite
painful figuring out how to compile and bootstrap the current sources under the
distributed irix 18a binary, even without trying :new-random or :signed-array
(which I haven't tried to do yet); it might be nice to put a newer binary up...

Revision 1.23 - (view) (annotate) - [select for diffs]
Tue Aug 5 20:41:12 1997 UTC (16 years, 8 months ago) by pw
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22
Fix FORMAT directive in call to temporary-pathname.

Revision 1.22 - (view) (annotate) - [select for diffs]
Mon May 5 23:13:52 1997 UTC (16 years, 11 months ago) by dtc
Branch: MAIN
Branch point for: RELENG_18
Changes since 1.21: +3 -3 lines
Diff to previous 1.21
Patches from Simon for the MIPS IRIX port: hacks for foreign functions
which are not yet supported; hack for errno; signed-array support.

Revision 1.21 - (view) (annotate) - [select for diffs]
Sat Jan 18 14:30:46 1997 UTC (17 years, 3 months ago) by ram
Branch: MAIN
Changes since 1.20: +32 -14 lines
Diff to previous 1.20
Werkowskis source kit 1.03.7

Revision 1.20 - (view) (annotate) - [select for diffs]
Thu Feb 16 22:41:02 1995 UTC (19 years, 2 months ago) by wlott
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19
Use cmucl.orig, not lisp.orig, on hp-ux.

Revision 1.19 - (view) (annotate) - [select for diffs]
Fri Nov 4 05:23:08 1994 UTC (19 years, 5 months ago) by ram
Branch: MAIN
Changes since 1.18: +24 -6 lines
Diff to previous 1.18
Added some code on HPux to test for the correct magic number, since we get
confused if some object formats are used (like seems to be generated by gcc.)
Also, use library:lisp.orig as the base file on hpux.

Revision 1.18 - (view) (annotate) - [select for diffs]
Mon Oct 31 04:11:27 1994 UTC (19 years, 5 months ago) by ram
Branch: MAIN
Changes since 1.17: +1 -3 lines
Diff to previous 1.17
Fix headed boilerplate.

Revision 1.17 - (view) (annotate) - [select for diffs]
Wed Oct 19 23:49:54 1994 UTC (19 years, 6 months ago) by ram
Branch: MAIN
Changes since 1.16: +103 -3 lines
Diff to previous 1.16
Merge solaris patches.

Revision 1.16 - (view) (annotate) - [select for diffs]
Sat Oct 1 00:38:19 1994 UTC (19 years, 6 months ago) by ram
Branch: MAIN
Changes since 1.15: +119 -1 lines
Diff to previous 1.15
Support for HPPA from TSM.

Revision 1.15 - (view) (annotate) - [select for diffs]
Thu Sep 29 13:51:25 1994 UTC (19 years, 6 months ago) by ram
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14
Increment *foreign-segment-free-pointer* by the round-up-to-page value.  I'm
pretty sure this was the intent, since that amount was already being allocated.

Revision 1.14 - (view) (annotate) - [select for diffs]
Mon Jul 5 01:47:44 1993 UTC (20 years, 9 months ago) by wlott
Branch: MAIN
Branch point for: solaris_patch
Changes since 1.13: +19 -16 lines
Diff to previous 1.13
Use unix-namestring on each file before passing it to the linker to get rid
of search lists.

Revision 1.13 - (view) (annotate) - [select for diffs]
Sun Feb 7 21:17:12 1993 UTC (21 years, 2 months ago) by wlott
Branch: MAIN
Changes since 1.12: +7 -1 lines
Diff to previous 1.12
Moved foreign-segment-{start,size} from mumble-os.lisp into foreign.lisp.

Revision 1.12 - (view) (annotate) - [select for diffs]
Fri Jul 17 16:03:41 1992 UTC (21 years, 9 months ago) by ram
Branch: MAIN
Changes since 1.11: +4 -2 lines
Diff to previous 1.11
Changed default base file name for load-foreign to be the name used to run
lisp, and not "lisp".

Revision 1.11 - (view) (annotate) - [select for diffs]
Wed Mar 4 18:15:41 1992 UTC (22 years, 1 month ago) by ram
Branch: MAIN
Changes since 1.10: +18 -22 lines
Diff to previous 1.10
Changed LOAD-FOREIGN to be exported from ALIEN.  Changed it have keyword args
instead of optionals.  Deleted obsolete linker argument.

Revision 1.10 - (view) (annotate) - [select for diffs]
Mon Mar 2 02:27:23 1992 UTC (22 years, 1 month ago) by wlott
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9
Don't use MACH:VM-ALLOCATE, because we might not be running under mach.

Revision 1.9 - (view) (annotate) - [select for diffs]
Wed Feb 26 12:09:49 1992 UTC (22 years, 1 month ago) by wlott
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8
Added a ``mach:'' in front of gr-call*.

Revision 1.8 - (view) (annotate) - [select for diffs]
Fri Feb 14 23:44:54 1992 UTC (22 years, 2 months ago) by wlott
Branch: MAIN
Changes since 1.7: +73 -82 lines
Diff to previous 1.7
Merged new-alien changes onto trunk.

Revision 1.7 - (view) (annotate) - [select for diffs]
Fri Aug 30 17:23:40 1991 UTC (22 years, 7 months ago) by ram
Branch: MAIN
Changes since 1.6: +5 -4 lines
Diff to previous 1.6
Changed to use search-lists instead of absolute pathnames for finding the
linker, etc.

Revision 1.6 - (view) (annotate) - [select for diffs]
Fri Aug 30 17:09:22 1991 UTC (22 years, 7 months ago) by ram
Branch: MAIN
Changes since 1.5: +2 -13 lines
Diff to previous 1.5
Use get-page-size instead of vm_statistics.  Moved foreign-segment-XXX
constants to XXX-os.

Revision 1.5 - (view) (annotate) - [select for diffs]
Fri Feb 8 13:32:52 1991 UTC (23 years, 2 months ago) by ram
Branch: MAIN
Changes since 1.4: +9 -5 lines
Diff to previous 1.4
New file header with RCS header FILE-COMMENT.

Revision 1.4 - (view) (annotate) - [select for diffs]
Fri Feb 1 01:18:00 1991 UTC (23 years, 2 months ago) by wlott
Branch: MAIN
Changes since 1.3: +5 -1 lines
Diff to previous 1.3
Put load-foreign back into the EXT package.

Revision 1.3 - (view) (annotate) - [select for diffs]
Thu Jan 31 01:20:54 1991 UTC (23 years, 2 months ago) by wlott
Branch: MAIN
Changes since 1.2: +193 -244 lines
Diff to previous 1.2
Totally re-written for the new system.

Revision 1.2 - (view) (annotate) - [select for diffs]
Fri Jun 15 22:54:24 1990 UTC (23 years, 10 months ago) by ram
Branch: MAIN
Changes since 1.1: +4 -5 lines
Diff to previous 1.1
Changed to use pointer< and sap+ instead of >= and + when operating on

Revision 1.1 - (view) (annotate) - [select for diffs]
Tue Feb 6 17:24:21 1990 UTC (24 years, 2 months ago) by ram
Branch: MAIN
Initial revision

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

  ViewVC Help
Powered by ViewVC 1.1.5