如何确定 glibc 库的安装版本?
我正在使用嵌入式 Linux 部署,并使用不编译 I2C 库函数调用的交叉编译器工具链。
如何确定系统上库的精确版本,以便我可以重建工具链?
我不打算替换已部署的库,因为我知道它们可以工作(包括 I2C) ,所以我相信我需要以下内容:
- Binutils 版本
- GCC 版本
- GLIBC
- 内核(用于标头)
我想我可以从以下内容假设 binutils 库是版本 2.2.5。内核经过修改,我有源代码。
root@dev-box />ls /lib/ -al
drwxrwxrwx 3 root root 1024 Apr 27 09:44 .
drwxrwxrwx 14 root root 1024 Jan 1 1970 ..
-rwxrwxrwx 1 root root 105379 Jan 1 1970 ld-2.2.5.so
lrwxrwxrwx 1 root root 16 Jan 1 1970 ld-linux.so.2 -> /lib/ld-2.2.5.so
lrwxrwxrwx 1 root root 16 Jan 1 1970 ld.so.1 -> /lib/ld-2.2.5.so
-rwxrwxrwx 1 root root 1288601 Jan 1 1970 libc.so.6
-rwxrwxrwx 1 root root 25441 Jan 1 1970 libcrypt.so.1
-rwxrwxrwx 1 root root 14303 Jan 1 1970 libdl.so.2
-rwxrwxrwx 1 root root 36800 Jan 1 1970 libgcc_s.so.1
-rwxrwxrwx 1 root root 530401 Jan 1 1970 libm.so.6
-rwxrwxrwx 1 root root 86626 Jan 1 1970 libnsl.so.1
-rwxrwxrwx 1 root root 17533 Jan 1 1970 libnss_dns.so.2
-rwxrwxrwx 1 root root 46324 Jan 1 1970 libnss_files.so.2
-rwxrwxrwx 1 root root 98633 Jan 1 1970 libpthread.so.0
-rwxrwxrwx 1 root root 69966 Jan 1 1970 libresolv.so.2
-rwxrwxrwx 1 root root 12897 Jan 1 1970 libutil.so.1
I'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls.
How do I determine the precise versions of the libraries on the system so that I may rebuild the tool chain?
I don't intend to replace the libraries deployed, as I do know they work (including I2C), so I believe I need the following:
- Binutils version
- GCC version
- GLIBC
- Kernel (for the headers)
I think I can assume from the following that the binutils library is version 2.2.5. The kernel is modded for which I've the source.
root@dev-box />ls /lib/ -al
drwxrwxrwx 3 root root 1024 Apr 27 09:44 .
drwxrwxrwx 14 root root 1024 Jan 1 1970 ..
-rwxrwxrwx 1 root root 105379 Jan 1 1970 ld-2.2.5.so
lrwxrwxrwx 1 root root 16 Jan 1 1970 ld-linux.so.2 -> /lib/ld-2.2.5.so
lrwxrwxrwx 1 root root 16 Jan 1 1970 ld.so.1 -> /lib/ld-2.2.5.so
-rwxrwxrwx 1 root root 1288601 Jan 1 1970 libc.so.6
-rwxrwxrwx 1 root root 25441 Jan 1 1970 libcrypt.so.1
-rwxrwxrwx 1 root root 14303 Jan 1 1970 libdl.so.2
-rwxrwxrwx 1 root root 36800 Jan 1 1970 libgcc_s.so.1
-rwxrwxrwx 1 root root 530401 Jan 1 1970 libm.so.6
-rwxrwxrwx 1 root root 86626 Jan 1 1970 libnsl.so.1
-rwxrwxrwx 1 root root 17533 Jan 1 1970 libnss_dns.so.2
-rwxrwxrwx 1 root root 46324 Jan 1 1970 libnss_files.so.2
-rwxrwxrwx 1 root root 98633 Jan 1 1970 libpthread.so.0
-rwxrwxrwx 1 root root 69966 Jan 1 1970 libresolv.so.2
-rwxrwxrwx 1 root root 12897 Jan 1 1970 libutil.so.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 glibc:
/lib/libc.so.6
运行 so 文件听起来可能很奇怪,但在这种情况下应该打印出版本信息
对于内核版本,请使用
uname
对于binutils 解析 ld --version 的输出可能会产生您所期望的结果,对于 gcc --version 也是如此。这有点乏味,但我不知道另一种方法。
For glibc:
/lib/libc.so.6
Sounds maybe strange to run a so file but should print out version information in this case
For the kernel version use
uname
For the binutils parsing the output of
ld --version
might yield what you expect, the same forgcc --version
. This is a bit tedious but I do not know another way.可以通过运行在最近的系统上找到更全面的答案,
这将为您提供这样的结果,表明我在 ubuntu 18.10 上使用 glibc 2.28
对于多体系结构系统,您可以拥有 386 和 64 模式的多个副本,我认为这些应该是一样的。
我的系统上没有 /lib/libc.so.* 。
a more comprehensive answer can be found by running
On a recent system this will give you results like this that show i'm using glibc 2.28 here on ubuntu 18.10
For multiarch system you can have multiple copies for 386 and 64 modes , i think these should be the same .
i didn't have a /lib/libc.so.* on my system.
要了解当前安装的 glibc 版本,请编译并运行以下 C 代码。
干杯!
To know the current installed version of glibc, please compile and run the following C code.
Cheers !!!