This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Build 32 bit compiler on 64 bit machine
- From: Darryl Miles <darryl-mailinglists at netbauds dot net>
- To: Christina Wang <cxwang_wt at hotmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 12 May 2006 03:15:59 +0100
- Subject: Re: Build 32 bit compiler on 64 bit machine
- References: <BAY120-F23C13AE5BEC16A95EE98AF97AF0@phx.gbl>
Christina Wang wrote:
I'm trying to build 32 bit gcc4.1.0 on a 64 bit machine(FC3 with intel
x86_64EMT processors). The default mode of the generated compiler is
always 64 bit. I tried "--enable-targets=m32" in the configuration
stage, but it doesn't work. With a 64 bit processor, how can I build 32
bit gcc or bi-arch but the default mode is 32 bit?
I thought you automatically got a 32bit target support enabled, but
64bit by default.
Have you ruled out the GCC "-m32" option for your needs ?
$ gcc -o a.out -m32 helloworld.c
$ file a.out
$ ldd a.out
$ file /lib/libc-2.3.5.so
$ file /lib64/libc-2.3.5.so
On my FC4 installation I get a 32bit ELF executable, linked against the
32bit versions of all DSOs from /lib and /usr/lib rather than /lib64 and
/usr/lib64.
If you are using authconf, then:
$ export CFLAGS="-m32"
$ ./configure
Will often build 32bit versions of applications.
Darryl L. Miles