lua 64位转换问题
我真的希望对这个主题有一些帮助。有人在需要同时支持 32 位和 64 位的应用程序中使用过 lua 吗?我们目前正在过渡到 64 位,但客户端编译的 lua 脚本遇到了问题,我们无法使用 64 位版本重新编译。因此,实际上我们需要能够在 64 位应用程序中加载使用 32 位 lua 编译的字节码文件。当我们尝试这样做时,我们收到一条错误消息:
virtual machine mismatch in test.bin.lua: size of size_t is 8 but read 4
当然,这是一个明显的 64 位转换问题。困难的是在无法重新编译二进制文件的情况下弄清楚该怎么做。
谢谢
I really hope there is some help to get on this subject. Has anyone ever used lua in an application that needs to have both 32-bit and 64-bit support? We are currently transitioning to 64-bit but are having trouble with client compiled lua scripts that we can't recompile ourselves using the 64-bit version. So in effect we need to be able to load bytecode files compiled using 32-bit lua in a 64-bit application. When we try to do so we receive an error message:
virtual machine mismatch in test.bin.lua: size of size_t is 8 but read 4
Well of course this is a clear 64bit transitioning problem. The hard thing is just to figure out what to do about it without the ability to recompile the binaries.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改 lundump.c 来读取 32 位字节码文件并不难。我已经在 Lua 邮件列表中发布了这方面的路线图。如果您有问题,请给我发送电子邮件。
It's not hard to adapt lundump.c to read 32-bit bytecode files. I've posted a roadmap for this in the Lua mailing list. If you have problems, please send me email.
你可以尝试LuaDec:“LuaDec是Lua语言的反编译器。”我不太了解它的网站声明它的目标是 Lua 5.0.2。因此,它可能无法开箱即用,但比从头开始要好。
You could try LuaDec: "LuaDec is a decompiler for the Lua language." I don't know much about it, and the website states that it targets Lua 5.0.2. So, it may not work out of the box, but it's better than starting from scratch.