How can I know the gcc version which is used to compile a certain rpm package ?

本文介绍了一种方法来确定用于编译特定RPM包的GCC版本。通过下载并安装相关debuginfo包,然后使用readelf命令读取.debug文件中的注释部分,可以获取到编译时使用的GCC版本信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://access.redhat.com/solutions/959473

How can I know the gcc version which is used to compile a certain rpm package ?

 SOLUTION UNVERIFIED - 已更新 2014年六月17日10:56 - 

English 

环境

  • Red Hat Enterprise Linux All Versions

问题

How can I know the gcc version which is used to compile a certain rpm package ?

决议

  • Step 1. Download the related debuginfo package.
    Let's take bind as an example: bind-debuginfo-9.8.2-0.17.rc1.el6_4.4
  • Step 2. Install the debuginfo package.

Raw

# rpm -ivh bind-debuginfo-9.8.2-0.17.rc1.el6_4.4.x86_64
  • Step 3. Execute the following readelf command

Raw

# readelf -p .comment /usr/lib/debug/usr/sbin/named.debug 

String dump of section '.comment':
  [     0]  GCC: (GNU) 4.4.6 20120305 (Red Hat 4.4.6-4)
  [    2c]  GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-3)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值