【问题标题】:Lots of warnings compiling Lua on Solaris SPARC?在 Solaris SPARC 上编译 Lua 时出现很多警告?
【发布时间】:2011-11-27 21:31:54
【问题描述】:

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

下面只是一个sn-p:

# /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 进行任何更改吗?

感谢您的帮助;-)

林顿

【问题讨论】:

    标签: c gcc lua solaris


    【解决方案1】:

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

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

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

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

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

    到

    #define LUAI_FUNC       extern
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-03
      • 2011-09-02
      • 1970-01-01
      • 1970-01-01
      • 2019-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多