1

I compiled lua on PC with luac and run it on MIPS device. It shows lua: bad header in precompiled chunk.

I searched for it and seems bytecode not portable.

How to crosscompile it?

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
eri
  • 3,133
  • 1
  • 23
  • 35
  • 2
    AFAIK, `luac` is not able to cross-compile. If you can use Lua 5.1, try LuaJIT, its bytecode is portable across platforms. LuaJIT does not have `luac` utility, run `luajit -b file.lua file.luac` to create bytecode file. – Egor Skriptunoff Mar 19 '16 at 12:09
  • thanks. i solved it... linux box has heavy patched lua. i compiled luac with these patches – eri Mar 19 '16 at 13:09
  • 2
    If you have solved your problem, then post an answer to your question. That is allowed, and indeed encouraged. – Nicol Bolas Mar 19 '16 at 14:06
  • @NicolBolas still testing – eri Mar 19 '16 at 16:18

1 Answers1

1

Solved

Device`s lua was patched. In this case not portable. Compiled lua for PC with this patches - all works fine now.

eri
  • 3,133
  • 1
  • 23
  • 35