On Wed, Feb 5, 2020 at 7:38 PM <j...@bitminer.ca> wrote:

> I am encountering a linker error when compiling with ports-gcc Fortran:
>
> ld: error: lbug2.f90:(function MAIN__: .text+0x80): relocation
> R_X86_64_PC32 out o
> f range: 2456507324 is not in [-2147483648, 2147483647]
>
> The code has several large arrays, the total size of which exceeds 2GB.
>
> Is this a linker issue, a gcc fortran issue, or a pebkac?
>

It's at least a gnu fortran issue: it needs to generate object code in a
larger "model" than it currently is.  I've never used gnu fortran, but it
might accept the -mcmodel=medium option like gcc and generate code
sequences for data symbols that don't limit them to the bottom 2GB (or to
within 2GB of the involved code, depending on gcc's choices in implementing
the model).

If it doesn't accept that option, then you'll need to work with the the
docs, mailling lists, etc of the upstream gnu fortran project about how to
have it generate code for the medium or large data models per the amd64 ABI.


Philip Guenther

Reply via email to