Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 13439  / 2 Years ago, sun, february 6, 2022, 10:43:22

I'm trying to compile a 32 bit version of python on a 64 bit ubuntu system with the following configure command:



CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32  -Lpwd/lib32 -Wl,-rpath,/lib32 
-Wl,-rpath,/usr/lib32" ./configure --prefix=/opt/pym32


then make, make install. No errors, but it should be something wrong because a "readelf -h python" tells me that python was build as a ELF64 instead.


More From » 64-bit

 Answers
4

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=i386-pc-linux-gnu

to compile for 32-bit Linux in a 64-bit Linux system. You still need to add the other ./configure options.


[#43600] Monday, February 7, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lishrag

Total Points: 306
Total Questions: 109
Total Answers: 125

Location: Saint Lucia
Member since Wed, Feb 8, 2023
1 Year ago
;