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

Ada 2022 support in gnat_arm_elf #69

Open
dinkelk opened this issue Jun 28, 2024 · 6 comments
Open

Ada 2022 support in gnat_arm_elf #69

dinkelk opened this issue Jun 28, 2024 · 6 comments

Comments

@dinkelk
Copy link

dinkelk commented Jun 28, 2024

I am not sure if this it the right place to ask this, so please redirect if needed.

I tried to enable the -gnat2022 flag in a project I am working on that uses the embedded-rpi-pico runtime supplied in the gnat_arm_elf Alire crate. However, when doing so I get many compiler errors like:

xxx.ads:223:04: error: instantiation error at yyy.ads:304
xxx.ads:223:04: error: construct not allowed in configurable run-time mode
xxx.ads:223:04: error: file s-putaim.ads not found
xxx.ads:223:04: error: entity "System.Put_Task_Images.Put_Image_Protected" not available

It seems like s-putaim.ads is not yet included in the arm tasking/embedded runtimes? Is this expected? Is Ada 2022 support going to arrive for the arm runtimes in the future? Thanks!

@Fabien-Chouteau
Copy link
Member

Hello @dinkelk, the embedded runtimes do not support all the features of Ada.
This is what the message "construct not allowed in configurable run-time mode" means.

@dinkelk
Copy link
Author

dinkelk commented Jul 1, 2024

Hi @Fabien-Chouteau. I do understand that, but I guess that it is just a bummer that this code compiles fine without the -gnat2022 flag. I do not use System.Put_Task_Images.Put_Image_Protected directly. It seems that -gnat2022 is automatically requiring that to be pulled in. But this fact prevents me from using any -gnat2022 features in this piece of code, even features that would otherwise be supported.

Thank you for replying.

@Fabien-Chouteau
Copy link
Member

Sorry I didn't understand that. Can you send a small piece of code and gpr file that shows the problem.

@dinkelk
Copy link
Author

dinkelk commented Jul 1, 2024

@Fabien-Chouteau - I created a minimal example here: https://github.com/dinkelk/embedded_ada_2022_test

If you run alr build you should see the compilation error. If you comment out the -gnat2022 flag in the .gpr file, it compiles successfully. Thank you for taking a look!

@Fabien-Chouteau
Copy link
Member

Hi @dinkelk, so the issue here is with a task or protected object as field of a record when using an embedded runtime and Ada 2022.

We might do another release to fix this, in the meantime you can copy those two files: s-putaim.ads, s-putaim.adb in the the gnarl directory of your run-time and then recompile it.

@dinkelk
Copy link
Author

dinkelk commented Jul 3, 2024

@Fabien-Chouteau - Thank you! Copying the files has fixed my issue.

dinkelk added a commit to dinkelk/adamant_example that referenced this issue Jul 3, 2024
This applies a temporary fix to the embedded-rpi-pico runtime installed
with the Adamant example repository. It fixes:

alire-project/GNAT-FSF-builds#69

to allow for compilation with the -gnat2022 flag until a new release of
gnat_arm_elf is available, ie.
https://alire.ada.dev/crates/gnat_arm_elf. This will likely be fixed
in some version >14.1.3 and this temporary fix can be reverted.
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

2 participants