lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Mike,

Just last weekend, I compiled Lua for the ColdFire 5282 with the
GreenHills tools and ran it on a M5282lite evaluation board.

I've just tried compiling it with the m68k-elf-gcc and it compiles
with these flags:

MYCFLAGS= -m5200 -msoft-float
MYLDFLAGS= -m5200 -msoft-float -nostdlib -Wl,-elf2flt
-L/usr/local/m68k-elf/lib/m5200/
MYLIBGCC=$(shell gcc --print-libgcc-file-name)
MYLIBS= -lutil -liberty -lc $(MYLIBGCC) -lc

Here is a tar gz file base on Lua-5.1-work6 with current patches, plus
my hex numbers patch, minus the math library, plus a command line hook
so you can have a table of commands to work like this:

pshook@pshooklt:~/lua/src$ ./lua -i ../test/cmd_hook.lua
Lua 5.1 (work6-cumulative1)  Copyright (C) 1994-2005 Tecgraf, PUC-Rio

1> p 4 0x10 0x100 0x10000
4       16      256     65536

2> function cmds.x(a, b) return string.lower(a)..b end

3> x  'ONE'  'two'
onetwo

4>

http://lua-users.org/files/wiki_insecure/lua-5282.tgz


If you ever need to install the GNU tools for ColdFire, the easiest
install I've seen for Linux is here:

    http://www.uclinux.org/get_started/

then go to 'quick start document'

    http://www.uclinux.org/get_started/uClinuxbeginner.html

Then the section 'download the tools'

    the m68k-elf toolchain
http://www.uclinux.org/pub/uClinux/m68k-elf-tools/m68k-elf-tools-20030314.sh

This installs the binaries directly without having to compile.  It
works on Debian too.

pshook@pshooklt:~/lua/src$ which m68k-elf-gcc
/usr/local/bin/m68k-elf-gcc

pshook@pshooklt:~/lua/src$ dir /usr/local/m68k-elf/bin/
total 2948
-rwxr-xr-x  1 root   4290 2003-03-13 02:46 ld
-rwxr-xr-x  2 root 464956 2003-03-14 01:09 as
-rwxr-xr-x  2 root 253620 2003-03-14 01:09 ar
-rwxr-xr-x  2 root 376312 2003-03-14 01:09 strip
-rwxr-xr-x  2 root 253620 2003-03-14 01:09 ranlib
-rwxr-xr-x  2 root 262224 2003-03-14 01:09 nm
-rwxr-xr-x  2 root 403196 2003-03-14 01:09 ld.real
-rwxr-xr-x  1 root  76752 2003-03-14 01:09 gcc
-rwxr-xr-x  1 root 321820 2003-03-14 01:09 flthdr
-rwxr-xr-x  1 root 546728 2003-03-14 01:09 elf2flt

pshook@pshooklt:~/lua/src$ dir /usr/local/m68k-elf/lib/m5200/
total 4152
-rw-r--r--  1 root   88442 2003-03-13 02:45 libiberty.a
-rw-r--r--  1 root    6282 2003-03-13 02:56 libutil.a
-rw-r--r--  1 root    1066 2003-03-13 02:56 libresolv.a
-rw-r--r--  1 root  106982 2003-03-13 02:56 libpthread.a
-rw-r--r--  1 root  174774 2003-03-13 02:56 libm.a
-rw-r--r--  1 root   13614 2003-03-13 02:56 libcrypt.a
-rw-r--r--  1 root 1019344 2003-03-13 02:56 libc.a
-rw-r--r--  1 root     716 2003-03-13 02:56 crt0.o
-rw-r--r--  1 root 2790926 2003-03-13 03:44 libstdc++.a
drwxrwxrwx  2 root    4096 2003-03-13 03:48 msep-data/
drwxrwxrwx  2 root    4096 2003-03-13 03:53 mid-shared-library/

pshook@pshooklt:~/lua/src$ PATH=/usr/local/m68k-elf/bin/:$PATH
pshook@pshooklt:~/lua/src$ which gcc
/usr/local/m68k-elf/bin//gcc

pshook@pshooklt:~/lua/src$ make
gcc -O2 -Wall -m5200 -msoft-float   -c -o lapi.o lapi.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lcode.o lcode.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ldebug.o ldebug.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ldo.o ldo.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ldump.o ldump.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lfunc.o lfunc.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lgc.o lgc.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o llex.o llex.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lmem.o lmem.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lobject.o lobject.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lopcodes.o lopcodes.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lparser.o lparser.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lstate.o lstate.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lstring.o lstring.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ltable.o ltable.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ltm.o ltm.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lundump.o lundump.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lvm.o lvm.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lzio.o lzio.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lauxlib.o lauxlib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lbaselib.o lbaselib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ldblib.o ldblib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o liolib.o liolib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o limathlib.o limathlib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o loslib.o loslib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o ltablib.o ltablib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o lstrlib.o lstrlib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o loadlib.o loadlib.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o
llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o
liolib.o limathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
ranlib liblua.a
gcc -O2 -Wall -m5200 -msoft-float   -c -o lua.o lua.c
gcc -o lua -m5200 -msoft-float -nostdlib -Wl,-elf2flt
-L/usr/local/m68k-elf/lib/m5200/ lua.o liblua.a -lm -lutil -liberty
-lc /usr/local/lib/gcc-lib/m68k-elf/2.95.3/libgcc.a -lc
liblua.a(loslib.o): In function `io_setloc':
loslib.o(.text+0x722): the 'setlocale' function supports only C|POSIX locales
/usr/local/m68k-elf/bin/ld.real: warning: cannot find entry symbol
_start; defaulting to 00000000
gcc -O2 -Wall -m5200 -msoft-float   -c -o luac.o luac.c
gcc -O2 -Wall -m5200 -msoft-float   -c -o print.o print.c
gcc -o luac -m5200 -msoft-float -nostdlib -Wl,-elf2flt
-L/usr/local/m68k-elf/lib/m5200/ luac.o print.o liblua.a -lm -lutil
-liberty -lc /usr/local/lib/gcc-lib/m68k-elf/2.95.3/libgcc.a -lc
/usr/local/m68k-elf/bin/ld.real: warning: cannot find entry symbol
_start; defaulting to 00000000

I want to get Lua to run on Ed Sutter's uMon

  http://www.linuxdevices.com/news/NS5492444666.html
  http://linuxdevices.com/articles/AT8516113114.html
  http://www.microcross.com/html/micromonitor.html

He supports many boards.  The one in this directory
umon/umon_ports/csb360 is for the ColdFire 5272 which is really close
to the ColdFire 5282.

Cheers, 

- Peter Shook