Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1527209
  • 博文数量: 290
  • 博客积分: 3468
  • 博客等级: 中校
  • 技术积分: 3461
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-28 22:21
文章分类

全部博文(290)

文章存档

2016年(13)

2015年(3)

2014年(42)

2013年(67)

2012年(90)

2011年(75)

分类: LINUX

2013-12-18 17:43:52

os: ubuntu 12.04.3 x86_64

# apt-get install ia32-libs  //安装32 bit的库
# apt-get install  libc6-dev-i386

build 32位程序
# gcc -m32 -I/usr/include/x86_64-linux-gnu  test.c
# file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x1ceed675e06d77500ccc33dba9ea4f7f146bd0d5, not stripped

# ldd a.out 
linux-gate.so.1 =>  (0xf77cc000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7601000)
/lib/ld-linux.so.2 (0xf77cd000)


build 64位程序
# gcc test.c
# file a.out 
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x2907eb1bce7fdf0b08e3158cc4b601af6cc2429c, not stripped

# ldd a.out 
linux-vdso.so.1 =>  (0x00007fff051fc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe7dad68000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe7db149000)

参考:
%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8A%9E%E6%B3%95
https://developer.mozilla.org/en-US/docs/Compiling_32-bit_Firefox_on_a_Linux_64-bit_OS


阅读(1805) | 评论(0) | 转发(0) |
0

上一篇:x86 硬件虚拟化

下一篇:源码编译firefox

给主人留下些什么吧!~~