0

I was stuck in this problem for many days.

Wax(https://github.com/probablycorey/wax support armv7 and armv7s architecture only, but my project uses arm64 architecture.

The error message is "Error opening wax scripts: loading wax stdlib: bad header in precompiled chunk".

So I guess the problem is in wax_stdlib.h. However this file is a precompiled result of lua scripts in stdlib ducoment, and I don't know how to precompile lua scripts in 64-bit.

How can I fix it?

Colonel Thirty Two
  • 23,953
  • 8
  • 45
  • 85
Li Song
  • 11
  • 1

3 Answers3

1

because your project uses the arm64 architecture,and the wax_stdlib.h was precompiled in 32bit...

So,you just need to precompile the wax stdlib in 64bit.

first,you need to download lua source code ,and cd to src directory,and make it in 64bit,and install

then you should modifly the luac.lua file

-- 64 b = string.sub(b, 1, x - 6 - 4).."\0"..string.sub(b, y + 2, y + 5) -- WTF does this do?

-- 32 -- b = string.sub(b, 1, x - 6).."\0"..string.sub(b, y + 2, y + 5) -- WTF does this do?

-- 64 assert(f:write(string.rep("\0", 3 * 8)))

-- 32 --assert(f:write(string.rep("\0", 12)))

and run the compile-stdlib.sh...

if you do like this ,it can works,but I really suggest you do not use wax in 64bit,because it don't support 64bit..you will find more problems

xhughl
  • 11
  • 1
0

Use JSPatch instead maybe a good way.

kimimaro
  • 1,263
  • 2
  • 12
  • 21
-1

There is a fork of wax here with updates for ARM64 (and x64) - it is not clear how well tested it is, but it may be useful.

https://github.com/felipejfc/wax_x86-64

Airsource Ltd
  • 32,379
  • 13
  • 71
  • 75
  • I've modded it in a way that it works regardless of the platform cause I've replaced low level stuff with high level stuff. feel free to test it and point any issue, It works on both x64 and arm64... you should be more careful with comments and votes – Felipe Cavalcanti Feb 12 '15 at 00:45