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

来源:互联网 发布:电魂网络胡建平 编辑:程序博客网 时间:2024/05/16 05:45

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

作者:朝阳_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_4baseurl=file:///mntgpgcheck=0enable=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

原创粉丝点击