红联Linux门户
Linux帮助

32位debian执行64位程序

发布时间:2007-05-26 00:35:37来源:红联作者:Amayjasne
  我在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
文章评论

共有 0 条评论