linux RHEL x86_64bit 系统安装 32bit兼容库 和 编译32bit程序

声明:此文档只做学习交流使用,请勿用作其他商业用途

作者:朝阳_tony

邮箱:linzhaolover@gmail.com

2013年6月17日 14:31:59 星期一

转载请注明出处:http://blog.csdn.net/linzhaolove

文章最后程序时间: 2013年6月17日 14:31:59 星期一


linux RHEL x86_64bit 系统安装 32bit兼容库 和 编译32bit程序

1、安装开发包;

首先拿到系统的iso文件;配置yum源;

$> vim /etc/yum.repos.d/install_rhel6_4.repo

[rhel6_4_base]
name=local rhel6_4
baseurl=file:///mnt
gpgcheck=0
enable=1 

$> mount /home/rhel-server-6.4-x86_64-dvd.iso /mnt/ -o loop

检查一下yum源,

$> yum repolist

安装需要的安装包;

$> yum install libstdc++-devel.i686 glibc.i686 libgcc.i686 libstdc++.i686 glibc-devel.i686



2、再64位机上编译32位程序

自己写个helloworld程序,测试一下;

$> gcc -m32 -o output32 hello.c
用file命令检查一下编译出来的文件

$> file output32 
output32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

$> gcc -m64 -o output64 hello.c
$> file output64 
output64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值