With the following test program written for the RP2040 microcontroller:
procedure test_new is
type Thing is record
x : Integer;
y : Integer;
end record;
type ThingAccess is access Thing;
T : ThingAccess;
begin
T := new Thing'(1, 2);
end test_new;
I get the following link errors:
/home/pmunts/.local/share/alire/toolchains/gnat_arm_elf_15.2.1_a5e9cfb1/bin/../lib/gcc/arm-eabi/15.2.0/../../../../arm-eabi/bin/ld: /home/pmunts/.local/share/alire/builds/light_tasking_rp2040_15.2.0_8e0bd80e/24231be1c545c807cb2fe471458694876552a82aa399c1eb37d1daa261d6f92e/adalib/libgnat.a(s-memory.o): in function `__gnat_malloc':
s-memory.adb:(.text.__gnat_malloc+0x30): undefined reference to `__atomic_compare_exchange_4'
/home/pmunts/.local/share/alire/toolchains/gnat_arm_elf_15.2.1_a5e9cfb1/bin/../lib/gcc/arm-eabi/15.2.0/../../../../arm-eabi/bin/ld: (__atomic_compare_exchange_4): Unknown destination type (ARM/Thumb) in /home/pmunts/.local/share/alire/builds/light_tasking_rp2040_15.2.0_8e0bd80e/24231be1c545c807cb2fe471458694876552a82aa399c1eb37d1daa261d6f92e/adalib/libgnat.a(s-memory.o)
s-memory.adb:(.text.__gnat_malloc+0x30): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
gprbuild: link of test_new.adb failed
I’m using light_tasking_rp2040 and rp2040_hal:
authors = [
"Philip Munts",
]
description = "Phil's RP2040 Light Tasking Firmware Template"
executables = [
"test_new",
]
licenses = "BSD-1-Clause"
maintainers = [
"Philip Munts <phil@munts.net>",
]
maintainers-logins = [
"pmunts",
]
name = "test_new"
tags = [
"embedded",
"gpio",
"microcontroller",
"rp2040",
]
version = "2.24798.1"
[configuration]
auto_gpr_with = true
disabled = false
generate_ada = true
generate_c = true
generate_gpr = true
output_dir = "config"
[configuration.values]
[configuration.values.light_tasking_rp2040]
Board = "generic_board"
Max_CPUs = 2
[configuration.values.rp2040_hal]
Interrupts = "bb_runtimes"
Use_Startup = false
[[actions]]
command = [
"sh",
"-c",
"./postbuild.sh",
]
directory = "."
type = "post-build"
[[depends-on]]
light_tasking_rp2040 = "*"
rp2040_hal = "^2"
Is dynamic allocation supposed to be supported on the RP2040?