LuaRocks fPIC 错误
我正在尝试使用 luarocks 安装 numlua:
luarocks make numlua-0.3-1.rockspec
但出现以下错误:
/usr/bin/ld: numlua.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
numlua.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
cp: cannot stat `numlua.so': No such file or directory
我猜我需要添加 -fPIC 参数作为标志,但对于编译器和第一次使用 luaRocks 不太好,我不确定如何或在何处添加此内容,或者,如果我做错了其他事情。任何帮助将不胜感激!
I'm trying to install numlua with luarocks:
luarocks make numlua-0.3-1.rockspec
but am getting the following error:
/usr/bin/ld: numlua.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
numlua.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
cp: cannot stat `numlua.so': No such file or directory
I'm guessing I need to add the -fPIC argument as a flag but not being great with compilers and a first-timer with luaRocks I'm not sure how or where to add this, or, if there is something else I'm doing wrong. Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据此邮件列表讨论,看起来 LuaRocks 是配置为 32 位系统,而实际运行在 64 位系统上。您很可能是通过包管理器安装的,因为从源安装时不会发生这种情况。
找到您的 luarocks/config.lua 文件。在我的 Ubuntu 11.10 系统上,它位于
/usr/share/lua/5.1/luarocks/config.lua
。找到显示LUAROCKS_UNAME_M
的行,并将i686
更改为x86_64
。现在 luarocks 知道它是在 64 位机器上,numlua 应该可以正常编译。
Per this mailing list discussion, it looks like LuaRocks is configured for a 32-bit system while actually running on a 64-bit system. It's likely that you installed it via a package manager, as this shouldn't happen when installed from source.
Find your
luarocks/config.lua
file. On my Ubuntu 11.10 system, it was located at/usr/share/lua/5.1/luarocks/config.lua
. Find the line that saysLUAROCKS_UNAME_M
and change thei686
tox86_64
.Now that luarocks knows it's on a 64-bit machine, numlua should compile fine.