]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix ALI elaboration flags for ghost compilation units (cont.)
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 27 May 2025 10:17:06 +0000 (12:17 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:18 +0000 (10:16 +0200)
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

index 45aabadf21f8edfc6a0d4b4fb97f867d1274fdc2..3a44149aeffcdf5854b892626dde331346597814 100644 (file)
@@ -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