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

当我在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中做出哪些更改?

感谢您的帮助;-)

Lynton

原文链接 https://stackoverflow.com/questions/8284777

点赞
stackoverflow用户242889
stackoverflow用户242889

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

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

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

如果它们让你烦恼,可以更改 src/luaconf.h 中的行,其中写道:

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

#define LUAI_FUNC       extern
2011-11-27 13:29:42