在 Solaris SPARC 上编译 Lua 时出现很多警告?

发布于 2024-12-18 08:39:06 字数 1428 浏览 4 评论 0原文

当我在 Solaris SPARC 上编译 Lua (5.1.4) 时,我收到以下警告...而且很多...

下面只是一个片段:

# /usr/ccs/bin/make solaris
cd src && /usr/ccs/bin/make solaris
/usr/ccs/bin/make all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
/usr/sfw/bin/gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -c  lapi.c
lapi.c: In function `luaA_pushobject':
lapi.c:92: warning: visibility attribute not supported in this configuration; ignored
/usr/sfw/bin/gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -c  lcode.c
lcode.c: In function `luaK_getlabel':
lcode.c:97: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_concat':
lcode.c:196: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_patchtohere':
lcode.c:182: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_patchlist':
lcode.c:176: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_checkstack':
lcode.c:206: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_reserveregs':
lcode.c:212: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_stringK':

知道这意味着什么吗?它会影响 Solaris 上的 Lua 吗?我应该对 /src 文件夹中的 Makefile 进行任何更改吗?

感谢您的帮助;-)

林顿

When I compile Lua (5.1.4) on Solaris SPARC I am getting the following warnings...and LOTS of them...

Below is just a snippet:

# /usr/ccs/bin/make solaris
cd src && /usr/ccs/bin/make solaris
/usr/ccs/bin/make all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
/usr/sfw/bin/gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -c  lapi.c
lapi.c: In function `luaA_pushobject':
lapi.c:92: warning: visibility attribute not supported in this configuration; ignored
/usr/sfw/bin/gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -c  lcode.c
lcode.c: In function `luaK_getlabel':
lcode.c:97: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_concat':
lcode.c:196: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_patchtohere':
lcode.c:182: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_patchlist':
lcode.c:176: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_checkstack':
lcode.c:206: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_reserveregs':
lcode.c:212: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_stringK':

Any idea what this could mean? Will it influence Lua on Solaris at all? Any changes I should make to the Makefile in /src folder?

Thanks for the help ;-)

Lynton

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖竹 2024-12-25 08:39:07

Lua 猜测任何 ELF 平台上任何足够新的 GCC 都支持 GCC 的 visibility("hidden") 属性。

但如果 GCC 使用的汇编器不支持设置符号可见性的指令,GCC 将发出此警告。我认为这就是这里发生的事情。

将内部符号设置为“隐藏”可以在构建为共享库时进行更多优化,但实际上并不是必需的,因此这应该是无害的。

如果它们打扰您,请将 src/luaconf.h 中的行更改

#define LUAI_FUNC       __attribute__((visibility("hidden"))) extern

#define LUAI_FUNC       extern

Lua guesses that GCC's visibility("hidden") attribute is supported on any sufficiently recent GCC on any ELF platform.

But if the assembler being used by GCC does not support the directives for setting symbol visibility, GCC will issue this warning. I think that's what's happening here.

Setting internal symbols as "hidden" allows more optimisation when building as a shared library, but is not actually necessary, so this should be harmless.

If they are bothering you, change the line in src/luaconf.h which reads

#define LUAI_FUNC       __attribute__((visibility("hidden"))) extern

to

#define LUAI_FUNC       extern
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文