From 35827ca717e3a3552fc513453fd37d1aeb339382 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 27 May 2025 12:17:06 +0200 Subject: [PATCH] ada: Fix ALI elaboration flags for ghost compilation units (cont.) When GNAT was compiling a ghost unit, the ALI file wrongly suggested that this unit required elaboration counters, which caused linking errors to non-existing objects. gcc/ada/ChangeLog: * sem_ch10.adb (Analyze_Compilation_Unit): Ignored ghost unit need no elaboration checks. --- gcc/ada/sem_ch10.adb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 45aabadf21f..3a44149aeff 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -1491,6 +1491,10 @@ package body Sem_Ch10 is -- No checks required if no separate spec or else Acts_As_Spec (N) + + -- No checked needed for ignored ghost units + + or else Is_Ignored_Ghost_Entity (Spec_Id) ) then -- This is a case where we only need the entity for checking to -- 2.47.3