![]() |
make (compile program) 32 bit in 64 bit
Hi, I need to compile 32 bit program (bash it is) in my Ubuntu Jaunty 64 bit, but everytime I compile it, it produce 64 bit executable. Here is how I tried it:
Code:
evans@evans-pc:~/bash-4.0$ linux32 ./configure > configure.logCode:
checking build system type... i686-pc-linux-gnuCode:
evans@evans-pc:~/bash-4.0$ env |
For sure you should add the "-m32" compile option to CFLAGS and CXXFLAGS.
|
Quote:
Code:
env CFLAGS="-m32" |
Do:
Code:
export CFLAGS+=" -m32" |
Does this work the other way around as well, by building 64-bit applications on 32-bit systems? I'm just curious.
Linux Archive |
Quote:
Code:
evans@evans-pc:~/bash-4.0$ export CFLAGS+=" -m32"Code:
This file contains any messages produced by compilers whileQuote:
|
See here:
http://ubuntuforums.org/showthread.php?t=17033 Make sure to install 'libc6-dev-i386' as well as 'libc6-i386', and of course the 32-bit gcc if you don't have it. So basically install all the necessary 32-bit toolchain to compile programs ... gcc, glib, glibc, etc. |
It appears, now the problem change. After setting the environment using
Code:
export CFLAGS+=" -m32"Code:
evans@evans-pc:~/bash-4.0$ make |
Do a 'make clean' then try again.
|
Quote:
Code:
/usr/bin/ld: i386:x86-64 architecture of input file `mkbuiltins.o' is incompatible with i386 output |
Just start over, delete the directory that was made and extract the source again from the archive you downloaded. It seems to me that `mkbuiltins.o' is or was compiled as 64-bit and now the linker won't accept it in a 32-bit executable. So you need to get rid of `mkbuiltins.o' it should be in ./builtins, but 'make clean' should technically get rid of it.
|
Quote:
|
Linux32: Before all else...
Quote:
Shingoshi |
| All times are GMT -5. The time now is 08:33 PM. |