Changes between Version 21 and Version 22 of PortToIA-32


Ignore:
Timestamp:
Jan 17, 2008, 11:49:33 PM (12 years ago)
Author:
rme
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PortToIA-32

    v21 v22  
    110110=== Bootstrapping notes ===
    111111
    112 Using a current x86-64 OpenMCL to build the ia32 branch:
     112Follow these instructions to use a current Darwin/x86-64 lisp to build the ia32
     113branch.  (I think that the 070722 snapshot should also work.)
     114
     115Check out the ia32 branch from svn.
     116
     117{{{
     118$ svn co svn+ssh://svn.clozure.com/usr/local/publicsvn/openmcl/branches/ia32
     119}}}
     120
     121Use
     122{{{
     123$ svn co http://svn.clozure.com/publicsvn/openmcl/branches/ia32
     124}}}
     125
     126if you don't have write access to the repository.
     127
     128Next, copy a kernel, image, and interfaces into the ia32 tree.
     129{{{
     130$ p=/path/to/trunk/ccl/
     131$ cp $p/{dx86cl64,dx86cl64.image} .
     132$ cd darwin-x86-headers64/libc
     133$ cp $p/darwin-x86-headers64/libc/*.cdb .
     134}}}
     135
     136Build the ia32 branch sources.   Follow the directions below.
    113137
    114138{{{
     
    169193Exit, start up with the bootstrap image, and then save a new full image.
    170194
     195=== Darwin/IA-32 interface databases ===
     196To build interface files, get an ffigen binary from clozure.com:/pub/testing and install it.
     197
     198{{{
     199$ cd darwin-x86-headers/libc/C
     200$ ./populate.sh
     201+++ /Developer/SDKs/MacOSX10.4u.sdk/usr/include/ar.h
     202+++ /Developer/SDKs/MacOSX10.4u.sdk/usr/include/arpa/ftp.h
     203+++ /Developer/SDKs/MacOSX10.4u.sdk/usr/include/arpa/inet.h
     204[...]
     205$
     206}}}
     207
     208There's one more step to making these interfaces available to the lisp, but we'll
     209get to that in a minute.
     210
    171211=== Cross compiling ===
    172212Given an image made as above, to set up for cross-compiling:
     
    184224(load "compiler/X86/x86-disassemble.lisp")
    185225(load "compiler/X86/X8632/x8632-backend.lisp")
     226
    186227(let ((*target-backend* *x8632-backend*))
    187   (load "ccl:compiler;X86;X8632;x8632-vinsns.lisp"))
     228  (load "ccl:compiler;X86;X8632;x8632-vinsns.lisp")
     229  (load "ccl:compiler;X86;x86-lapmacros.lisp"))
     230
    188231(load "lib/ffi-darwinx8632.lisp")
    189 }}}
    190 Now, you can run
    191 {{{
    192 (cross-compile-ccl :darwinx8632 t)
    193 }}}
    194 and see how far that gets you.  (It should get to
    195 l1-boot-2.lisp then complain about missing
    196 interface files.)
    197 
    198 To build interface files, get an ffigen binary from clozure.com:/pub/testing and install it.
    199 
    200 {{{
    201 $ cd darwin-x86-headers/libc/C
    202 $ ./populate.sh
    203 +++ /Developer/SDKs/MacOSX10.4u.sdk/usr/include/ar.h
    204 +++ /Developer/SDKs/MacOSX10.4u.sdk/usr/include/arpa/ftp.h
    205 +++ /Developer/SDKs/MacOSX10.4u.sdk/usr/include/arpa/inet.h
    206 [...]
    207 $
    208 }}}
    209 
    210 Start up a lisp, and do the following:
     232
     233(require-update-modules *x8632-xload-modules* t)
     234}}}
     235
     236The first time you do this, you need to finish processing the
     237interface databases.
    211238
    212239{{{
     
    218245}}}
    219246
    220 Now, you'll get farther with the cross-compile, but you'll run into
    221 an error (value 8 is not of the expected type (member ...))
    222 whil compiling linux-files.lisp.
    223 
    224 
    225 
     247
     248Evaluating
     249{{{
     250(cross-xload-level-0 :darwinx8632 t)
     251}}}
     252will create a boot image in x86-boot32.image.
     253
     254To build an IA-32 lisp kernel:
     255{{{
     256$ cd lisp-kernel/darwinx8632
     257$ make
     258}}}
     259
     260The current state of the port is that it will map in the boot image
     261and start running %toplevel-function%
     262but die near the processing of the *xload-cold-load-functions* list.
     263
     264To run the IA-32 lisp (from the lisp-kernel/darwinx8632 directory):
     265{{{
     266$ gdb ../../dx86cl
     267GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:07:49 UTC 2007)
     268Copyright 2004 Free Software Foundation, Inc.
     269GDB is free software, covered by the GNU General Public License, and you are
     270welcome to change it and/or distribute copies of it under certain conditions.
     271Type "show copying" to see the conditions.
     272There is absolutely no warranty for GDB.  Type "show warranty" for details.
     273This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .. done
     274
     275Breakpoint 1 at 0xac79: file ../lisp-debug.c, line 892.
     276(gdb) b start_lisp
     277Breakpoint 2 at 0x5c61: file {standard input}, line 61.
     278(gdb) run ../../x86-boot32.image
     279Starting program: /Users/rme/openmcl/ccl/dx86cl ../../x86-boot32.image
     280Reading symbols for shared libraries +. done
     281
     282Breakpoint 2, start_lisp () at {standard input}:66
     28366      {standard input}: No such file or directory.
     284        in {standard input}
     2851: x/i $pc  0x5c61 <start_lisp+6>:      mov    0x8(%ebp),%ebx
     286(gdb)
     287}}}
     288
     289If you take a look and have questions or comments, please send mail to openmcl-devel@clozure.com, or to me directly (rme@clozure.com).
     290