Skip to content

Commit eca308e

Browse files
committed
Provide control over -fcallgraph-info in project wizard.
In [GCC PR 104342](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104342) we can see that, if checking out a non-release compiler (e.g. GCC 14.0.1), having `-gnata` and `-fcallgraph-info=su` will cause a crash (in stm32 code, anyway). `-gnata` is used when Build is Debug. This patch amends the Project Wizard so you can specify `CALLGRAPHS=Disabled`. * scripts/project_wizard.py (Build_Checks_Type): renamed to Disabled_Or_Enabled_Type. (Build_Checks): now Disabled_Or_Enabled_Type. (Callgraphs): new, checks external CALLGRAPHS, default Enabled. Used to decide whether to include -fcallgraph-info=su even if Target isn't riscv32-unknown-elf.
1 parent c45af33 commit eca308e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

scripts/project_wizard.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ def ADL_configuration(config, project_directory, project_name,
188188
type Build_Type is ("Debug", "Production");
189189
Build : Build_Type := external ("ADL_BUILD", "Debug");
190190
191-
type Build_Checks_Type is ("Disabled", "Enabled");
192-
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
191+
type Disabled_Or_Enabled_Type is ("Disabled", "Enabled");
192+
Build_Checks : Disabled_Or_Enabled_Type := external ("ADL_BUILD_CHECKS", "Disabled");
193+
Callgraphs : Disabled_Or_Enabled_Type := external ("CALLGRAPHS", "Enabled");
193194
194195
-- Target architecture
195196
"""
@@ -199,11 +200,17 @@ def ADL_configuration(config, project_directory, project_name,
199200
gpr += """
200201
Target := Project'Target;
201202
202-
-- Callgraph info is not available on all architectures
203+
-- Callgraph info is not available on all architectures, and not always
204+
-- desired
203205
Callgraph_Switch := ();
204-
case Target is
205-
when "riscv32-unknown-elf" => null;
206-
when others => Callgraph_Switch := ("-fcallgraph-info=su");
206+
case Callgraphs is
207+
when "Enabled" =>
208+
case Target is
209+
when "riscv32-unknown-elf" => null;
210+
when others => Callgraph_Switch := ("-fcallgraph-info=su");
211+
end case;
212+
when "Disabled" =>
213+
null;
207214
end case;
208215
209216
Build_Checks_Switches := ();

0 commit comments

Comments
 (0)