More than 2Gb of static memory with powerpc64

Tiago Pereira tiagomdp@gmail.com
Wed Apr 22 08:43:00 GMT 2009


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



More information about the Gcc-help mailing list