https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115133

            Bug ID: 115133
           Summary: [15 regression] s-oslock__solaris.ads doesn't compile
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: dkm at gcc dot gnu.org, ebotcazou at gcc dot gnu.org
  Target Milestone: ---
            Target: *-*-solaris2.11

The new gcc/ada/libgnat/s-oslock__solaris.ads from

commit c8e5d90c4a0b736c2c4c5be3e8a3e9744e602d9d
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Tue Mar 5 23:30:51 2024 +0100

    ada: Replace spinlocks with fully-fledged locks in finalization collections

breaks Solaris Ada bootstrap:

s-oslock.ads:50:10: error: "Ada" is not visible
s-oslock.ads:50:10: error: non-visible declaration at ada.ads:16

This snippet got me further along:

diff --git a/gcc/ada/libgnat/s-oslock__solaris.ads
b/gcc/ada/libgnat/s-oslock__solaris.ads
--- a/gcc/ada/libgnat/s-oslock__solaris.ads
+++ b/gcc/ada/libgnat/s-oslock__solaris.ads
@@ -32,6 +32,7 @@
 --  This is a Solaris (native) version of this package

 with Interfaces.C;
+with Ada.Unchecked_Conversion;

 package System.OS_Locks is
    pragma Preelaborate;
@@ -65,10 +66,10 @@ package System.OS_Locks is

 private

-   type array_type_9 is array (0 .. 3) of unsigned_char;
+   type array_type_9 is array (0 .. 3) of Interfaces.C.unsigned_char;
    type record_type_3 is record
       flag  : array_type_9;
-      Xtype : unsigned_long;
+      Xtype : Interfaces.C.unsigned_long;
    end record;
    pragma Convention (C, record_type_3);


but it may not be enough:

a-stbufi.ads:71:04: error: run-time library configuration error
a-stbufi.ads:71:04: error: file s-taskin.ads had semantic errors
a-stbufi.ads:71:04: error: entity "System.Tasking.Activation_Chain_Access" not
available
s-osinte.ads:301:29: error: "OS_Lock" not declared in "System"
s-osinte.ads:301:30: error: possible misspelling of "OS_Locks"
compilation abandoned
make[6]: *** [../gcc-interface/Makefile:306: a-stbufi.o] Error 1

This patch fixes the typo:

diff --git a/gcc/ada/libgnarl/s-osinte__solaris.ads
b/gcc/ada/libgnarl/s-osinte__solaris.ads
--- a/gcc/ada/libgnarl/s-osinte__solaris.ads
+++ b/gcc/ada/libgnarl/s-osinte__solaris.ads
@@ -298,7 +298,7 @@ package System.OS_Interface is

    function To_thread_t is new Ada.Unchecked_Conversion (Integer, thread_t);

-   subtype mutex_t is System.OS_Lock.mutex_t;
+   subtype mutex_t is System.OS_Locks.mutex_t;

    type cond_t is limited private;

until one runs into

s-oslock.ads:83:03: (style) bad indentation [-gnaty0]
make[6]: *** [../gcc-interface/Makefile:306: a-undesu.o] Error 1

No idea what's wrong here, though.

Reply via email to