lev*_*ied 4 haskell glibc ghc ldd haskell-stack
我创建了一个新项目,用stack
它创建了一个项目resolver: lts-16.12
。当使用 运行示例.hs
文件时stack runghc src/MyExample.hs
,它工作正常,但我在运行之前也得到了这些:
/home/lpied/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/lpied/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/lpied/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/lpied/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/lpied/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/lpied/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
Run Code Online (Sandbox Code Playgroud)
我已经阅读过诸如此类的内容,并且可以确认有问题的库:
$ ll /lib64/libtinfo.so.5
lrwxrwxrwx. 1 root root 15 Aug 08 19:47 /lib64/libtinfo.so.5 -> libtinfo.so.5.9
Run Code Online (Sandbox Code Playgroud)
不具有VERDEF
/ .gnu.version_d
:
$ readelf -V /lib64/libtinfo.so.5|grep gnu
Version symbols section '.gnu.version' contains 245 entries:
Version needs section '.gnu.version_r' contains 1 entries:
Run Code Online (Sandbox Code Playgroud)
看起来上面的消息是这样打印的:
if (__glibc_unlikely (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL))
{
/* The file has no symbol versioning. I.e., the dependent
object was linked against another version of this file. We
only print a message if verbose output is requested. */
if (verbose)
{
/* XXX We cannot translate the messages. */
_dl_exception_create_format
(&exception, DSO_FILENAME (map->l_name),
"no version information available (required by %s)", name);
goto call_cerror;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我尝试从这里设置/取消设置各种标志,例如,,,,但没有LD_VERBOSE
任何效果。LD_DEBUG
LD_WARN
我无权安装任何东西来修复库本身。知道是否/如何可以抑制这些消息来代替吗?或者有其他非侵入性修复方法吗?
看来您使用的发行版已经构建了没有符号版本控制的 ncurses。我猜它是 Fedora 衍生的,所以我提交了一个错误来更改它:
同时,您可以自己构建 ncurses,可能使用
./configure --prefix=/home/lpied/opt/ncurses --with-versioned-syms
make
make install
Run Code Online (Sandbox Code Playgroud)
这不需要root权限。
并添加/home/lpied/opt/ncurses/lib64
到LD_LIBRARY_PATH
shell 的配置中。