- 论坛徽章:
- 0
|
我在32位的Debian Linux 4 etch上装了一个内核linux-image-2.6.18-4-amd64,系统环境是32位的,却可以执行64位的程序,本来早有想法实验一下,现在才真的确定确实可以,有点喜出望外:
$ getconf LONG_BIT
32
getconf命令可以看出系统是32位的。
我编写了一个小程序,编译后的可执行文件是64位,却是可以执行。
skypp@debian:~/workspace/c$ gcc -m64 helo.c -o helo
skypp@debian:~/workspace/c$ ./helo
helo
skypp@debian:~/workspace/c$ file helo
helo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped
skypp@debian:~/workspace/c$
不过要执行和编译64位程序记得安装下面的软件包哦,
sudo apt-get install libc6-amd64 libc6-dev-amd64
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16166/showart_309152.html |
|