How to build 32bit python 2.6 on 64bit Linux?

[亡魂溺海] 提交于 2019-12-05 04:04:46

You'll need to pass the appropriate flags to gcc and ld to tell the compiler to compile and produce 32bit binaries.

Use --build and --host.

./configure --help
System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

You need to use ./configure --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu to compile for 32-bit Linux in a 64-bit Linux system.

Note: You still need to add the other ./configure options.

Regarding why, since Kirk (and probably others) wonder, here is an example: I have a Python app with large dicts of dicts containing light-weight objects. This consumes almost twice as much RAM on 64bit as on 32bit simply due to the pointers. I need to run a few instances of 2GB (32bit) each and the extra RAM quickly adds up. For FreeBSD, a detailed recipe for 32bit-on-64bit jail is here http://www.gundersen.net/32bit-jail-on-64bit-freebsd/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!