From 9713c591b2028effe615d8206c06cce5e113348a Mon Sep 17 00:00:00 2001 From: Kevin Dinkel <1225857+dinkelk@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:02:22 -0600 Subject: [PATCH 1/2] Add C/C++ support to bareboard targets --- redo/targets/gpr/a_bareboard_development.gpr | 6 ++++++ redo/targets/gpr/a_bareboard_production.gpr | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/redo/targets/gpr/a_bareboard_development.gpr b/redo/targets/gpr/a_bareboard_development.gpr index e44a783f..4107967f 100644 --- a/redo/targets/gpr/a_bareboard_development.gpr +++ b/redo/targets/gpr/a_bareboard_development.gpr @@ -13,6 +13,12 @@ abstract project a_bareboard_development extends all "a_bareboard_production.gpr -- This combined with Initialize_Scalars, below, greatly aids in discovering uninitializated -- variable bugs. ("-gnatVa"); + + for Switches ("C") use a_bareboard_base.Compiler'Switches ("C"); + + for Switches ("C++") use a_bareboard_base.Compiler'Switches ("C++"); + + for Switches ("Asm_Cpp") use a_bareboard_base.Compiler'Switches ("Asm_Cpp"); end Compiler; end a_bareboard_development; diff --git a/redo/targets/gpr/a_bareboard_production.gpr b/redo/targets/gpr/a_bareboard_production.gpr index 19a50b95..dcf5e5b2 100644 --- a/redo/targets/gpr/a_bareboard_production.gpr +++ b/redo/targets/gpr/a_bareboard_production.gpr @@ -18,6 +18,10 @@ abstract project a_bareboard_production extends all "a_bareboard_base.gpr" is -- optimization ("-O2"); + for Switches ("C++") use a_bareboard_base.Compiler'Switches ("C++") & + -- optimization + ("-O2"); + for Switches ("Asm_Cpp") use a_bareboard_base.Compiler'Switches ("Asm_Cpp") & -- optimization ("-O2"); From 6fcea3fd80024dadb80274b0fd06bcd6e79731c7 Mon Sep 17 00:00:00 2001 From: Kevin Dinkel <1225857+dinkelk@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:02:50 -0600 Subject: [PATCH 2/2] Add bareboard safe target --- redo/targets/gpr/a_bareboard_safe.gpr | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 redo/targets/gpr/a_bareboard_safe.gpr diff --git a/redo/targets/gpr/a_bareboard_safe.gpr b/redo/targets/gpr/a_bareboard_safe.gpr new file mode 100644 index 00000000..e01d7be7 --- /dev/null +++ b/redo/targets/gpr/a_bareboard_safe.gpr @@ -0,0 +1,29 @@ +abstract project a_bareboard_safe extends all "a_bareboard_base.gpr" is + + -- This is a "safe" target which has no optimization and no runtime checks enabled. + -- It is meant for "fallback" images, which need to have substantially different binaries + -- than production images to work around compiler bugs and boot loops caused from Ada + -- runtime checks. It is recommended to pair this with a runtime that also has optimizations + -- disabled. + package Compiler is + -- Add preprocessor definitions and configuration pragma switches: + for Switches ("Ada") use a_bareboard_base.Compiler'Switches ("Ada") & + -- No optimization + ("-O0") & + -- Suppress ALL runtime checking; + ("-gnatp"); + + for Switches ("C") use a_bareboard_base.Compiler'Switches ("C") & + -- No optimization + ("-O0"); + + for Switches ("C++") use a_bareboard_base.Compiler'Switches ("C++") & + -- No optimization + ("-O0"); + + for Switches ("Asm_Cpp") use a_bareboard_base.Compiler'Switches ("Asm_Cpp") & + -- No optimization + ("-O0"); + end Compiler; + +end a_bareboard_safe;