-
Notifications
You must be signed in to change notification settings - Fork 12
/
rp2040_hal.gpr
67 lines (55 loc) · 2.2 KB
/
rp2040_hal.gpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
with "config/rp2040_hal_config.gpr";
project Rp2040_Hal is
for Runtime ("Ada") use "light-cortex-m0p";
for Target use "arm-eabi";
Boot_Stage_2 := Project'Project_Dir & "boot2/generated/boot2__" & Rp2040_Hal_Config.Flash_Chip & ".S";
Linker_Script := Project'Project_Dir & "ld/memmap_default.ld";
Linker_Switches := (
"-T", Linker_Script,
Boot_Stage_2,
"-Wl,--no-warn-rwx-segments",
"-Wl,--no-warn-execstack"
-- These warnings were added in binutils 2.39
--
-- The boot ROM isn't loading ELF sections, it's just jumping into the
-- code, so the linker section permission bits don't matter in this
-- context. Therefore, these linker warnings are irrelevant.
-- https://lore.kernel.org/all/CACPK8Xe4hEB3wkRc4W2dNQ+ChonsKtWGCVPpoOFdjdfpbK88Mg@mail.gmail.com/T/
);
for Library_Name use "Rp2040_Hal";
for Library_Version use Project'Library_Name & ".so." & Rp2040_Hal_Config.Crate_Version;
Startup_Dirs := ();
case Rp2040_Hal_Config.Use_Startup is
when "True" =>
for Languages use ("Ada", "Asm_Cpp");
Startup_Dirs := ("src/startup");
when others => null;
end case;
for Source_Dirs use
Startup_Dirs &
("src/",
"src/drivers",
"src/svd",
"src/devices/RP2040",
"src/interrupts/" & Rp2040_Hal_Config.Interrupts,
"config/");
for Object_Dir use "obj/" & Rp2040_Hal_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Library_Dir use "lib";
type Library_Type_Type is ("relocatable", "static", "static-pic");
Library_Type : Library_Type_Type :=
external ("RP2040_HAL_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
for Library_Kind use Library_Type;
package Compiler is
for Default_Switches ("Ada") use Rp2040_Hal_Config.Ada_Compiler_Switches &
("-gnatyM120", -- max line length 120
"-gnaty-B", -- don't warn about "and then", "or else" conditionals
"-fno-delete-null-pointer-checks");
end Compiler;
package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;
package Install is
for Artifacts (".") use ("share");
end Install;
end Rp2040_Hal;