void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

libgnarl-musl.patch (5253B)


      1Source: Alpine Linux
      2Upstream: Unknown
      3Reason: Patch libgnarl to not use function missing from musl.
      4
      5diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
      6--- gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
      7+++ gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
      8@@ -394,12 +394,6 @@ package System.OS_Interface is
      9    PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     10    PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
     11 
     12-   function pthread_rwlockattr_setkind_np
     13-     (attr : access pthread_rwlockattr_t;
     14-      pref : int) return int;
     15-   pragma Import
     16-     (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
     17-
     18    function pthread_rwlock_init
     19      (mutex : access pthread_rwlock_t;
     20       attr  : access pthread_rwlockattr_t) return int;
     21@@ -464,11 +458,6 @@ package System.OS_Interface is
     22       protocol : int) return int;
     23    pragma Import (C, pthread_mutexattr_setprotocol);
     24 
     25-   function pthread_mutexattr_setprioceiling
     26-     (attr        : access pthread_mutexattr_t;
     27-      prioceiling : int) return int;
     28-   pragma Import (C, pthread_mutexattr_setprioceiling);
     29-
     30    type struct_sched_param is record
     31       sched_priority : int;  --  scheduling priority
     32    end record;
     33diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
     34--- gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
     35+++ gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
     36@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
     37    pragma Import
     38      (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
     39 
     40-   function GNAT_has_cap_sys_nice return C.int;
     41-   pragma Import
     42-     (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice");
     43    --  We do not have pragma Linker_Options ("-lcap"); here, because this
     44    --  library is not present on many Linux systems. 'libcap' is the Linux
     45    --  "capabilities" library, called by __gnat_has_cap_sys_nice.
     46@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
     47    --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     48    --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
     49 
     50-   function Get_Ceiling_Support return Boolean;
     51-   --  Get the value of the Ceiling_Support constant (see below).
     52-   --  Note well: If this function or related code is modified, it should be
     53-   --  tested by hand, because automated testing doesn't exercise it.
     54-
     55-   -------------------------
     56-   -- Get_Ceiling_Support --
     57-   -------------------------
     58-
     59-   function Get_Ceiling_Support return Boolean is
     60-      Ceiling_Support : Boolean := False;
     61-   begin
     62-      if Locking_Policy /= 'C' then
     63-         return False;
     64-      end if;
     65-
     66-      declare
     67-         function geteuid return Integer;
     68-         pragma Import (C, geteuid, "geteuid");
     69-         Superuser : constant Boolean := geteuid = 0;
     70-         Has_Cap : constant C.int := GNAT_has_cap_sys_nice;
     71-         pragma Assert (Has_Cap in 0 | 1);
     72-      begin
     73-         Ceiling_Support := Superuser or else Has_Cap = 1;
     74-      end;
     75-
     76-      return Ceiling_Support;
     77-   end Get_Ceiling_Support;
     78-
     79-   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
     80-   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
     81-   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
     82    --  True if the locking policy is Ceiling_Locking, and the current process
     83    --  has permission to use this policy. The process has permission if it is
     84    --  running as 'root', or if the capability was set by the setcap command,
     85@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
     86    -- Init_Mutex --
     87    ----------------
     88 
     89+   pragma Warnings (Off, "formal parameter * is not referenced");
     90    function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is
     91+   pragma Warnings (On, "formal parameter * is not referenced");
     92       Mutex_Attr : aliased pthread_mutexattr_t;
     93       Result, Result_2 : C.int;
     94 
     95@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
     96          return Result;
     97       end if;
     98 
     99-      if Ceiling_Support then
    100-         Result := pthread_mutexattr_setprotocol
    101-           (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT);
    102-         pragma Assert (Result = 0);
    103-
    104-         Result := pthread_mutexattr_setprioceiling
    105-           (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio));
    106-         pragma Assert (Result = 0);
    107-
    108-      elsif Locking_Policy = 'I' then
    109+      if Locking_Policy = 'I' then
    110          Result := pthread_mutexattr_setprotocol
    111            (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
    112          pragma Assert (Result = 0);
    113@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
    114             Result := pthread_rwlockattr_init (RWlock_Attr'Access);
    115             pragma Assert (Result = 0);
    116 
    117-            Result := pthread_rwlockattr_setkind_np
    118-              (RWlock_Attr'Access,
    119-               PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
    120-            pragma Assert (Result = 0);
    121-
    122             Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
    123 
    124             pragma Assert (Result in 0 | ENOMEM);
    125