lua-users home
lua-l archive

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

Ulrich Dziergwa wrote:

Hello to the list,

I try to cross compile lua and got a problem. Let me explain what I have done:

I want to use lua together with luasocket on an embedded PowerPc (a PPC405). There is Linux (2.4.18) running with busybox and uClibc. To make testing easier, I have a similar environment on an Intel system with a cross gcc for uClibc. After crafting (and testing) some lua scripts with the use of luasocket, I changed the lua makefile in putting a $(CROSS) before all tools. I also change the number representation to long, because the PPC405 has no FPU. Then I build a new lua propper for i386 and uClibc. I tested it with the examples (life, sieve ..) and it works. Now I changed the luasocket makefile in the same way. Everything compiles ok. But when I try to start my application, I got the following message

ulli@asterix:/home/luatest > ./lua testapp.lua
./lua: symbol 'luaL_checknumber': can't resolve symbol '@M'

. a lot more messages like this follow

./lua: symbol 'lua_settop': can't resolve symbol '@M'
./lua: compat-5.1.lua:68: Unable to resolve symbol
stack traceback:
        [C]: in function `assert'
        compat-5.1.lua:68: in function `require'
        socket.lua:13: in function `f'
        compat-5.1.lua:79: in function `require'
        sipsrv.lua:237: in main chunk
        [C]: ?

Can anybody give me a hint what the problem might be

Thanks Ulrich Dziergwa

Not really sure what the @M is a result of but in any case
you won't get luasocket to work like this with an integer number
type without work.
It assumes that the lua number type is double and uses
it to represent timeouts in seconds so 1ms becomes 0.001.
With an integer type all timeouts < 1s become 0 and lots of things don't work.
It looks like a reasonably easy job to fix this and I was about to start on
the project next week but if you get a headstart and publish your
results then I wouldn't be too upset ;-).