public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* More than 2Gb of static memory with powerpc64
@ 2009-04-22  8:43 Tiago Pereira
  2009-04-22 21:46 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Tiago Pereira @ 2009-04-22  8:43 UTC (permalink / raw)
  To: gcc-help

Hi,

I am using gfortran/gcc and need to run a fortran program that needs to
create a block with more than 2Gb static memory. (I know this is not
optimal, but it's not my code and it's too hard to change.) This is not
possible in 32-bit systems due to addressing limitations, but is
possible in 64-bit. For x86-64 systems I have managed to get around this
problem by using the compiler flag -mcmodel=medium.

However, I'm having problems compiling the same program in a PowerPC
system (64-bit). It seems to me that the -mcmodel=medium only applies
for x86-64 systems. Compiling the code without any special options will
fail at linking, with this message:

ld: total output size exceeds 2GB (2065MB)

If I include the -mcmodel=medium option then gfortran says it doesn't
know it:

$ gfortran  -O2  -mpowerpc64 -mcmodel=medium   -c -o msline.o msline.f
f951: error: unrecognized command line option "-mcmodel=medium"

I have been using -mpowerpc64 to ensure it compiles a 64-bit version for
the PowerPC, but I don't know how (or if it's possible) to address more
than 2Gb of static memory in this architecture.

I am using Mac OS X 10.5.6, with gcc/gfortran from hpc.sourceforge.net.
The gcc version is 4.4:

$ gfortran --version
GNU Fortran (GCC) 4.4.0 20080801 (experimental)

(I also tried with gcc 4.3 compiled in the same machine with MacPorts,
but the problem persists.)

Anyone have any ideas on how to do this in PowerPC?

Thanks!

Tiago

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

* Re: More than 2Gb of static memory with powerpc64
  2009-04-22  8:43 More than 2Gb of static memory with powerpc64 Tiago Pereira
@ 2009-04-22 21:46 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2009-04-22 21:46 UTC (permalink / raw)
  To: Tiago Pereira; +Cc: gcc-help

> However, I'm having problems compiling the same program in a PowerPC
> system (64-bit). It seems to me that the -mcmodel=medium only applies
> for x86-64 systems.

That is correct.

> I have been using -mpowerpc64 to ensure it compiles a 64-bit  
> version for
> the PowerPC, but I don't know how (or if it's possible) to address  
> more
> than 2Gb of static memory in this architecture.

-mpowerpc64 enables the use of 64-bit instructions, and treats the
general purpose registers as 64-bit; it does not make your program
a 64-bit program, use -m64 for that.


Segher

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

end of thread, other threads:[~2009-04-22 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22  8:43 More than 2Gb of static memory with powerpc64 Tiago Pereira
2009-04-22 21:46 ` Segher Boessenkool

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