public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* question about compiling in a 64 bits system
@ 2004-11-30 10:56 Samuel Gaudard
  2004-12-03  5:43 ` David Edelsohn
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Gaudard @ 2004-11-30 10:56 UTC (permalink / raw)
  To: gcc-help


Hello,

I have a very simple question :

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 ?


Thanks in advance,

Samuel


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about compiling in a 64 bits system
  2004-11-30 10:56 question about compiling in a 64 bits system Samuel Gaudard
@ 2004-12-03  5:43 ` David Edelsohn
  2004-12-03  9:18   ` Samuel Gaudard
  0 siblings, 1 reply; 4+ messages in thread
From: David Edelsohn @ 2004-12-03  5:43 UTC (permalink / raw)
  To: Samuel Gaudard; +Cc: gcc-help

>>>>> 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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about compiling in a 64 bits system
  2004-12-03  5:43 ` David Edelsohn
@ 2004-12-03  9:18   ` Samuel Gaudard
  2004-12-03 15:12     ` David Edelsohn
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Gaudard @ 2004-12-03  9:18 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc-help


Thanks for the answer.

The choice to compile in 64 bits comes from our customer even though we can
advise him not to. Our priority on this application is performance and
stability. I was wondering if using 32 bits binaries under a 64 bit os would
slow down the execution (as the os deals with 64 bits blocks). If you have
any idea about that.

About your last point, i'm affraid i don't have the choice. The signature of
our mails is added by our mail server, so we cannot decide wether to put it
or not.

Regards,

Samuel

----- Original Message -----
From: "David Edelsohn" <dje@watson.ibm.com>
To: "Samuel Gaudard" <sgaudard@capgemini.fr>
Cc: <gcc-help@gcc.gnu.org>
Sent: Friday, December 03, 2004 6:43 AM
Subject: 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".


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about compiling in a 64 bits system
  2004-12-03  9:18   ` Samuel Gaudard
@ 2004-12-03 15:12     ` David Edelsohn
  0 siblings, 0 replies; 4+ messages in thread
From: David Edelsohn @ 2004-12-03 15:12 UTC (permalink / raw)
  To: Samuel Gaudard; +Cc: gcc-help

>>>>> Samuel Gaudard writes:

Samuel> The choice to compile in 64 bits comes from our customer even though we can
Samuel> advise him not to. Our priority on this application is performance and
Samuel> stability. I was wondering if using 32 bits binaries under a 64 bit os would
Samuel> slow down the execution (as the os deals with 64 bits blocks). If you have
Samuel> any idea about that.

	The performance impact depends on the application.  64 bit
applications double the size of some data and data structures, which will
slow down the application.  If the application requires 64 bit integer
computations, a 64 bit "long" or "long long" running in 64 bit mode will
be faster than a synthesized 64 bit "long long" running in 32 bit mode.
If the application needs to access more data than 32 bit addressing can
reference, it is better to map in all of the data as a 64 bit application
than to manually swap it into a 32 bit address space.  If those issues do
not apply, the application should be compiled as 32 bit.

	I do not understand the comment about 64 bit blocks.  64 bit AIX
kernels run 32 bit applications at full speed.

David

	P.S. Please use a different email account to contact the GCC
Project instead of sending email with boiler plate legal threats.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-03 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-30 10:56 question about compiling in a 64 bits system Samuel Gaudard
2004-12-03  5:43 ` David Edelsohn
2004-12-03  9:18   ` Samuel Gaudard
2004-12-03 15:12     ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).