Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for large code model is needed for large static arrays (ARM64 ADRP out of range) #100

Open
fherpin opened this issue Nov 16, 2022 · 6 comments

Comments

@fherpin
Copy link

fherpin commented Nov 16, 2022

When compiling a fortran code on my mac M1 (os Monterey) I get the following error. Any idea ?
ARM64 ADRP out of range (6040592384 max is +/-4GB): from velo (0x10000D590) to sourcedp (0x2680CF6F0) in 'velo' from /var/folders/7j/1b_gs76w8xlcf50059bjh4yh0000gp/T//cc18CNIc.o for architecture arm64

@rbspielman-ur
Copy link

I was able to determine that if the size of static arrays exceeds 4 GB the F77 code will not link on M1 Apple Silicon, gcc12.2, Ventura. Your example show a total array size of 6.04 GB. If I shrink my array size to less that 2GB it links and runs.

@rbspielman-ur
Copy link

Background: my code compiles and links on Intel under macOS, Linux Ubuntu, Windows.

@iains
Copy link
Owner

iains commented May 27, 2023

Since you do not show any code, I am guessing that the issue is (as mentioned by @rbspielman-ur) a large static array.

I'd expect that you could work around this by dynamic allocation of that array.

Otherwise, we would need to support the large code model to handle it (and I am not sure when there will be time to implement that).

@iains iains changed the title ARM64 ADRP out of range Support for large code model is needed for large static arrays (ARM64 ADRP out of range) May 27, 2023
@iains
Copy link
Owner

iains commented May 27, 2023

I am going to close this, but we now have issue #100 which is asking for support for the large code model; perhaps that would also be useful in this case.

@iains iains closed this as completed May 27, 2023
@iains iains reopened this May 27, 2023
@iains
Copy link
Owner

iains commented May 27, 2023

I am going to close this, but we now have issue #100 which is asking for support for the large code model; perhaps that would also be useful in this case.

^^^ that was not meant to be attached to this issue but to #88

@cooljeanius
Copy link
Contributor

Otherwise, we would need to support the large code model to handle it (and I am not sure when there will be time to implement that).

(for cross-referencing purposes, I'm pretty sure this is bug 90698 on the gcc bugzilla)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants