Mailinglist Archive: opensuse-amd64 (75 mails)
| < Previous | Next > |
Re: [suse-amd64] Compiling 32bit binaries on AMD64
- From: Tom Corr <tcorr@xxxxxxx>
- Date: Thu, 5 Jan 2006 08:22:36 -0500
- Message-id: <200601050822.36666.tcorr@xxxxxxx>
On Thursday 05 January 2006 05:30, Dave Howorth wrote:
I don't know about the other compilers, but "gcc" in SuSE 9.3 and later (these
are the only two I've tested on my x86_64 laptop) recognize the "-m32" flag
for compiling 32 bit applications. Simply, add the "-m32" flag to whenever
you invoke gcc to compile or "link" an application. I believe, although I
can't verify it at this time, there is a "GCCFLAGS" environment variable that
could be set too. Perhaps, google'n this might help...
Anyhow, by passing the "-m32" flag to gcc, gcc will generate 32 bit object
files, and will invoke the linker with the necessary options/libraries to
build a 32 bit application.
When you are done building your application, simple do a "file <app_name>" to
see that it is indeed a 32 bit application.
sorry, i didnt have more time to spend looking up the specifics.
> I've seen a few threads like this with people asking how to compile
> 32-bit binaries on SUSE AMD64. They don't seem to get clear answers.
>
> I'm trying to do such a compilation now and have the same trouble. I've
> looked in the admin and user guides, the Suse Help centre and on the
> suse portal without success. I've browsed www.amd.com and www.x86-64.org
> as suggested in the admin manual but didn't find anything useful.
>
> I hope I'm just being dumb and have missed something. Is there a guide
> to building 32-bit applications on a 64-bit SUSE system?
>
> Thanks, Dave
I don't know about the other compilers, but "gcc" in SuSE 9.3 and later (these
are the only two I've tested on my x86_64 laptop) recognize the "-m32" flag
for compiling 32 bit applications. Simply, add the "-m32" flag to whenever
you invoke gcc to compile or "link" an application. I believe, although I
can't verify it at this time, there is a "GCCFLAGS" environment variable that
could be set too. Perhaps, google'n this might help...
Anyhow, by passing the "-m32" flag to gcc, gcc will generate 32 bit object
files, and will invoke the linker with the necessary options/libraries to
build a 32 bit application.
When you are done building your application, simple do a "file <app_name>" to
see that it is indeed a 32 bit application.
sorry, i didnt have more time to spend looking up the specifics.
> I've seen a few threads like this with people asking how to compile
> 32-bit binaries on SUSE AMD64. They don't seem to get clear answers.
>
> I'm trying to do such a compilation now and have the same trouble. I've
> looked in the admin and user guides, the Suse Help centre and on the
> suse portal without success. I've browsed www.amd.com and www.x86-64.org
> as suggested in the admin manual but didn't find anything useful.
>
> I hope I'm just being dumb and have missed something. Is there a guide
> to building 32-bit applications on a 64-bit SUSE system?
>
> Thanks, Dave
| < Previous | Next > |