diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-05-18 00:21:56 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-05-18 00:24:46 +0200 |
commit | 5812e1bbb1c8a7a90d995a0165cddae4d450d6cf (patch) | |
tree | 383d06a013feb57ba25a1608210cf6a649f7d382 /gcc/ada/libgnarl | |
parent | 4e3bb431bbf2802bcf8e5d983dd1450f719d6ac7 (diff) | |
download | gcc-5812e1bbb1c8a7a90d995a0165cddae4d450d6cf.zip gcc-5812e1bbb1c8a7a90d995a0165cddae4d450d6cf.tar.gz gcc-5812e1bbb1c8a7a90d995a0165cddae4d450d6cf.tar.bz2 |
Fix Ada runtime library breakage on Solaris
The recent changes made to the runtime library broke its build on Solaris
because it uses Solaris threads instead of POSIX threads on this platform.
gcc/ada/
PR ada/115133
* libgnarl/s-osinte__solaris.ads (mutex_t): Fix typo.
* libgnarl/s-taprop__solaris.adb (Record_Lock): Add conversion.
(Check_Sleep): Likewise.
(Record_Wakeup): Likewise.
(Check_Unlock): Likewise.
* libgnarl/s-tasini.adb (Initialize_RTS_Lock): Add pragma Import
on the overlaid variable.
(Finalize_RTS_Lock): Likewise.
(Acquire_RTS_Lock): Likewise.
(Release_RTS_Lock): Likewise.
* libgnarl/s-taspri__solaris.ads (To_RTS_Lock_Ptr): New instance
of Ada.Unchecked_Conversion.
* libgnat/s-oslock__solaris.ads: Add with clause for
Ada.Unchecked_Conversion.
(array_type_9): Add missing name qualification.
(record_type_3): Likewise.
(mutex_t): Fix formatting.
Diffstat (limited to 'gcc/ada/libgnarl')
-rw-r--r-- | gcc/ada/libgnarl/s-osinte__solaris.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnarl/s-taprop__solaris.adb | 8 | ||||
-rw-r--r-- | gcc/ada/libgnarl/s-tasini.adb | 4 | ||||
-rw-r--r-- | gcc/ada/libgnarl/s-taspri__solaris.ads | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/gcc/ada/libgnarl/s-osinte__solaris.ads b/gcc/ada/libgnarl/s-osinte__solaris.ads index 12ad52b..3703697 100644 --- 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; diff --git a/gcc/ada/libgnarl/s-taprop__solaris.adb b/gcc/ada/libgnarl/s-taprop__solaris.adb index 88b77b0..82e51b8 100644 --- a/gcc/ada/libgnarl/s-taprop__solaris.adb +++ b/gcc/ada/libgnarl/s-taprop__solaris.adb @@ -1399,7 +1399,7 @@ package body System.Task_Primitives.Operations is P := Self_ID.Common.LL.Locks; if P /= null then - L.Next := P; + L.Next := To_RTS_Lock_Ptr (P); end if; Self_ID.Common.LL.Locking := null; @@ -1440,7 +1440,7 @@ package body System.Task_Primitives.Operations is Self_ID.Common.LL.L.Owner := null; P := Self_ID.Common.LL.Locks; - Self_ID.Common.LL.Locks := Self_ID.Common.LL.Locks.Next; + Self_ID.Common.LL.Locks := To_Lock_Ptr (Self_ID.Common.LL.Locks.Next); P.Next := null; return True; end Check_Sleep; @@ -1468,7 +1468,7 @@ package body System.Task_Primitives.Operations is P := Self_ID.Common.LL.Locks; if P /= null then - L.Next := P; + L.Next := To_RTS_Lock_Ptr (P); end if; Self_ID.Common.LL.Locking := null; @@ -1549,7 +1549,7 @@ package body System.Task_Primitives.Operations is L.Owner := null; P := Self_ID.Common.LL.Locks; - Self_ID.Common.LL.Locks := Self_ID.Common.LL.Locks.Next; + Self_ID.Common.LL.Locks := To_Lock_Ptr (Self_ID.Common.LL.Locks.Next); P.Next := null; return True; end Check_Unlock; diff --git a/gcc/ada/libgnarl/s-tasini.adb b/gcc/ada/libgnarl/s-tasini.adb index 794183f..d42d288 100644 --- a/gcc/ada/libgnarl/s-tasini.adb +++ b/gcc/ada/libgnarl/s-tasini.adb @@ -246,6 +246,7 @@ package body System.Tasking.Initialization is procedure Initialize_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Initialize_Lock (Lock'Unchecked_Access, PO_Level); @@ -258,6 +259,7 @@ package body System.Tasking.Initialization is procedure Finalize_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Finalize_Lock (Lock'Unchecked_Access); @@ -270,6 +272,7 @@ package body System.Tasking.Initialization is procedure Acquire_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Write_Lock (Lock'Unchecked_Access); @@ -282,6 +285,7 @@ package body System.Tasking.Initialization is procedure Release_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Unlock (Lock'Unchecked_Access); diff --git a/gcc/ada/libgnarl/s-taspri__solaris.ads b/gcc/ada/libgnarl/s-taspri__solaris.ads index ca40229..16fc419 100644 --- a/gcc/ada/libgnarl/s-taspri__solaris.ads +++ b/gcc/ada/libgnarl/s-taspri__solaris.ads @@ -47,6 +47,8 @@ package System.Task_Primitives is function To_Lock_Ptr is new Ada.Unchecked_Conversion (OS_Locks.RTS_Lock_Ptr, Lock_Ptr); + function To_RTS_Lock_Ptr is + new Ada.Unchecked_Conversion (Lock_Ptr, OS_Locks.RTS_Lock_Ptr); type Suspension_Object is limited private; -- Should be used for the implementation of Ada.Synchronous_Task_Control |