Changeset 15615 in project


Ignore:
Timestamp:
08/29/09 01:33:37 (10 years ago)
Author:
felix winkelmann
Message:

updated cross-compilation page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/cross-compilation

    r13455 r15615  
    2121must be configured and built:
    2222
    23   % tar xfz chicken-2.733.tar.gz
    24   % cd chicken-2.733
    25   % make PLATFORM=linux HOST=arm-linux PREFIX=/ ARCH= \
     23  % tar xfz chicken-4.XXX.tar.gz
     24  % cd chicken-4.XXX
     25  % make PLATFORM=linux HOSTSYSTEM=arm-linux PREFIX=/usr ARCH= \
    2626      DESTDIR=$HOME/tmp/arm-chicken install
    2727
     
    4444128-argument limitation.
    4545
    46 Invoking {{make}} with the {{install-libs}} target will only install
    47 the runtime libraries and header files, not the compiler or
    48 interpreter.  Usually you are only interested in the libraries, but we
    49 assume here the interpreter is used as well.
    50 
    5146Now we have native tools (including the interpreter) for the ARM
    5247architecture in the path {{$HOME/tmp/arm-chicken}}:
     
    5954
    6055  % file home/felix/tmp/arm-chicken/lib/libchicken.so*
    61   /home/felix/tmp/arm-chicken/lib/libchicken.so:       symbolic link to `libchicken.so.0.0.0'
    62   /home/felix/tmp/arm-chicken/lib/libchicken.so.0:     symbolic link to `libchicken.so.0.0.0'
    63   /home/felix/tmp/arm-chicken/lib/libchicken.so.0.0.0: ELF 32-bit LSB shared object, ARM, version 1 \
     56  /home/felix/tmp/arm-chicken/lib/libchicken.so:       symbolic link to `libchicken.so.4'
     57  /home/felix/tmp/arm-chicken/lib/libchicken.so.4:     ELF 32-bit LSB shared object, ARM, version 1 \
    6458    (SYSV), not stripped
    6559
     
    8579
    8680You will have the binaries under /usr/bin, libraries under /usr/lib/chicken.  csc and chicken-setup can work for compiling eggs, etc. if you have installed the native compiler, headers, and libs on the phone, but that requires a lot of space (e.g. mount a MicroSD card with ext3 filesystem at /usr, or boot from a MicroSD card; then <code>opkg install task-openmoko-native-sdk</code>).
     81
    8782=== Building the "cross" CHICKEN
    8883
     
    9388libraries and the target-specific C and C++ compilers:
    9489
    95   % tar xfz chicken-2.733.tar.gz
    96   % cd chicken-2.733
     90  % tar xfz chicken-4.XXX.tar.gz
     91  % cd chicken-4.XXX
    9792  % make PLATFORM=linux TARGET_PREFIX=$HOME/tmp/arm-chicken TARGETSYSTEM=arm-linux \
    9893      PREFIX=$HOME/tmp/arm-cross-chicken TARGET_RUN_PREFIX=/usr \
     
    153148=== Compiling simple extensions
    154149
    155 Invoking the cross {{arm-chicken-setup}} for simple extensions that
     150Invoking the cross {{arm-chicken-install}} for simple extensions that
    156151only provide runtime code is quite straightforward. The only difference
    157152is that we don't want the extension to be installed in the extension
     
    159154not executable on the build platform, and should additionally be moved
    160155into the repository path of the native CHICKEN. For this to work,
    161 we pass the {{-destdir}} option to {{chicken-setup}}:
     156we pass the {{-prefix}} option to {{chicken-install}}:
    162157
    163   % arm-chicken-setup -v -destdir $HOME/tmp/arm-chicken honu
     158  % arm-chicken-install -prefix $HOME/tmp/arm-chicken honu
    164159
    165 And check the generated binary:
    166 
    167   % arm-chicken-setup -R $HOME/tmp/arm-chicken/lib/chicken/3 -l
    168   honu                                                 Version: 1.4
    169   % file /home/felix/tmp/arm-chicken/lib/chicken/3/honu.so
    170   /home/felix/tmp/arm-chicken/lib/chicken/1/honu.so: ELF 32-bit LSB \
    171   shared object, ARM, version 1 (SYSV), not stripped
    172160
    173161==== OpenMoko
    174162
    175   DESTDIR=/opt/arm-chicken /opt/arm-cross-chicken/bin/arm-chicken-setup dbus
     163  DESTDIR=/opt/arm-chicken /opt/arm-cross-chicken/bin/arm-chicken-install dbus
     164
    176165=== Compiling "host" extensions
    177166
     
    187176what to do:
    188177
    189   % arm-chicken-setup -host-extension -v syntax-case
     178  % arm-chicken-install -host-extension matchable
    190179
    191 Now {{syntax-case}} is installed for the cross CHICKEN:
     180Now {{matchable}} is installed for the cross CHICKEN:
    192181
    193   % arm-chicken-setup -l
    194   syntax-case                                       Version: 6.9992
     182  % arm-chicken-install -l
     183  matchable
    195184
    196185In general, all compiled code that should run ''during'' compilation must
     
    203192=== Compiling a simple program with a host extension
    204193
    205   % arm-csc hello.scm -R syntax-case -v
     194  % arm-csc hello.scm -R matchable -v
    206195  hello: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, \
    207196  dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped
Note: See TracChangeset for help on using the changeset viewer.