/lib/i386-linux-gnu/libc.so.6,/lib/x86_64-linux-gnu/libc.so.6和/usr/lib/x86_64-linux-gnu/libc.so之间的区别是什么? [英] What is the difference between /lib/i386-linux-gnu/libc.so.6, /lib/x86_64-linux-gnu/libc.so.6 and /usr/lib/x86_64-linux-gnu/libc.so?

查看:1410
本文介绍了/lib/i386-linux-gnu/libc.so.6,/lib/x86_64-linux-gnu/libc.so.6和/usr/lib/x86_64-linux-gnu/libc.so之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux Mint的14纳迪亚安装Matlab的(一个的uname -a显示:Linux下的Ideapad-Z570 3.5.0-17泛型#28,Ubuntu的SMP周二10月9日19时31分23秒UTC 2012 x86_64的x86_64的x86_64的GNU / Linux的),并在命令行中调用它时,我会得到一个:/lib64/libc.so找不到

我也跟着上MathWorks公司的帮助下通过在/ lib64的链接为:

  LN -s /lib/x86_64-linux-gnu/libc.so.6。
 

这解决了这个问题。

现在,如果我做一找到该库的获取:

 找到libc.so
/lib/i386-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so
 

我将与海湾合作委员会在这台电脑编制,我想有完整的64位汇编。是什么恰恰意味着将所有这些不同的libc.so库?哪一个GNU编译器是使用?我需要做什么用gcc不同的编译为64位?

我也很想优化,就像我能为我的新的i7芯!

解决方案
  

/lib/i386-linux-gnu/libc.so.6

这是为32位版本的库。

  

/lib/x86_64-linux-gnu/libc.so.6

这是64位版本的库。

这两种通常的符号链接到实际的库文件,这通常会根据glibc的版本号命名,例如 libc-2.15.so

  

/usr/lib/x86_64-linux-gnu/libc.so

这不是一个库,但是一链接脚本文件,它是指在上述符号链接

为什么我们需要所有这些:

首先,不管安装的libc版本,链接器将随时搜索 libc.so ,因为编译器驱动程序会一直传递到连接器的 -lc 选项。该名称的libc 保持不变,并表示到最新版本的库。

创建符号链接 libc.so.6的命名后的的soname 的图书馆,这,或多或少对应于ABI版本图书馆。该可执行文件,实际上链接的反对 libc.so 包含关于 libc.so.6的运行时依赖。

如果我们想象一个严重ABI不相容的libc被释放的一天,它的soname可以被命名为 libc.so.7 ,例如这个版本coukld共存与旧 libc.so.6的的版本,从而可执行文件已对链接一个或另一个可以在同一个系统中共存,

最后,名称 libc-2.15.so 指的是libc的版本中,当你安装一个新的libc包,名称将改为 libc-2.16.so 。只要它是二进制数,previous版本兼容,在 libc.so.6的的链接将保持这样的命名方式和现有的可执行文件将继续工作。

I installed Matlab in my Linux Mint 14 Nadia (a uname -a shows: Linux Ideapad-Z570 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux) and when calling it from the command line I would get a: "/lib64/libc.so not found".

I followed the help on mathworks by making a link in /lib64 as:

ln -s /lib/x86_64-linux-gnu/libc.so.6 .

That solved the issue.

Now, if I do a locate of this library I get:

locate "libc.so"
/lib/i386-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so

I will be compiling with gcc in this computer and I would like to have full 64bit compilations. What does exactly mean to have all these different libc.so libraries? which one will the gnu compiler be using? do I need to do anything different with gcc to compile for 64 bits?

I would also love to optimize as much as I can for my new i7 core!!!

解决方案

/lib/i386-linux-gnu/libc.so.6

This is is 32-bit version of the library.

/lib/x86_64-linux-gnu/libc.so.6

This is the 64-bit version of the library.

Both are usually symbolic links to the actual library file, which will usually be named according to the glibc release number, for example libc-2.15.so

/usr/lib/x86_64-linux-gnu/libc.so

This is not a library, but a linker script file, which refers to the above symlinks.

Why do we need all these:

First, regardless of libc version installed, the linker will always search for libc.so, because the compiler driver will always pass to the linker the -lc options. The name libc stays the same and denotes to most recent version of the library.

The symlinks libc.so.6 are named after the soname of the library, which, more or less corresponds to the ABI version of the library. The executables, linked against libc.so in fact contain runtime dependencies on libc.so.6.

If we imagine the someday a grossly ABI incompatible libc is released, it's soname could be named libc.so.7, for example and this version coukld coexists with the older libc.so.6 version, thus executables linked against one or the other can coexist in the same system,

And finally, the name libc-2.15.so refers to the libc release, when you install a new libc package, the name will change to libc-2.16.so. Provided that it is binary compatible with the previous release, the libc.so.6 link will stay named that way and the existing executables will continue to work.

这篇关于/lib/i386-linux-gnu/libc.so.6,/lib/x86_64-linux-gnu/libc.so.6和/usr/lib/x86_64-linux-gnu/libc.so之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆