This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question about compiling in a 64 bits system


>>>>> Samuel Gaudard writes:

> I'm porting an application from AIX 4.3 (32 bits) to AIX 5.2 (64 bits). So
> i have to recompile all my source files.
> I've installed gcc 3.3.2.0 on the new server.
> If i compile using : gcc -g -o example example.c , will it compile in 64
> bits mode ? (as the os is 64 bits)
> 
> Do i have to compile using the -maix64 flag ?
> 
> eg : gcc -maix64 -g -o example example.c
> to get a 64 bit binary?

	[It helps to mention AIX in the subject line when one asks an
AIX-specific question.]

	AIX 4.3 supports both 64 bit applications (on 64 bit systems) and
32 bit applications.  AIX 5.2 also supports both 32 bit applications and
64 bit applications.

	GCC defaults to 32 bit mode when compiling for AIX.  There is no
reason to compile an application in 64 bit mode unless one needs a
specific 64 bit feature (64 bit addressing or fast 64 bit integer
computation).

	Most applications compiled on AIX 4.3 will run on AIX 5.2 without
recompilation.  Recompiling may help with some functionality.

aix52$ gcc -g -o example example.c

will produce a 32 bit executable that will run on AIX 5.2.

aix52$ gcc -maix64 -g -o example example.c

will produce a 64 bit executable that will run on AIX 5.2, but there is no
reason to use the -maix64 option if the application does not need it.

David

	P.S. Please do not send messages to public mailinglists with
boilerplate that the "message contains information that may be privileged
or confidential".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]