wok-next view gcc/stuff/patches/ada-musl.patch @ rev 21420

updated puzzles ( -> 20200413)
author Hans-G?nter Theisgen
date Mon Apr 27 17:23:45 2020 +0100 (2020-04-27)
parents
children
line source
1 diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
2 index 3b0aea9..ee0bb69 100644
3 --- a/gcc/ada/adaint.c
4 +++ b/gcc/ada/adaint.c
5 @@ -76,6 +76,11 @@
6 #include <sys/param.h>
7 #include <sys/pstat.h>
8 #endif
9 +
10 +#if defined (linux)
11 +#define _GNU_SOURCE 1
12 +#include <sched.h>
13 +#endif
15 #ifdef __PikeOS__
16 #define __BSD_VISIBLE 1
17 @@ -3255,7 +3260,6 @@ __gnat_lwp_self (void)
18 #endif
20 #if defined (__linux__)
21 -#include <sched.h>
23 /* glibc versions earlier than 2.7 do not define the routines to handle
24 dynamically allocated CPU sets. For these targets, we use the static
25 @@ -3265,7 +3269,7 @@ __gnat_lwp_self (void)
27 /* Dynamic cpu sets */
29 -cpu_set_t *
30 +void *
31 __gnat_cpu_alloc (size_t count)
32 {
33 return CPU_ALLOC (count);
34 @@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count)
35 }
37 void
38 -__gnat_cpu_free (cpu_set_t *set)
39 +__gnat_cpu_free (void *set)
40 {
41 - CPU_FREE (set);
42 + CPU_FREE ((cpu_set_t *) set);
43 }
45 void
46 -__gnat_cpu_zero (size_t count, cpu_set_t *set)
47 +__gnat_cpu_zero (size_t count, void *set)
48 {
49 - CPU_ZERO_S (count, set);
50 + CPU_ZERO_S (count, (cpu_set_t *) set);
51 }
53 void
54 -__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
55 +__gnat_cpu_set (int cpu, size_t count, void *set)
56 {
57 /* Ada handles CPU numbers starting from 1, while C identifies the first
58 CPU by a 0, so we need to adjust. */
59 - CPU_SET_S (cpu - 1, count, set);
60 + CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
61 }
63 #else /* !CPU_ALLOC */
65 /* Static cpu sets */
67 -cpu_set_t *
68 +void *
69 __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
70 {
71 - return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
72 + return xmalloc (sizeof (cpu_set_t));
73 }
75 size_t
76 @@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
77 }
79 void
80 -__gnat_cpu_free (cpu_set_t *set)
81 +__gnat_cpu_free (void *set)
82 {
83 free (set);
84 }
86 void
87 -__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
88 +__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
89 {
90 - CPU_ZERO (set);
91 + CPU_ZERO ((cpu_set_t *) set);
92 }
94 void
95 -__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
96 +__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
97 {
98 /* Ada handles CPU numbers starting from 1, while C identifies the first
99 CPU by a 0, so we need to adjust. */
100 - CPU_SET (cpu - 1, set);
101 + CPU_SET (cpu - 1, (cpu_set_t *) set);
102 }
103 #endif /* !CPU_ALLOC */
104 #endif /* __linux__ */
105 diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
106 index 0d12f7e..a063b47 100644
107 --- a/gcc/ada/adaint.h
108 +++ b/gcc/ada/adaint.h
109 @@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void);
111 /* Routines for interface to required CPU set primitives */
113 -#include <sched.h>
114 -
115 -extern cpu_set_t *__gnat_cpu_alloc (size_t);
116 +extern void * __gnat_cpu_alloc (size_t);
117 extern size_t __gnat_cpu_alloc_size (size_t);
118 -extern void __gnat_cpu_free (cpu_set_t *);
119 -extern void __gnat_cpu_zero (size_t, cpu_set_t *);
120 -extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
121 +extern void __gnat_cpu_free (void *);
122 +extern void __gnat_cpu_zero (size_t, void *);
123 +extern void __gnat_cpu_set (int, size_t, void *);
124 #endif
126 #if defined (_WIN32)
127 diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
128 index 7025f57..207b50d 100644
129 --- a/gcc/ada/terminals.c
130 +++ b/gcc/ada/terminals.c
131 @@ -1108,13 +1108,6 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
132 #include <stdio.h>
133 #include <stdlib.h>
135 -/* On some system termio is either absent or including it will disable termios
136 - (HP-UX) */
137 -#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
138 - && !defined (__rtems__) && !defined (__QNXNTO__)
139 -# include <termio.h>
140 -#endif
141 -
142 #include <sys/ioctl.h>
143 #include <termios.h>
144 #include <fcntl.h>
145 diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
146 index ebb955e..08cfbee 100644
147 --- a/gcc/ada/gcc-interface/Makefile.in
148 +++ b/gcc/ada/gcc-interface/Makefile.in
149 @@ -1028,7 +1028,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
150 s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
151 $(TRASYM_DWARF_UNIX_PAIRS) \
152 g-sercom.adb<libgnat/g-sercom__linux.adb \
153 - s-tsmona.adb<libgnat/s-tsmona__linux.adb \
154 + s-tsmona.adb<libgnat/s-tsmona.adb \
155 a-exetim.adb<libgnarl/a-exetim__posix.adb \
156 a-exetim.ads<libgnarl/a-exetim__default.ads \
157 s-linux.ads<libgnarl/s-linux.ads \
158 @@ -1545,7 +1545,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
159 s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
160 g-sercom.adb<libgnat/g-sercom__linux.adb \
161 $(TRASYM_DWARF_UNIX_PAIRS) \
162 - s-tsmona.adb<libgnat/s-tsmona__linux.adb \
163 + s-tsmona.adb<libgnat/s-tsmona.adb \
164 $(ATOMICS_TARGET_PAIRS) \
165 $(ATOMICS_BUILTINS_TARGET_PAIRS) \
166 system.ads<libgnat/system-linux-ppc.ads
167 @@ -1574,7 +1574,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
168 endif
170 # ARM linux, GNU eabi
171 -ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
172 +ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
173 LIBGNAT_TARGET_PAIRS = \
174 a-intnam.ads<libgnarl/a-intnam__linux.ads \
175 s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
176 @@ -1774,7 +1774,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
177 s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
178 g-sercom.adb<libgnat/g-sercom__linux.adb \
179 $(TRASYM_DWARF_UNIX_PAIRS) \
180 - s-tsmona.adb<libgnat/s-tsmona__linux.adb \
181 + s-tsmona.adb<libgnat/s-tsmona.adb \
182 $(ATOMICS_TARGET_PAIRS) \
183 $(ATOMICS_BUILTINS_TARGET_PAIRS) \
184 system.ads<libgnat/system-linux-ia64.ads
185 @@ -1871,7 +1871,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
186 s-taspri.ads<libgnarl/s-taspri__posix.ads \
187 g-sercom.adb<libgnat/g-sercom__linux.adb \
188 $(TRASYM_DWARF_UNIX_PAIRS) \
189 - s-tsmona.adb<libgnat/s-tsmona__linux.adb \
190 + s-tsmona.adb<libgnat/s-tsmona.adb \
191 $(ATOMICS_TARGET_PAIRS) \
192 $(X86_64_TARGET_PAIRS) \
193 system.ads<libgnat/system-linux-x86.ads
194 diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
195 index 207b50d..bd3a02c 100644
196 --- a/gcc/ada/terminals.c
197 +++ b/gcc/ada/terminals.c
198 @@ -1152,7 +1152,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
199 #if defined (__APPLE__) || defined (BSD)
200 #define USE_OPENPTY
201 #elif defined (__linux__)
202 -#define USE_GETPT
203 +#define USE_POSIX_OPENPT
204 #elif defined (__sun__)
205 #define USE_CLONE_DEVICE "/dev/ptmx"
206 #elif defined (_AIX)
207 @@ -1201,8 +1201,8 @@ allocate_pty_desc (pty_desc **desc) {
208 int master_fd = -1;
209 char *slave_name = NULL;
211 -#ifdef USE_GETPT
212 - master_fd = getpt ();
213 +#ifdef USE_POSIX_OPENPT
214 + master_fd = posix_openpt(O_RDWR | O_NOCTTY);
215 #elif defined (USE_OPENPTY)
216 status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
217 #elif defined (USE_CLONE_DEVICE)