gcc running on AMD x86-64 emitting objects for x86?

Jonathan Berry berryja at gmail.com
Sun Jan 23 21:41:45 UTC 2005


On Sun, 23 Jan 2005 13:31:33 -0800, Jonathan Ryshpan
<jonrysh at pacbell.net> wrote:
> Is such a thing available?
> 
> I need to compile a source that has a large number of bad casts between
> pointer and integer, and would prefer to just compile a 32-bit object,
> rather than fixing the source.  I assume that the 32-bit object will run
> on my machine (provided that I have installed all of the libraries
> needed).
> --
> Jonathan Ryshpan <jonrysh at pacbell.net>
> Berkeley Linux Team

Hi Jonathan,

You can compile a 32-bit object file by specifying the -m32 flag to
gcc, I believe.  One alternative that I have used is to use the 32-bit
compiler (a 32-bit gcc 2.96 or so was included in FC2, not sure about
3, haven't checked it out).  But I believe the -m32 flag is what you
want.
Out of curiosity, what kind of statements do you get the cast
warnings?  I ask because I would get that when using malloc() without
#include-ing the proper header (<stdlib.h> I believe).  Perhaps this
is your problem.
Yes, as long as you have installed the 32-bit libraries needed, the
x86_64 processor runs 32-bit binaries just fine.

Jonathan




More information about the fedora-list mailing list