Ravenports generated: 09 Dec 2020 06:08
[ravenports.git] / bucket_D5 / gnatcross-bootstrap
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               gnatcross-bootstrap
4 VERSION=                9.3.0
5 KEYWORDS=               lang
6 VARIANTS=               standard
7 SDESC[standard]=        Gnatcross-to-native compiler generator
8 HOMEPAGE=               http://www.dragonlace.net/
9 CONTACT=                John_Marino[draco@marino.st]
10
11 DOWNLOAD_GROUPS=        main mpfr iconv mpc gmp
12 SITES[mpfr]=            http://www.mpfr.org/mpfr-3.1.4/
13 SITES[main]=            GCC/releases/gcc-9.3.0
14 SITES[iconv]=           GNU/libiconv
15 SITES[mpc]=             GNU/mpc
16 SITES[gmp]=             GNU/gmp
17 DISTFILE[1]=            gcc-9.3.0.tar.xz:main
18 DISTFILE[2]=            mpfr-3.1.4.tar.xz:mpfr
19 DISTFILE[3]=            gmp-6.1.0.tar.xz:gmp
20 DISTFILE[4]=            mpc-1.0.3.tar.gz:mpc
21 DISTFILE[5]=            libiconv-1.15.tar.gz:iconv
22 DF_INDEX=               1 2 3 4 5
23 SPKGS[standard]=        single
24
25 OPTIONS_AVAILABLE=      DISABLE FARM64_R11 FAMD64_R12 FI386_R12 SOL10
26 OPTIONS_STANDARD=       DISABLE FARM64_R11 FAMD64_R12 FI386_R12 SOL10
27 OPTGROUP_RADIO=         TARGET
28 OPTDESCR[TARGET]=       Target platform for generated compiler
29 OPTGROUP[TARGET]=       DISABLE FARM64_R11 FAMD64_R12 FI386_R12 SOL10
30 OPT_ON[all]=            DISABLE
31
32 BUILD_DEPENDS=          Zstandard:static:standard
33
34 USES=                   gmake libtool perl:build
35
36 DISTNAME=               gcc-9.3.0
37
38 CC=                     {{BSPREFIX}}/bin/{{TGTSYS}}-gcc
39 CPP=                    {{BSPREFIX}}/bin/{{TGTSYS}}-cpp
40 CXX=                    {{BSPREFIX}}/bin/{{TGTSYS}}-c++
41
42 MUST_CONFIGURE=         yes
43 CONFIGURE_OUTSOURCE=    yes
44 CONFIGURE_ARGS=         --enable-languages="c,c++,ada"
45                         --prefix={{LOCALBASE}}/toolchain/gcc9
46                         --enable-shared
47                         --enable-threads=posix
48                         --enable-checking=release
49                         --disable-libquadmath
50                         --disable-nls
51                         --disable-multilib
52                         --disable-libsanitizer
53                         --disable-libvtv
54                         --disable-libmpx
55                         --disable-libcilkrts
56                         --with-pkgversion="Ravenports"
57                         --enable-obsolete
58 CONFIGURE_ENV=          build_configargs="CPPFLAGS=\"{{CPPFLAGS}}\""
59                         host_configargs="CPPFLAGS=\"{{CPPFLAGS}}\""
60
61 INSTALL_TARGET=         install-strip
62 PLIST_SUB=              TGTSYS={{TGTSYS}}
63
64 [FARM64_R11].DESCRIPTION=               Build native compiler for FreeBSD/ARM64 Release 11
65 [FARM64_R11].BUILD_DEPENDS_ON=          gnatcross:single:FARM64_R11
66 [FARM64_R11].CONFIGURE_ARGS_ON=         --build={{CONFIGURE_TARGET}}
67                                         --host=aarch64-raven-freebsd11.3
68                                         --target=aarch64-raven-freebsd11.3
69                                         --disable-libstdcxx-pch
70 [FARM64_R11].MAKEFILE_ON=               TGTSYS=aarch64-raven-freebsd11.3
71                                         BSPREFIX={{LOCALBASE}}/FreeBSD11_ARM64
72                                         PREPEND_PATH={{BSPREFIX}}/{{TGTSYS}}/bin:{{BSPREFIX}}/bin
73
74 [SOL10].DESCRIPTION=                    Build native compiler for Solaris 10
75 [SOL10].BROKEN_ON=                      Doesn't get pass configure
76 [SOL10].BUILD_DEPENDS_ON=               gnatcross:single:SOL10
77 [SOL10].CONFIGURE_ARGS_ON=              --build={{CONFIGURE_TARGET}}
78                                         --host=x86_64-raven-solaris2.10
79                                         --target=x86_64-raven-solaris2.10
80                                         --disable-libstdcxx-pch
81                                         --disable-multilib
82                                         --with-gnu-ld
83                                         --with-gnu-as
84                                         --with-ld={{LOCALBASE}}/toolchain/bin/ld
85                                         --with-as={{LOCALBASE}}/toolchain/bin/as
86 [SOL10].MAKEFILE_ON=                    TGTSYS=x86_64-raven-solaris2.10
87                                         BSPREFIX={{LOCALBASE}}/Solaris10_AMD64
88                                         PREPEND_PATH={{BSPREFIX}}/{{TGTSYS}}/bin:{{BSPREFIX}}/bin
89 [SOL10].MAKE_ENV_ON=                    ac_cv_header_sys_sysctl_h=no
90                                         ac_cv_header_alloca_h=no
91                                         ac_cv_header_stdio_ext_h=no
92                                         ac_cv_header_malloc_h=no
93                                         ac_cv_func_clearerr_unlocked=no
94                                         ac_cv_func_feof_unlocked=no
95                                         ac_cv_func_ferror_unlocked=no
96                                         ac_cv_func_fileno_unlocked=no
97                                         ac_cv_func_asprintf=no
98                                         ac_cv_func_vasprintf=no
99                                         ac_cv_func_stpcpy=no
100                                         ac_cv_func_strnlen=no
101                                         ac_cv_func_madvise=no
102
103 [FI386_R12].DESCRIPTION=                Build native compiler for FreeBSD/I386 Release 12
104 [FI386_R12].BUILD_DEPENDS_ON=           gnatcross:single:FI386_R12
105 [FI386_R12].CONFIGURE_ARGS_ON=          --build={{CONFIGURE_TARGET}}
106                                         --host=i386-raven-freebsd12.0
107                                         --target=i386-raven-freebsd12.0
108                                         --disable-libstdcxx-pch
109 [FI386_R12].MAKEFILE_ON=                TGTSYS=i386-raven-freebsd12.0
110                                         BSPREFIX={{LOCALBASE}}/FreeBSD12_I386
111                                         PREPEND_PATH={{BSPREFIX}}/{{TGTSYS}}/bin:{{BSPREFIX}}/bin
112
113 [DISABLE].DESCRIPTION=                  Disable building of native compiler (default)
114 [DISABLE].BROKEN_ON=                    Native compiler building disabled (set option!)
115
116 [FAMD64_R12].DESCRIPTION=               Build native compiler for FreeBSD/AMD64 Release 12
117 [FAMD64_R12].BUILD_DEPENDS_ON=          gnatcross:single:FAMD64_R12
118 [FAMD64_R12].CONFIGURE_ARGS_ON=         --build={{CONFIGURE_TARGET}}
119                                         --host=x86_64-raven-freebsd12.0
120                                         --target=x86_64-raven-freebsd12.0
121                                         --disable-libstdcxx-pch
122 [FAMD64_R12].MAKEFILE_ON=               TGTSYS=x86_64-raven-freebsd12.0
123                                         BSPREFIX={{LOCALBASE}}/FreeBSD12_AMD64
124                                         PREPEND_PATH={{BSPREFIX}}/{{TGTSYS}}/bin:{{BSPREFIX}}/bin
125
126 post-patch:
127         # Update LINK_SPEC to add gcc-aux lib runpath in every binary
128         @${ECHO} "Configuring LINK_SPEC runpath"
129         ${REINPLACE_CMD} -e 's;\@PREFIX\@;${PREFIX:H};' \
130                 -e 's;\@GCCAUX\@;${NAMEBASE};' \
131                 ${WRKSRC}/gcc/config/dragonfly.h \
132                 ${WRKSRC}/gcc/config/sol2.h \
133                 ${WRKSRC}/gcc/config/i386/freebsd64.h \
134                 ${WRKSRC}/gcc/config/i386/freebsd.h \
135                 ${WRKSRC}/gcc/config/i386/gnu-user64.h \
136                 ${WRKSRC}/gcc/config/aarch64/aarch64-freebsd.h
137         # fix FreeBSD spec error
138         ${REINPLACE_CMD} -e 's|static:crtbeginT.o%s;||' \
139                 ${WRKSRC}/gcc/config/freebsd-spec.h
140
141 post-stage:
142         # package bootstrap compiler with zstd, then relocate files to avoid packaging them
143         @${MKDIR} ${WRKDIR}/bootstrap_compiler
144         (cd ${STAGEDIR}${PREFIX}/toolchain/gcc9 \
145                 && ${CP} -a bin ${WRKDIR}/bootstrap_compiler \
146                 && ${CP} -a lib ${WRKDIR}/bootstrap_compiler \
147                 && ${CP} -a include ${WRKDIR}/bootstrap_compiler \
148                 && ${CP} -a libexec ${WRKDIR}/bootstrap_compiler)
149         ${ECHO_CMD} "Relocate directories to: ${PREFIX}/toolchain/gcc9" \
150                 >> ${WRKDIR}/bootstrap_compiler/README
151         ${RM} ${WRKDIR}/bootstrap_compiler/bin/${TGTSYS}*
152         ${MV} ${STAGEDIR} ${STAGEDIR}.old
153         ${MKDIR} ${STAGEDIR}${LOCALBASE}/share/${NAMEBASE}
154         (cd ${WRKDIR} && ${TAR} -cf \
155                 ${STAGEDIR}${LOCALBASE}/share/${NAMEBASE}/${TGTSYS}-gcc.tar \
156                 bootstrap_compiler)
157         (cd ${STAGEDIR}${LOCALBASE}/share/${NAMEBASE} && \
158                 zstd -7 --rm ${TGTSYS}-gcc.tar)
159
160 post-patch-FI386_R12-ON:
161         # work around malloc detection issue
162         ${REINPLACE_CMD} -e 's/#undef HAVE_ALIGNED_ALLOC/#define HAVE_ALIGNED_ALLOC 1/' \
163                 ${WRKSRC}/libstdc++-v3/config.h.in
164
165 post-install:
166         cp ${STAGEDIR}${PREFIX}/toolchain/gcc9/bin/gcc ${STAGEDIR}${PREFIX}/toolchain/gcc9/bin/cc
167         cp ${STAGEDIR}${PREFIX}/toolchain/gcc9/bin/g++ ${STAGEDIR}${PREFIX}/toolchain/gcc9/bin/CC
168         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/toolchain/gcc9/lib/gcc/${TGTSYS}/9.3.0/adalib/libgnarl.so
169         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/toolchain/gcc9/lib/gcc/${TGTSYS}/9.3.0/adalib/libgnat.so
170
171 post-install-FARM64_R11-ON:
172         ${RM} -r ${STAGEDIR}${PREFIX}/toolchain/gcc9/lib/gcc/${TGTSYS}/9.3.0/include-fixed
173
174 post-extract:
175         ${MKDIR} ${WRKSRC}/libiconv
176         ${MV} ${WRKDIR}/gmp-*      ${WRKSRC}/gmp
177         ${MV} ${WRKDIR}/mpc-*      ${WRKSRC}/mpc
178         ${MV} ${WRKDIR}/mpfr-*     ${WRKSRC}/mpfr
179         ${MV} ${WRKDIR}/libiconv-* ${WRKSRC}/libiconv
180
181 post-patch-FARM64_R11-ON:
182         # work around malloc detection issue
183         ${REINPLACE_CMD} -e 's/#undef HAVE_ALIGNED_ALLOC/#define HAVE_ALIGNED_ALLOC 1/' \
184                 ${WRKSRC}/libstdc++-v3/config.h.in
185
186 post-install-FI386_R12-ON:
187         ${RM} -r ${STAGEDIR}${PREFIX}/toolchain/gcc9/lib/gcc/${TGTSYS}/9.3.0/include-fixed
188
189 post-install-FAMD64_R12-ON:
190         ${RM} -r ${STAGEDIR}${PREFIX}/toolchain/gcc9/lib/gcc/${TGTSYS}/9.3.0/include-fixed
191
192 post-patch-FAMD64_R12-ON:
193         # work around malloc detection issue
194         ${REINPLACE_CMD} -e 's/#undef HAVE_ALIGNED_ALLOC/#define HAVE_ALIGNED_ALLOC 1/' \
195                 ${WRKSRC}/libstdc++-v3/config.h.in
196
197 [FILE:141:descriptions/desc.single]
198 This package contains a native compiler bootstrapped by a gnatcross
199 cross-compiler.  The target system is determined by the set port option.
200
201
202 [FILE:480:distinfo]
203 71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1     70533868 gcc-9.3.0.tar.xz
204 761413b16d749c53e2bfd2b1dfaa3b027b0e793e404b90b5fbaeef60af6517f5      1122152 mpfr-3.1.4.tar.xz
205 68dadacce515b0f8a54f510edf07c1b636492bcdb8e8d54c56eb216225d16989      1950316 gmp-6.1.0.tar.xz
206 617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3       669925 mpc-1.0.3.tar.gz
207 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178      5264188 libiconv-1.15.tar.gz
208
209
210 [FILE:49:manifests/plist.single]
211 share/gnatcross-bootstrap/%%TGTSYS%%-gcc.tar.zst
212
213
214 [FILE:43251:patches/patch-diff-ada]
215 --- gcc/ada/Makefile.rtl.orig
216 +++ gcc/ada/Makefile.rtl
217 @@ -1377,6 +1377,7 @@
218    s-linux.ads<libgnarl/s-linux__android.ads \
219    s-osinte.adb<libgnarl/s-osinte__android.adb \
220    s-osinte.ads<libgnarl/s-osinte__android.ads \
221 +  g-socthi.adb<libgnat/g-socthi__bsd.adb \
222    s-osprim.adb<libgnat/s-osprim__posix.adb \
223    s-taprop.adb<libgnarl/s-taprop__posix.adb \
224    s-taspri.ads<libgnarl/s-taspri__posix.ads \
225 @@ -1470,6 +1471,7 @@
226    s-osinte.adb<libgnarl/s-osinte__solaris.adb \
227    s-osinte.ads<libgnarl/s-osinte__solaris.ads \
228    s-osprim.adb<libgnat/s-osprim__solaris.adb \
229 +  s-trasym.adb<libgnat/s-trasym__bsd.adb \
230    s-taprop.adb<libgnarl/s-taprop__solaris.adb \
231    s-tasinf.adb<libgnarl/s-tasinf__solaris.adb \
232    s-tasinf.ads<libgnarl/s-tasinf__solaris.ads \
233 @@ -1502,6 +1504,8 @@
234    EXTRA_GNATRTL_NONTASKING_OBJS += $(TRASYM_DWARF_UNIX_OBJS)
235  
236    EH_MECHANISM=-gcc
237 +  EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
238 +  EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
239    THREADSLIB = -lposix4 -lthread
240    MISCLIB = -lposix4 -lnsl -lsocket
241    SO_OPTS = -Wl,-h,
242 @@ -1641,6 +1645,38 @@
243    LIBRARY_VERSION := $(LIB_VERSION)
244  endif
245  
246 +# x86 android
247 +ifeq ($(strip $(filter-out %86 linux-android,$(target_cpu) $(target_os))),)
248 +  LIBGNAT_TARGET_PAIRS = \
249 +  a-intnam.ads<libgnarl/a-intnam__linux.ads \
250 +  s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
251 +  s-intman.adb<libgnarl/s-intman__posix.adb \
252 +  s-linux.ads<libgnarl/s-linux__android.ads \
253 +  s-osinte.adb<libgnarl/s-osinte__android.adb \
254 +  s-osinte.ads<libgnarl/s-osinte__android.ads \
255 +  g-socthi.adb<libgnat/g-socthi__bsd.adb \
256 +  s-osprim.adb<libgnat/s-osprim__posix.adb \
257 +  s-taprop.adb<libgnarl/s-taprop__posix.adb \
258 +  s-taspri.ads<libgnarl/s-taspri__posix.ads \
259 +  s-tpopsp.adb<libgnarl/s-tpopsp__posix-foreign.adb \
260 +  $(ATOMICS_TARGET_PAIRS) \
261 +  $(ATOMICS_BUILTINS_TARGET_PAIRS) \
262 +  system.ads<libgnat/system-linux-x86.ads
263 +
264 +  TOOLS_TARGET_PAIRS = indepsw.adb<indepsw-gnu.adb
265 +
266 +  EXTRA_LIBGNAT_OBJS=
267 +  EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
268 +  EXTRA_GNATRTL_NONTASKING_OBJS=
269 +  EH_MECHANISM=-gcc
270 +  THREADSLIB=
271 +  MISCLIB=
272 +  GMEM_LIB=
273 +  GNATLIB_SHARED = gnatlib-shared-dual
274 +  LIBRARY_VERSION := $(LIB_VERSION)
275 +endif
276 +
277 +
278  # aarch64 FreeBSD
279  ifeq ($(strip $(filter-out %aarch64 freebsd%,$(target_cpu) $(target_os))),)
280    LIBGNAT_TARGET_PAIRS = \
281 @@ -1650,7 +1686,9 @@
282    s-mudido.adb<libgnarl/s-mudido__affinity.adb \
283    s-osinte.adb<libgnarl/s-osinte__freebsd.adb \
284    s-osinte.ads<libgnarl/s-osinte__freebsd.ads \
285 +  g-socthi.adb<libgnat/g-socthi__bsd.adb \
286    s-osprim.adb<libgnat/s-osprim__posix.adb \
287 +  s-trasym.adb<libgnat/s-trasym__bsd.adb \
288    s-taprop.adb<libgnarl/s-taprop__posix.adb \
289    s-taspri.ads<libgnarl/s-taspri__posix.ads \
290    s-tpopsp.adb<libgnarl/s-tpopsp__posix.adb \
291 @@ -1660,6 +1698,9 @@
292  
293    GNATLIB_SHARED = gnatlib-shared-dual
294  
295 +  EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
296 +  EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
297 +
298    EH_MECHANISM=-gcc
299    THREADSLIB= -lpthread
300    GMEM_LIB = gmemlib
301 @@ -1676,7 +1717,9 @@
302    s-mudido.adb<libgnarl/s-mudido__affinity.adb \
303    s-osinte.adb<libgnarl/s-osinte__freebsd.adb \
304    s-osinte.ads<libgnarl/s-osinte__freebsd.ads \
305 +  g-socthi.adb<libgnat/g-socthi__bsd.adb \
306    s-osprim.adb<libgnat/s-osprim__posix.adb \
307 +  s-trasym.adb<libgnat/s-trasym__bsd.adb \
308    s-taprop.adb<libgnarl/s-taprop__posix.adb \
309    s-taspri.ads<libgnarl/s-taspri__posix.ads \
310    s-tpopsp.adb<libgnarl/s-tpopsp__posix.adb \
311 @@ -1687,6 +1730,8 @@
312  
313    GNATLIB_SHARED = gnatlib-shared-dual
314  
315 +  EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
316 +  EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
317    EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
318    EXTRA_GNATRTL_NONTASKING_OBJS += $(TRASYM_DWARF_UNIX_OBJS)
319  
320 @@ -1706,7 +1751,9 @@
321    s-mudido.adb<libgnarl/s-mudido__affinity.adb \
322    s-osinte.adb<libgnarl/s-osinte__freebsd.adb \
323    s-osinte.ads<libgnarl/s-osinte__freebsd.ads \
324 +  g-socthi.adb<libgnat/g-socthi__bsd.adb \
325    s-osprim.adb<libgnat/s-osprim__posix.adb \
326 +  s-trasym.adb<libgnat/s-trasym__bsd.adb \
327    s-taprop.adb<libgnarl/s-taprop__posix.adb \
328    s-taspri.ads<libgnarl/s-taspri__posix.ads \
329    s-tpopsp.adb<libgnarl/s-tpopsp__posix.adb \
330 @@ -1717,6 +1764,8 @@
331  
332    GNATLIB_SHARED = gnatlib-shared-dual
333  
334 +  EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
335 +  EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
336    EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
337    EXTRA_GNATRTL_NONTASKING_OBJS += $(TRASYM_DWARF_UNIX_OBJS)
338  
339 @@ -1736,17 +1785,23 @@
340    s-mudido.adb<libgnarl/s-mudido__affinity.adb \
341    s-osinte.adb<libgnarl/s-osinte__dragonfly.adb \
342    s-osinte.ads<libgnarl/s-osinte__dragonfly.ads \
343 +  g-socthi.adb<libgnat/g-socthi__bsd.adb \
344    s-osprim.adb<libgnat/s-osprim__posix.adb \
345 +  s-trasym.adb<libgnat/s-trasym__bsd.adb \
346    s-taprop.adb<libgnarl/s-taprop__posix.adb \
347    s-taspri.ads<libgnarl/s-taspri__posix.ads \
348    s-tpopsp.adb<libgnarl/s-tpopsp__posix.adb \
349 +  $(TRASYM_DWARF_UNIX_PAIRS) \
350    $(ATOMICS_TARGET_PAIRS) \
351    $(X86_64_TARGET_PAIRS) \
352    system.ads<libgnat/system-dragonfly-x86_64.ads
353  
354    GNATLIB_SHARED = gnatlib-shared-dual
355  
356 -  EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
357 +  EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
358 +  EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
359 +  EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
360 +  EXTRA_GNATRTL_NONTASKING_OBJS += $(TRASYM_DWARF_UNIX_OBJS)
361  
362    EH_MECHANISM=-gcc
363    THREADSLIB= -lpthread
364 --- gcc/ada/adaint.c.orig
365 +++ gcc/ada/adaint.c
366 @@ -1190,6 +1190,47 @@
367      free (pname);
368    }
369  
370 +#elif defined (__ANDROID__)
371 +
372 +  /*
373 +   * ext2 /ext3/ext4/fat16/fat32 have no path limits
374 +   * /data/local/tmp normally requires rooted devices, if it even exists
375 +   * /sdcard is the standard location for external storage.  Nativeactivity
376 +   * manifest needs to authorize its use, otherwise it might not have the
377 +   * proper permissions.
378 +   */
379 +
380 +  int testfd;
381 +  char *datadir = getenv ("ANDROID_DATA");
382 +
383 +  if (datadir == NULL)
384 +    strncpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX", L_tmpnam);
385 +  else
386 +    snprintf (tmp_filename, L_tmpnam, "%s/local/tmp/gnat-XXXXXX", datadir);
387 +
388 +  testfd = mkstemp (tmp_filename);
389 +  if (testfd != -1)
390 +    {
391 +      close (testfd);
392 +      return;
393 +    }
394 +
395 +  char *sdcard = getenv ("EXTERNAL_STORAGE");
396 +
397 +  if (sdcard == NULL)
398 +    strncpy (tmp_filename, "/sdcard/gnat-XXXXXX", L_tmpnam);
399 +  else
400 +    snprintf (tmp_filename, L_tmpnam, "%s/gnat-XXXXXX", sdcard);
401 +
402 +  testfd = mkstemp (tmp_filename);
403 +  if (testfd != -1)
404 +    {
405 +      close (testfd);
406 +      return;
407 +    }
408 +
409 +  tmpnam (tmp_filename);
410 +
411  #elif defined (__linux__) || defined (__FreeBSD__) || defined (__NetBSD__) \
412    || defined (__OpenBSD__) || defined (__GLIBC__) || defined (__ANDROID__) \
413    || defined (__DragonFly__) || defined (__QNX__)
414 --- gcc/ada/cio.c.orig
415 +++ gcc/ada/cio.c
416 @@ -49,7 +49,7 @@
417  
418  /* Don't use macros on GNU/Linux since they cause incompatible changes between
419     glibc 2.0 and 2.1 */
420 -#ifdef __linux__
421 +#if defined __linux__ && !defined __ANDROID__
422  #undef putchar
423  #undef getchar
424  #undef fputc
425 --- gcc/ada/cstreams.c.orig
426 +++ gcc/ada/cstreams.c
427 @@ -67,7 +67,7 @@
428  extern "C" {
429  #endif
430  
431 -#ifdef __linux__
432 +#if defined __linux__ && !defined __ANDROID__
433  /* Don't use macros on GNU/Linux since they cause incompatible changes between
434     glibc 2.0 and 2.1 */
435  
436 --- gcc/ada/gnatchop.adb.orig
437 +++ gcc/ada/gnatchop.adb
438 @@ -44,7 +44,7 @@
439     Config_File_Name : constant String_Access := new String'("gnat.adc");
440     --  The name of the file holding the GNAT configuration pragmas
441  
442 -   Gcc : String_Access := new String'("gcc");
443 +   Gcc : String_Access := new String'("ada");
444     --  May be modified by switch --GCC=
445  
446     Gcc_Set : Boolean := False;
447 --- gcc/ada/gnatlink.adb.orig
448 +++ gcc/ada/gnatlink.adb
449 @@ -136,7 +136,7 @@
450     --  This table collects the arguments to be passed to compile the binder
451     --  generated file.
452  
453 -   Gcc : String_Access := Program_Name ("gcc", "gnatlink");
454 +   Gcc : String_Access := Program_Name ("ada", "gnatlink");
455  
456     Read_Mode : constant String := "r" & ASCII.NUL;
457  
458 --- gcc/ada/gnatls.adb.orig
459 +++ gcc/ada/gnatls.adb
460 @@ -32,7 +32,6 @@
461  with Csets;
462  with Fname;       use Fname;
463  with Gnatvsn;     use Gnatvsn;
464 -with Make_Util;   use Make_Util;
465  with Namet;       use Namet;
466  with Opt;         use Opt;
467  with Osint;       use Osint;
468 @@ -1285,31 +1284,10 @@
469           --  The path name(s) of directories where project files may reside.
470           --  May be empty.
471  
472 -         Prefix  : String_Ptr;
473 -         Runtime : String_Ptr;
474 -
475 -         procedure Add_Target (Suffix : String);
476 -         --  Add :<prefix>/<target>/Suffix to the project path
477 -
478           FD  : File_Descriptor;
479           Len : Integer;
480  
481 -         ----------------
482 -         -- Add_Target --
483 -         ----------------
484 -
485 -         procedure Add_Target (Suffix : String) is
486 -            Extra_Sep : constant String :=
487 -               (if Target_Name (Target_Name'Last) = '/' then
488 -                  ""
489 -                else
490 -                  (1 => Directory_Separator));
491 -            --  Note: Target_Name has a trailing / when it comes from Sdefault
492 -
493 -         begin
494 -            Add_Str_To_Name_Buffer
495 -              (Path_Separator & Prefix.all & Target_Name & Extra_Sep & Suffix);
496 -         end Add_Target;
497 +         pragma Unreferenced (Runtime_Name);
498  
499        --  Start of processing for Initialize_Default_Project_Path
500  
501 @@ -1493,81 +1471,15 @@
502           --  Set the initial value of Current_Project_Path
503  
504           if Add_Default_Dir then
505 -            if Sdefault.Search_Dir_Prefix = null then
506 -
507 -               --  gprbuild case
508 -
509 -               Prefix := new String'(Executable_Prefix_Path);
510 -
511 -            else
512 -               Prefix := new String'(Sdefault.Search_Dir_Prefix.all
513 -                                     & ".." & Dir_Separator
514 -                                     & ".." & Dir_Separator
515 -                                     & ".." & Dir_Separator
516 -                                     & ".." & Dir_Separator);
517 -            end if;
518 -
519 -            if Prefix.all /= "" then
520 -               if Target_Name /= "" then
521 -
522 -                  if Runtime_Name /= "" then
523 -                     if Base_Name (Runtime_Name) = Runtime_Name then
524 -
525 -                        --  $prefix/$target/$runtime/lib/gnat
526 -
527 -                        Add_Target
528 -                          (Runtime_Name & Directory_Separator &
529 -                           "lib" & Directory_Separator & "gnat");
530 -
531 -                        --  $prefix/$target/$runtime/share/gpr
532 -
533 -                        Add_Target
534 -                          (Runtime_Name & Directory_Separator &
535 -                             "share" & Directory_Separator & "gpr");
536 -
537 -                     else
538 -                        Runtime :=
539 -                          new String'(Normalize_Pathname (Runtime_Name));
540 -
541 -                        --  $runtime_dir/lib/gnat
542  
543 -                        Add_Str_To_Name_Buffer
544 -                          (Path_Separator & Runtime.all & Directory_Separator &
545 -                           "lib" & Directory_Separator & "gnat");
546 -
547 -                        --  $runtime_dir/share/gpr
548 -
549 -                        Add_Str_To_Name_Buffer
550 -                          (Path_Separator & Runtime.all & Directory_Separator &
551 -                           "share" & Directory_Separator & "gpr");
552 -                     end if;
553 -                  end if;
554 -
555 -                  --  $prefix/$target/lib/gnat
556 -
557 -                  Add_Target
558 -                    ("lib" & Directory_Separator & "gnat");
559 -
560 -                  --  $prefix/$target/share/gpr
561 -
562 -                  Add_Target
563 -                    ("share" & Directory_Separator & "gpr");
564 -               end if;
565 -
566 -               --  $prefix/share/gpr
567 -
568 -               Add_Str_To_Name_Buffer
569 -                 (Path_Separator & Prefix.all & "share"
570 -                  & Directory_Separator & "gpr");
571 -
572 -               --  $prefix/lib/gnat
573 -
574 -               Add_Str_To_Name_Buffer
575 -                 (Path_Separator & Prefix.all & "lib"
576 -                  & Directory_Separator & "gnat");
577 -            end if;
578 +            --  /raven/share/gpr
579 +            Add_Str_To_Name_Buffer (Path_Separator &
580 +              "@LOCALBASE@/share/gpr");
581 +
582 +            --  /raven/lib/gnat
583 +            Add_Str_To_Name_Buffer (Path_Separator &
584 +              "@LOCALBASE@/lib/gnat");
585  
586 -            Free (Prefix);
587           end if;
588  
589           Self := new String'(Name_Buffer (1 .. Name_Len));
590 --- gcc/ada/make.adb.orig
591 +++ gcc/ada/make.adb
592 @@ -445,7 +445,7 @@
593     -- Compiler, Binder & Linker Data and Subprograms --
594     ----------------------------------------------------
595  
596 -   Gcc      : String_Access := Program_Name ("gcc", "gnatmake");
597 +   Gcc      : String_Access := Program_Name ("ada", "gnatmake");
598     Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
599     Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
600     --  Default compiler, binder, linker programs
601 --- gcc/ada/terminals.c.orig
602 +++ gcc/ada/terminals.c
603 @@ -34,7 +34,7 @@
604  /* First all usupported platforms. Add stubs for exported routines. */
605  
606  #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \
607 -  || defined (__ANDROID__) || defined (__PikeOS__) || defined(__DJGPP__)
608 +  || defined (__PikeOS__) || defined(__DJGPP__)
609  
610  void *
611  __gnat_new_tty (void)
612 @@ -1099,7 +1099,7 @@
613   || defined (__OpenBSD__) \
614   || defined (__NetBSD__)  \
615   || defined (__DragonFly__)
616 -#   define BSD
617 +#   define FREEBSD
618  #endif
619  
620  /* Include every system header we need */
621 @@ -1115,21 +1115,25 @@
622  #include <sys/types.h>
623  #include <sys/wait.h>
624  #include <unistd.h>
625 -#if defined (__sun__)
626 +#if defined (sun)
627  #   include <sys/stropts.h>
628  #endif
629 -#if defined (BSD) || defined (__sun__)
630 +#if defined (FREEBSD) || defined (sun)
631  #   include <sys/signal.h>
632  #endif
633  #if defined (__hpux__)
634  #   include <sys/stropts.h>
635  #endif
636  
637 +#ifdef __ANDROID__
638 +#define CDISABLE _PC_VDISABLE
639 +#else
640  #define CDISABLE _POSIX_VDISABLE
641 +#endif
642  
643  /* On HP-UX and Sun system, there is a bzero function but with a different
644     signature. Use memset instead */
645 -#if defined (__hpux__) || defined (__sun__) || defined (_AIX)
646 +#if defined (__hpux__) || defined (sun) || defined (_AIX)
647  #   define bzero(s,n) memset (s,0,n)
648  #endif
649  
650 @@ -1147,11 +1151,11 @@
651  */
652  
653  /* Configurable part */
654 -#if defined (__APPLE__) || defined (BSD)
655 +#if defined (__APPLE__) || defined (FREEBSD)
656  #define USE_OPENPTY
657 -#elif defined (__linux__)
658 +#elif defined (linux)
659  #define USE_GETPT
660 -#elif defined (__sun__)
661 +#elif defined (sun)
662  #define USE_CLONE_DEVICE "/dev/ptmx"
663  #elif defined (_AIX)
664  #define USE_CLONE_DEVICE "/dev/ptc"
665 @@ -1437,7 +1441,7 @@
666      desc->slave_fd = open (desc->slave_name, O_RDWR, 0);
667  #endif
668  
669 -#if defined (__sun__) || defined (__hpux__)
670 +#if defined (sun) || defined (__hpux__)
671    /* On systems such as Solaris we are using stream. We need to push the right
672       "modules" in order to get the expected terminal behaviors. Otherwise
673       functionalities such as termios are not available.  */
674 --- /dev/null
675 +++ gcc/ada/traceback_symbolic.c
676 @@ -0,0 +1,201 @@
677 +/*
678 +  Copyright (C) 1999 by Juergen Pfeifer <juergen.pfeifer@gmx.net>
679 +  Ada for Linux Team (ALT)
680 +  Heavily modified by John Marino <http://www.dragonlace.net>
681 +
682 +  Permission is hereby granted, free of charge, to any person obtaining a
683 +  copy of this software and associated documentation files (the
684 +  "Software"), to deal in the Software without restriction, including
685 +  without limitation the rights to use, copy, modify, merge, publish,
686 +  distribute, distribute with modifications, sublicense, and/or sell
687 +  copies of the Software, and to permit persons to whom the Software is
688 +  furnished to do so, subject to the following conditions:
689 +
690 +  The above copyright notice and this permission notice shall be included
691 +  in all copies or substantial portions of the Software.
692 +
693 +  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
694 +  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
695 +  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
696 +  IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
697 +  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
698 +  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
699 +  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
700 +
701 +  Except as contained in this notice, the name(s) of the above copyright
702 +  holders shall not be used in advertising or otherwise to promote the
703 +  sale, use or other dealings in this Software without prior written
704 +  authorization.
705 +*/
706 +
707 +#ifdef IS_CROSS
708 +
709 +
710 +/*
711 + * Running addr2line doesn't make sense for cross-compiled objects.
712 + * Create a dummy function to satisfy g-trasym.o
713 + */
714 +
715 +void
716 +convert_addresses (const char *file_name ATTRIBUTE_UNUSED,
717 +                   void *addrs ATTRIBUTE_UNUSED,
718 +                   int n_addr ATTRIBUTE_UNUSED,
719 +                   void *buf ATTRIBUTE_UNUSED,
720 +                   int *len ATTRIBUTE_UNUSED)
721 +{
722 +  *len = 0;
723 +}
724 +
725 +#else
726 +
727 +
728 +/*
729 + * use the external program /usr/bin/addr2line to convert addresses
730 + * into file names and line numbers
731 + */
732 +
733 +#include <sys/types.h>
734 +#include <stdlib.h>
735 +#include <unistd.h>
736 +#include <string.h>
737 +#include <signal.h>
738 +
739 +#define CLOSE_SENDPIPE close(sendpipe[0]); close(sendpipe[1])
740 +#define CLOSE_READPIPE close(readpipe[0]); close(readpipe[1])
741 +#define DUP2CLOSE(oldfd, newfd) dup2(oldfd, newfd); close(oldfd);
742 +#define RESTSIG sigaction(SIGPIPE,&oact,NULL)
743 +
744 +#define MAX_LINE     1024
745 +#define PARENT_READ  readpipe[0]
746 +#define CHILD_WRITE  readpipe[1]
747 +#define CHILD_READ   sendpipe[0]
748 +#define PARENT_WRITE sendpipe[1]
749 +
750 +#if defined (__sun__)
751 +#define ADDR2LINE_PROG        "/usr/gnu/bin/addr2line"
752 +#else
753 +#define ADDR2LINE_PROG        "/usr/bin/addr2line"
754 +#endif
755 +
756 +void
757 +convert_addresses (const char *file_name,
758 +                   void *addrs,
759 +                   int   n_addr,
760 +                   void *buf,
761 +                   int  *len)
762 +{
763 +  int max_len = *len;
764 +  pid_t childpid;
765 +
766 +  struct sigaction act, oact;
767 +
768 +  int sendpipe[2] = {-1,-1},        /* parent -> child */
769 +      readpipe[2] = {-1,-1};        /* parent <- child */
770 +
771 +  *len = 0;
772 +  act.sa_handler = SIG_IGN;
773 +  sigemptyset(&act.sa_mask);
774 +  act.sa_flags = 0;
775 +  if (sigaction(SIGPIPE,&act,&oact) < 0)
776 +    return;
777 +
778 +  if (pipe(sendpipe) < 0) { RESTSIG; return; }
779 +  if (pipe(readpipe) < 0) { CLOSE_SENDPIPE; RESTSIG; return; }
780 +  if ((childpid = fork()) < 0) {
781 +    CLOSE_READPIPE;
782 +    CLOSE_SENDPIPE;
783 +    RESTSIG;
784 +    return;
785 +  }
786 +
787 +  if (childpid == 0) {    /* child process */
788 +    close(PARENT_WRITE);
789 +    close(PARENT_READ);
790 +    if ((CHILD_READ != STDIN_FILENO) && (CHILD_WRITE != STDOUT_FILENO)) {
791 +      if ((CHILD_READ == STDOUT_FILENO) && (CHILD_WRITE == STDIN_FILENO)) {
792 +        const int temp_fd = dup(CHILD_WRITE);
793 +        close (CHILD_WRITE);
794 +        DUP2CLOSE (CHILD_READ, STDIN_FILENO);
795 +        DUP2CLOSE (temp_fd,    STDOUT_FILENO);
796 +      }
797 +      else if ((CHILD_READ == STDIN_FILENO) && (CHILD_WRITE > 1)) {
798 +        DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
799 +      }
800 +      else if ((CHILD_READ > 1) && (CHILD_WRITE == STDOUT_FILENO)) {
801 +        DUP2CLOSE (CHILD_READ, STDIN_FILENO);
802 +      }
803 +      else if ((CHILD_READ > 1) && (CHILD_WRITE == STDIN_FILENO)) {
804 +        DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
805 +        DUP2CLOSE (CHILD_READ,  STDIN_FILENO);
806 +      }
807 +      else {
808 +        /* CHILD_READ >= 1 and CHILD_WRITE > 1 */
809 +        DUP2CLOSE (CHILD_READ,  STDIN_FILENO);
810 +        DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
811 +      }
812 +    }
813 +    /* As pointed out by Florian Weimer to JP, it is a security threat to call
814 +       the script with a user defined environment and using the path. That
815 +       would be Trojans pleasure.  Therefore the absolute path to addr2line
816 +       and an empty environment is used. That should be safe.
817 +    */
818 +    char *const argv[] = { "addr2line",
819 +                           "-e", file_name,
820 +                           "--demangle=gnat",
821 +                           "--functions",
822 +                           "--basenames",
823 +                           NULL };
824 +    char *const envp[] = { NULL };
825 +    if (execve(ADDR2LINE_PROG, argv, envp) < 0) {
826 +      close (CHILD_WRITE);
827 +      close (CHILD_READ);
828 +      RESTSIG;
829 +      exit (1);
830 +    }
831 +  }
832 +
833 +  /* Below this line is parent process */
834 +  int i, n;
835 +  char hex[16];
836 +  char line[MAX_LINE + 1];
837 +  char *p;
838 +  char *s = buf;
839 +  long *trace_address = addrs;
840 +
841 +  close(CHILD_WRITE);
842 +  close(CHILD_READ);
843 +
844 +  for(i=0; i < n_addr; i++) {
845 +    snprintf(hex,sizeof(hex),"%#lx\n",*trace_address);
846 +    write(PARENT_WRITE,hex,strlen(hex));
847 +    n = read(PARENT_READ,line,MAX_LINE);
848 +    if (n<=0)
849 +      break;
850 +
851 +    line[n]=0;
852 +    /* We have approx. 16 additional chars for "%#lx in " clause.
853 +       We use this info to prevent a buffer overrun. */
854 +    if (n + 16 + (*len) > max_len)
855 +      break;
856 +
857 +    p = strchr(line,'\n');
858 +    if (p) {
859 +      if (*(p+1)) {
860 +        *p = 0;
861 +        *len += snprintf(s, (max_len - (*len)), "%#lx in %s at %s",
862 +                         *trace_address, line, p+1);
863 +      }
864 +      else {
865 +        *len += snprintf(s, (max_len - (*len)), "%#lx at %s",
866 +                         *trace_address, line);
867 +      }
868 +      s = buf + (*len);
869 +    }
870 +    trace_address += 1;
871 +  }
872 +  close (PARENT_WRITE);
873 +  close (PARENT_READ);
874 +  RESTSIG;
875 +}
876 +
877 +#endif
878 --- /dev/null
879 +++ gcc/ada/libgnat/g-socthi__bsd.adb
880 @@ -0,0 +1,356 @@
881 +------------------------------------------------------------------------------
882 +--                                                                          --
883 +--                         GNAT COMPILER COMPONENTS                         --
884 +--                                                                          --
885 +--                    G N A T . S O C K E T S . T H I N                     --
886 +--                                                                          --
887 +--                                 B o d y                                  --
888 +--                                                                          --
889 +--                     Copyright (C) 2001-2018, AdaCore                     --
890 +--                                                                          --
891 +-- GNAT is free software;  you can  redistribute it  and/or modify it under --
892 +-- terms of the  GNU General Public License as published  by the Free Soft- --
893 +-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
894 +-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
895 +-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
896 +-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
897 +--                                                                          --
898 +-- As a special exception under Section 7 of GPL version 3, you are granted --
899 +-- additional permissions described in the GCC Runtime Library Exception,   --
900 +-- version 3.1, as published by the Free Software Foundation.               --
901 +--                                                                          --
902 +-- You should have received a copy of the GNU General Public License and    --
903 +-- a copy of the GCC Runtime Library Exception along with this program;     --
904 +-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
905 +-- <http://www.gnu.org/licenses/>.                                          --
906 +--                                                                          --
907 +-- GNAT was originally developed  by the GNAT team at  New York University. --
908 +-- Extensive contributions were provided by Ada Core Technologies Inc.      --
909 +--                                                                          --
910 +------------------------------------------------------------------------------
911 +
912 +--  This package provides a target dependent thin interface to the sockets
913 +--  layer for use by the GNAT.Sockets package (g-socket.ads). This package
914 +--  should not be directly with'ed by an applications program.
915 +
916 +--  This is the *BSD version which uses fcntl rather than ioctl
917 +--  The constant SCON.Thread_Blocking_IO is always true (for all platforms, not
918 +--  just *BSD), so this binding is significantly simpler than the standard
919 +--  one it replaces.
920 +
921 +with GNAT.OS_Lib; use GNAT.OS_Lib;
922 +
923 +with Interfaces.C; use Interfaces.C;
924 +
925 +package body GNAT.Sockets.Thin is
926 +
927 +   function Syscall_Accept
928 +     (S       : C.int;
929 +      Addr    : System.Address;
930 +      Addrlen : not null access C.int) return C.int;
931 +   pragma Import (C, Syscall_Accept, "accept");
932 +   --  The accept() function accepts a connection on a socket.  An incoming
933 +   --  connection is acknowledged and associated with an immediately created
934 +   --  socket.  The original socket is returned to the listening state.
935 +
936 +   function Syscall_Connect
937 +     (S       : C.int;
938 +      Name    : System.Address;
939 +      Namelen : C.int) return C.int;
940 +   pragma Import (C, Syscall_Connect, "connect");
941 +   --  The connect() system call initiates a connection on a socket.  If the
942 +   --  parameter S is of type SOCK_DGRAM then connect() permanently specifies
943 +   --  the peer to which datagrams are to be sent.  If S is type SOCK_STREAM
944 +   --  then connect() attempts to make a connection with another socket, which
945 +   --  is identified by the parameter Name.
946 +
947 +   function Syscall_Recv
948 +     (S     : C.int;
949 +      Msg   : System.Address;
950 +      Len   : C.int;
951 +      Flags : C.int) return C.int;
952 +   pragma Import (C, Syscall_Recv, "recv");
953 +   --  The recv() function receives a message from a socket.  The call can be
954 +   --  used on a connection mode socket or a bound, connectionless socket.  If
955 +   --  no messages are available at the socket, the recv() call waits for a
956 +   --  message to arrive unless the socket is non-blocking.  If a socket is
957 +   --  non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK.
958 +
959 +   function Syscall_Recvfrom
960 +     (S       : C.int;
961 +      Msg     : System.Address;
962 +      Len     : C.int;
963 +      Flags   : C.int;
964 +      From    : System.Address;
965 +      Fromlen : not null access C.int) return C.int;
966 +   pragma Import (C, Syscall_Recvfrom, "recvfrom");
967 +   --  The recvfrom() system call receives a message from a socket and captures
968 +   --  the address from which the data was sent.  It can be used to receive
969 +   --  data on an unconnected socket as well.  If no messages are available,
970 +   --  the call waits for a message to arrive on blocking sockets.  For
971 +   --  non-blocking sockets without messages, -1 is returned and ERRNO is set
972 +   --  to EAGAIN or EWOULDBLOCK.
973 +
974 +   function Syscall_Recvmsg
975 +     (S     : C.int;
976 +      Msg   : System.Address;
977 +      Flags : C.int) return System.CRTL.ssize_t;
978 +   pragma Import (C, Syscall_Recvmsg, "recvmsg");
979 +   --  The recvmsg call receives a message from a socket, and can be used to
980 +   --  receive data on an unconnected socket as well.  If no messages are
981 +   --  available, the call waits for a message to arrive on blocking sockets.
982 +   --  For non-blocking sockets without messages, -1 is returned and ERRNO is
983 +   --  set to EAGAIN or EWOULDBLOCK.
984 +
985 +   function Syscall_Sendmsg
986 +     (S     : C.int;
987 +      Msg   : System.Address;
988 +      Flags : C.int) return System.CRTL.ssize_t;
989 +   pragma Import (C, Syscall_Sendmsg, "sendmsg");
990 +   --  The sendmsg() function sends a message to a socket, and can be used with
991 +   --  unconnected sockets as well (the msg is ignored in this case).  The
992 +   --  function returns the number of bytes sent when successful, otherwise it
993 +   --  returns -1 and ERRNO is set (many possible values).
994 +
995 +   function Syscall_Sendto
996 +     (S     : C.int;
997 +      Msg   : System.Address;
998 +      Len   : C.int;
999 +      Flags : C.int;
1000 +      To    : System.Address;
1001 +      Tolen : C.int) return C.int;
1002 +   pragma Import (C, Syscall_Sendto, "sendto");
1003 +   --  The sendto() function only works for connected sockets and it initiates
1004 +   --  the transmission of a message.  A successful call returns the numbers of
1005 +   --  bytes sent, and a failure returns a -1 and ERRNO is set.
1006 +
1007 +   function Syscall_Socket
1008 +     (Domain   : C.int;
1009 +      Typ      : C.int;
1010 +      Protocol : C.int) return C.int;
1011 +   pragma Import (C, Syscall_Socket, "socket");
1012 +   --  The socket() function is used to create an unbound socket and returns a
1013 +   --  file descriptor that can be used with other socket functions.  Upon
1014 +   --  failure, a -1 is returned and ERRNO is set.
1015 +
1016 +   procedure Disable_SIGPIPE (S : C.int);
1017 +   pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe");
1018 +
1019 +   procedure Disable_All_SIGPIPEs;
1020 +   pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes");
1021 +   --  Sets the process to ignore all SIGPIPE signals on platforms that
1022 +   --  don't support Disable_SIGPIPE for particular streams.
1023 +
1024 +   function C_Fcntl
1025 +     (Fd  : C.int;
1026 +      Cmd : C.int;
1027 +      Val : C.int) return C.int;
1028 +   pragma Import (C, C_Fcntl, "fcntl");
1029 +   --  The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support
1030 +   --  setting a socket in non-blocking mode.  fcntl must be used instead.
1031 +
1032 +   --------------
1033 +   -- C_Accept --
1034 +   --------------
1035 +
1036 +   function C_Accept
1037 +     (S       : C.int;
1038 +      Addr    : System.Address;
1039 +      Addrlen : not null access C.int) return C.int
1040 +   is
1041 +      R : constant C.int := Syscall_Accept (S, Addr, Addrlen);
1042 +   begin
1043 +
1044 +      Disable_SIGPIPE (R);
1045 +      return R;
1046 +   end C_Accept;
1047 +
1048 +   ---------------
1049 +   -- C_Connect --
1050 +   ---------------
1051 +
1052 +   function C_Connect
1053 +     (S       : C.int;
1054 +      Name    : System.Address;
1055 +      Namelen : C.int) return C.int
1056 +   is
1057 +   begin
1058 +      return Syscall_Connect (S, Name, Namelen);
1059 +   end C_Connect;
1060 +
1061 +   ------------------
1062 +   -- Socket_Ioctl --
1063 +   ------------------
1064 +
1065 +   function Socket_Ioctl
1066 +     (S   : C.int;
1067 +      Req : SOSC.IOCTL_Req_T;
1068 +      Arg : access C.int) return C.int
1069 +   is
1070 +   begin
1071 +      if Req = SOSC.FIONBIO then
1072 +         declare
1073 +            use Interfaces;
1074 +            flags    : constant Unsigned_32 :=
1075 +                                Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
1076 +            nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.O_NDELAY);
1077 +            enabled  : constant Boolean := Arg.all = 1;
1078 +            newval   : C.int := C.int (flags);
1079 +         begin
1080 +            if enabled then
1081 +               newval := C.int (flags or nonblock);
1082 +            elsif (flags and nonblock) > 0 then
1083 +               newval := C.int (flags - nonblock);
1084 +            end if;
1085 +            return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval);
1086 +         end;
1087 +      end if;
1088 +
1089 +      return C_Ioctl (S, Req, Arg);
1090 +   end Socket_Ioctl;
1091 +
1092 +   ------------
1093 +   -- C_Recv --
1094 +   ------------
1095 +
1096 +   function C_Recv
1097 +     (S     : C.int;
1098 +      Msg   : System.Address;
1099 +      Len   : C.int;
1100 +      Flags : C.int) return C.int
1101 +   is
1102 +   begin
1103 +      return Syscall_Recv (S, Msg, Len, Flags);
1104 +   end C_Recv;
1105 +
1106 +   ----------------
1107 +   -- C_Recvfrom --
1108 +   ----------------
1109 +
1110 +   function C_Recvfrom
1111 +     (S       : C.int;
1112 +      Msg     : System.Address;
1113 +      Len     : C.int;
1114 +      Flags   : C.int;
1115 +      From    : System.Address;
1116 +      Fromlen : not null access C.int) return C.int
1117 +   is
1118 +   begin
1119 +      return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
1120 +   end C_Recvfrom;
1121 +
1122 +   ---------------
1123 +   -- C_Recvmsg --
1124 +   ---------------
1125 +
1126 +   function C_Recvmsg
1127 +     (S     : C.int;
1128 +      Msg   : System.Address;
1129 +      Flags : C.int) return System.CRTL.ssize_t
1130 +   is
1131 +   begin
1132 +      return Syscall_Recvmsg (S, Msg, Flags);
1133 +   end C_Recvmsg;
1134 +
1135 +   ---------------
1136 +   -- C_Sendmsg --
1137 +   ---------------
1138 +
1139 +   function C_Sendmsg
1140 +     (S     : C.int;
1141 +      Msg   : System.Address;
1142 +      Flags : C.int) return System.CRTL.ssize_t
1143 +   is
1144 +   begin
1145 +      return Syscall_Sendmsg (S, Msg, Flags);
1146 +   end C_Sendmsg;
1147 +
1148 +   --------------
1149 +   -- C_Sendto --
1150 +   --------------
1151 +
1152 +   function C_Sendto
1153 +     (S     : C.int;
1154 +      Msg   : System.Address;
1155 +      Len   : C.int;
1156 +      Flags : C.int;
1157 +      To    : System.Address;
1158 +      Tolen : C.int) return C.int
1159 +   is
1160 +   begin
1161 +      return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
1162 +   end C_Sendto;
1163 +
1164 +   --------------
1165 +   -- C_Socket --
1166 +   --------------
1167 +
1168 +   function C_Socket
1169 +     (Domain   : C.int;
1170 +      Typ      : C.int;
1171 +      Protocol : C.int) return C.int
1172 +   is
1173 +      R : constant C.int := Syscall_Socket (Domain, Typ, Protocol);
1174 +   begin
1175 +      Disable_SIGPIPE (R);
1176 +      return R;
1177 +   end C_Socket;
1178 +
1179 +   --------------
1180 +   -- Finalize --
1181 +   --------------
1182 +
1183 +   procedure Finalize is
1184 +   begin
1185 +      null;
1186 +   end Finalize;
1187 +
1188 +   -------------------------
1189 +   -- Host_Error_Messages --
1190 +   -------------------------
1191 +
1192 +   package body Host_Error_Messages is separate;
1193 +
1194 +   ----------------
1195 +   -- Initialize --
1196 +   ----------------
1197 +
1198 +   procedure Initialize is
1199 +   begin
1200 +      Disable_All_SIGPIPEs;
1201 +   end Initialize;
1202 +
1203 +   --------------------
1204 +   -- Signalling_Fds --
1205 +   --------------------
1206 +
1207 +   package body Signalling_Fds is
1208 +
1209 +      --  In this default implementation, we use a C version of these
1210 +      --  subprograms provided by socket.c.
1211 +
1212 +      function C_Create (Fds : not null access Fd_Pair) return C.int;
1213 +      function C_Read (Rsig : C.int) return C.int;
1214 +      function C_Write (Wsig : C.int) return C.int;
1215 +      procedure C_Close (Sig : C.int);
1216 +
1217 +      pragma Import (C, C_Create, "__gnat_create_signalling_fds");
1218 +      pragma Import (C, C_Read,   "__gnat_read_signalling_fd");
1219 +      pragma Import (C, C_Write,  "__gnat_write_signalling_fd");
1220 +      pragma Import (C, C_Close,  "__gnat_close_signalling_fd");
1221 +
1222 +      function Create
1223 +        (Fds : not null access Fd_Pair) return C.int renames C_Create;
1224 +      function Read (Rsig : C.int) return C.int renames C_Read;
1225 +      function Write (Wsig : C.int) return C.int renames C_Write;
1226 +      procedure Close (Sig : C.int) renames C_Close;
1227 +
1228 +   end Signalling_Fds;
1229 +
1230 +   --------------------------
1231 +   -- Socket_Error_Message --
1232 +   --------------------------
1233 +
1234 +   function Socket_Error_Message (Errno : Integer) return String is separate;
1235 +
1236 +end GNAT.Sockets.Thin;
1237 --- /dev/null
1238 +++ gcc/ada/libgnat/s-trasym__bsd.adb
1239 @@ -0,0 +1,175 @@
1240 +------------------------------------------------------------------------------
1241 +--                                                                          --
1242 +--                         GNAT RUN-TIME COMPONENTS                         --
1243 +--                                                                          --
1244 +--           S Y S T E M . T R A C E B A C K . S Y M B O L I C              --
1245 +--                                                                          --
1246 +--                                 B o d y                                  --
1247 +--                                                                          --
1248 +--                     Copyright (C) 1999-2018, AdaCore                     --
1249 +--                                                                          --
1250 +-- GNAT is free software;  you can  redistribute it  and/or modify it under --
1251 +-- terms of the  GNU General Public License as published  by the Free Soft- --
1252 +-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
1253 +-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
1254 +-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
1255 +-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
1256 +--                                                                          --
1257 +-- As a special exception under Section 7 of GPL version 3, you are granted --
1258 +-- additional permissions described in the GCC Runtime Library Exception,   --
1259 +-- version 3.1, as published by the Free Software Foundation.               --
1260 +--                                                                          --
1261 +-- You should have received a copy of the GNU General Public License and    --
1262 +-- a copy of the GCC Runtime Library Exception along with this program;     --
1263 +-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
1264 +-- <http://www.gnu.org/licenses/>.                                          --
1265 +--                                                                          --
1266 +-- GNAT was originally developed  by the GNAT team at  New York University. --
1267 +-- Extensive contributions were provided by Ada Core Technologies Inc.      --
1268 +--                                                                          --
1269 +------------------------------------------------------------------------------
1270 +
1271 +--  Run-time symbolic traceback support
1272 +--  This file is based on the work by Juergen Pfiefer which is still used
1273 +--  today to provide symbolic traceback support for gnu/kFreeBSD.
1274 +--  Incorporated in GNAT-AUX by John Marino <http://www.dragonlace.net>
1275 +
1276 +pragma Polling (Off);
1277 +--  We must turn polling off for this unit, because otherwise we can get
1278 +--  elaboration circularities when polling is turned on.
1279 +
1280 +with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
1281 +with System.Soft_Links;
1282 +
1283 +package body System.Traceback.Symbolic is
1284 +
1285 +   --  Note that Suppress_Hex is ignored in this version of this package.
1286 +
1287 +   package TSL renames System.Soft_Links;
1288 +
1289 +   --  To perform the raw addresses to symbolic form translation we rely on a
1290 +   --  libaddr2line symbolizer which examines debug info from a provided
1291 +   --  executable file name, and an absolute path is needed to ensure the file
1292 +   --  is always found. This is "__gnat_locate_exec_on_path (gnat_argv [0])"
1293 +   --  for our executable file, a fairly heavy operation so we cache the
1294 +   --  result.
1295 +
1296 +   Exename : System.Address;
1297 +   --  Pointer to the name of the executable file to be used on all
1298 +   --  invocations of the libaddr2line symbolization service.
1299 +
1300 +   Exename_Resolved : Boolean := False;
1301 +   --  Flag to indicate whether we have performed the executable file name
1302 +   --  resolution already. Relying on a not null Exename for this purpose
1303 +   --  would be potentially inefficient as this is what we will get if the
1304 +   --  resolution attempt fails.
1305 +
1306 +   ------------------------
1307 +   -- Symbolic_Traceback --
1308 +   ------------------------
1309 +
1310 +   function Symbolic_Traceback
1311 +     (Traceback : System.Traceback_Entries.Tracebacks_Array) return String
1312 +   is
1313 +      procedure convert_addresses
1314 +        (filename : System.Address;
1315 +         addrs    : System.Address;
1316 +         n_addrs  : Integer;
1317 +         buf      : System.Address;
1318 +         len      : System.Address);
1319 +      pragma Import (C, convert_addresses, "convert_addresses");
1320 +      --  This is the procedure version of the Ada-aware addr2line. It places
1321 +      --  in BUF a string representing the symbolic translation of the N_ADDRS
1322 +      --  raw addresses provided in ADDRS, looked up in debug information from
1323 +      --  FILENAME. LEN points to an integer which contains the size of the
1324 +      --  BUF buffer at input and the result length at output.
1325 +      --
1326 +      --  Note that this procedure is *not* thread-safe.
1327 +
1328 +      type Argv_Array is array (0 .. 0) of System.Address;
1329 +      gnat_argv : access Argv_Array;
1330 +      pragma Import (C, gnat_argv, "gnat_argv");
1331 +
1332 +      function locate_exec_on_path
1333 +        (c_exename : System.Address) return System.Address;
1334 +      pragma Import (C, locate_exec_on_path, "__gnat_locate_exec_on_path");
1335 +
1336 +      B_Size : constant Integer := 256 * Traceback'Length;
1337 +      Len    : Integer := B_Size;
1338 +      Res    : String (1 .. B_Size);
1339 +
1340 +   begin
1341 +      if Traceback'Length = 0 then
1342 +         return "";
1343 +      end if;
1344 +
1345 +      --  If our input set of raw addresses is not empty, resort to the
1346 +      --  libaddr2line service to symbolize it all.
1347 +
1348 +      --  Compute, cache and provide the absolute path to our executable file
1349 +      --  name as the binary file where the relevant debug information is to be
1350 +      --  found. If the executable file name resolution fails, we have no
1351 +      --  sensible basis to invoke the symbolizer at all.
1352 +
1353 +      --  Protect all this against concurrent accesses explicitly, as the
1354 +      --  underlying services are potentially thread unsafe.
1355 +
1356 +      TSL.Lock_Task.all;
1357 +
1358 +      if not Exename_Resolved then
1359 +         Exename := locate_exec_on_path (gnat_argv (0));
1360 +         Exename_Resolved := True;
1361 +      end if;
1362 +
1363 +      if Exename /= System.Null_Address then
1364 +         Len := Res'Length;
1365 +         convert_addresses
1366 +           (Exename, Traceback'Address, Traceback'Length,
1367 +            Res (1)'Address, Len'Address);
1368 +      end if;
1369 +
1370 +      TSL.Unlock_Task.all;
1371 +
1372 +      --  Return what the addr2line symbolizer has produced if we have called
1373 +      --  it (the executable name resolution succeeded), or an empty string
1374 +      --  otherwise.
1375 +
1376 +      if Exename /= System.Null_Address then
1377 +         return Res (1 .. Len);
1378 +      else
1379 +         return "";
1380 +      end if;
1381 +   end Symbolic_Traceback;
1382 +
1383 +   --  "No_Hex" is ignored in this version, because otherwise we have nothing
1384 +   --  at all to print.
1385 +
1386 +   function Symbolic_Traceback_No_Hex
1387 +     (Traceback : System.Traceback_Entries.Tracebacks_Array) return String is
1388 +   begin
1389 +      return Symbolic_Traceback (Traceback);
1390 +   end Symbolic_Traceback_No_Hex;
1391 +
1392 +   function Symbolic_Traceback
1393 +     (E : Ada.Exceptions.Exception_Occurrence) return String
1394 +   is
1395 +   begin
1396 +      return Symbolic_Traceback (Tracebacks (E));
1397 +   end Symbolic_Traceback;
1398 +
1399 +   function Symbolic_Traceback_No_Hex
1400 +     (E : Ada.Exceptions.Exception_Occurrence) return String is
1401 +   begin
1402 +      return Symbolic_Traceback (E);
1403 +   end Symbolic_Traceback_No_Hex;
1404 +
1405 +   ------------------
1406 +   -- Enable_Cache --
1407 +   ------------------
1408 +
1409 +   procedure Enable_Cache (Include_Modules : Boolean := False) is
1410 +   begin
1411 +      null;
1412 +   end Enable_Cache;
1413 +
1414 +end System.Traceback.Symbolic;
1415 --- gcc/ada/gcc-interface/Make-lang.in.orig
1416 +++ gcc/ada/gcc-interface/Make-lang.in
1417 @@ -627,7 +627,7 @@
1418   ada/widechar.o
1419  
1420  # Language-independent object files.
1421 -ADA_BACKEND = $(BACKEND) attribs.o
1422 +ADA_BACKEND = $(BACKEND2) attribs.o
1423  
1424  # List of target dependent sources, overridden below as necessary
1425  TARGET_ADA_SRCS =
1426 --- gcc/ada/init.c.orig
1427 +++ gcc/ada/init.c
1428 @@ -2643,8 +2643,15 @@
1429  {
1430    mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
1431  
1432 +#if defined (__i386__)
1433 +  unsigned long *pc = (unsigned long *)mcontext->gregs[REG_EIP];
1434 +  /* The pattern is "orl $0x0,(%esp)" for a probe in 32-bit mode.  */
1435 +  if (signo == SIGSEGV && pc && *pc == 0x00240c83)
1436 +    mcontext->gregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long);
1437 +#elif defined (__ARMEL__)
1438    /* ARM Bump has to be an even number because of odd/even architecture.  */
1439 -  ((mcontext_t *) mcontext)->arm_pc += 2;
1440 +  mcontext->arm_pc += 2;
1441 +#endif
1442  }
1443  
1444  static void
1445 --- gcc/ada/libgnat/g-socthi.ads.orig
1446 +++ gcc/ada/libgnat/g-socthi.ads
1447 @@ -53,8 +53,6 @@
1448  
1449     package C renames Interfaces.C;
1450  
1451 -   use type System.CRTL.ssize_t;
1452 -
1453     function Socket_Errno return Integer renames GNAT.OS_Lib.Errno;
1454     --  Returns last socket error number
1455  
1456
1457
1458 [FILE:19397:patches/patch-diff-ada-testsuite]
1459 --- gcc/testsuite/ada/acats/run_acats.sh.orig
1460 +++ gcc/testsuite/ada/acats/run_acats.sh
1461 @@ -5,20 +5,6 @@
1462     exit 1
1463  fi
1464  
1465 -# Provide which replacement.
1466 -#
1467 -# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
1468 -# ksh93 and bash have it.
1469 -# type output format differs between ksh88 and ksh93, so avoid it if
1470 -# type -p is present.  Unfortunately, HP-UX /bin/sh ignores -p with type.
1471 -# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
1472 -
1473 -which () {
1474 -    path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
1475 -    path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
1476 -    path=`whence $* 2>/dev/null` && { echo $path; return 0; }
1477 -    return 1
1478 -}
1479  
1480  # Set up environment to use the Ada compiler from the object tree
1481  
1482 --- gcc/testsuite/ada/acats/run_all.sh.orig
1483 +++ gcc/testsuite/ada/acats/run_all.sh
1484 @@ -14,21 +14,6 @@
1485  
1486  # End of customization section.
1487  
1488 -# Perform arithmetic evaluation on the ARGs, and store the result in the
1489 -# global $as_val. Take advantage of shells that can avoid forks. The arguments
1490 -# must be portable across $(()) and expr.
1491 -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
1492 -  eval 'as_fn_arith ()
1493 -  {
1494 -    as_val=$(( $* ))
1495 -  }'
1496 -else
1497 -  as_fn_arith ()
1498 -  {
1499 -    as_val=`expr "$@" || test $? -eq 1`
1500 -  }
1501 -fi # as_fn_arith
1502 -
1503  display_noeol () {
1504    printf "$@"
1505    printf "$@" >> $dir/acats.sum
1506 @@ -46,6 +31,14 @@
1507    echo "$@" >> $dir/acats.log
1508  }
1509  
1510 +inform () {
1511 +  printf "%04d    %7s" $1 $2
1512 +}
1513 +
1514 +disinform () {
1515 +  printf "\r"
1516 +}
1517 +
1518  dir=`${PWDCMD-pwd}`
1519  
1520  if [ "$dir" = "$testdir" ]; then
1521 @@ -102,18 +95,6 @@
1522  gnatls -v >> $dir/acats.log
1523  display ""
1524  
1525 -if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
1526 -  dir_support=$dir/../acats/support
1527 -
1528 -  rm -rf $dir/run
1529 -  mv $dir/tests $dir/tests.$$ 2> /dev/null
1530 -  rm -rf $dir/tests.$$ &
1531 -  mkdir -p $dir/run
1532 -
1533 -  cp -pr $dir/../acats/tests $dir/
1534 -else
1535 -  dir_support=$dir/support
1536 -
1537  display "              === acats support ==="
1538  display_noeol "Generating support files..."
1539  
1540 @@ -214,9 +195,6 @@
1541  
1542  display " done."
1543  display ""
1544 -
1545 -fi
1546 -
1547  display "              === acats tests ==="
1548  
1549  if [ $# -eq 0 ]; then
1550 @@ -228,14 +206,20 @@
1551  glob_countn=0
1552  glob_countok=0
1553  glob_countu=0
1554 -par_count=0
1555 -par_countm=0
1556 -par_last=
1557 +countdown=0
1558  
1559  for chapter in $chapters; do
1560 -   # Used to generate support once and finish after that.
1561 -   [ "$chapter" = "NONE" ] && continue
1562 +   if [ -d $dir/tests/$chapter ]; then
1563 +      cd $dir/tests/$chapter
1564 +      ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
1565 +      cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
1566 +        > $dir/tests/$chapter/${chapter}.lst
1567 +      countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1568 +      countdown=`expr $countdown + $countn`
1569 +   fi
1570 +done
1571  
1572 +for chapter in $chapters; do
1573     display Running chapter $chapter ...
1574  
1575     if [ ! -d $dir/tests/$chapter ]; then
1576 @@ -244,45 +228,11 @@
1577        continue
1578     fi
1579  
1580 -   cd $dir/tests/$chapter
1581 -   ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
1582 -   cut -c1-7 | sort | uniq | comm -23 - $dir_support/norun.lst \
1583 -     > $dir/tests/$chapter/${chapter}.lst 
1584     countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1585 -   as_fn_arith $glob_countn + $countn
1586 -   glob_countn=$as_val
1587 +   glob_countn=`expr $glob_countn + $countn`
1588 +   counti=0
1589     for i in `cat $dir/tests/$chapter/${chapter}.lst`; do 
1590 -
1591 -      # If running multiple run_all.sh jobs in parallel, decide
1592 -      # if we should run this test in the current instance.
1593 -      if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
1594 -        case "$i" in
1595 -           # Ugh, some tests have inter-test dependencies, those
1596 -           # tests have to be scheduled on the same parallel instance
1597 -           # as previous test.
1598 -           ce2108f | ce2108h | ce3112d) ;;
1599 -           # All others can be hopefully scheduled freely.
1600 -           *)
1601 -              as_fn_arith $par_countm + 1
1602 -              par_countm=$as_val
1603 -              [ $par_countm -eq 10 ] && par_countm=0
1604 -              if [ $par_countm -eq 1 ]; then
1605 -                 as_fn_arith $par_count + 1
1606 -                 par_count=$as_val
1607 -                 if mkdir $GCC_RUNTEST_PARALLELIZE_DIR/$par_count 2>/dev/null; then
1608 -                    par_last=1
1609 -                 else
1610 -                    par_last=
1611 -                 fi
1612 -              fi;;
1613 -        esac
1614 -        if [ -z "$par_last" ]; then
1615 -           as_fn_arith $glob_countn - 1
1616 -           glob_countn=$as_val
1617 -           continue
1618 -        fi
1619 -      fi
1620 -
1621 +      counti=`expr $counti + 1`
1622        extraflags="-gnat95"
1623        grep $i $testdir/overflow.lst > /dev/null 2>&1
1624        if [ $? -eq 0 ]; then
1625 @@ -300,10 +250,13 @@
1626        if [ $? -eq 0 ]; then
1627           extraflags="$extraflags -fstack-check"
1628        fi
1629 +      inform $countdown $i
1630 +      countdown=`expr $countdown - 1`
1631        test=$dir/tests/$chapter/$i
1632        mkdir $test && cd $test >> $dir/acats.log 2>&1
1633  
1634        if [ $? -ne 0 ]; then
1635 +         disinform
1636           display "FAIL:        $i"
1637           failed="${failed}${i} "
1638           clean_dir
1639 @@ -321,19 +274,22 @@
1640        echo "BUILD $main" >> $dir/acats.log
1641        EXTERNAL_OBJECTS=""
1642        case $i in
1643 -        cxb30*) EXTERNAL_OBJECTS="$dir_support/cxb30040.o $dir_support/cxb30060.o $dir_support/cxb30130.o $dir_support/cxb30131.o";;
1644 +        cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
1645          ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
1646          ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
1647 +        cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
1648        esac
1649        if [ "$main" = "" ]; then
1650 +         disinform
1651           display "FAIL:        $i"
1652           failed="${failed}${i} "
1653           clean_dir
1654           continue
1655        fi
1656  
1657 -      target_gnatmake $extraflags -I$dir_support $main >> $dir/acats.log 2>&1
1658 +      target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
1659        if [ $? -ne 0 ]; then
1660 +         disinform
1661           display "FAIL:        $i"
1662           failed="${failed}${i} "
1663           clean_dir
1664 @@ -348,6 +304,7 @@
1665        target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
1666        cd $dir/tests/$chapter/$i
1667        cat ${i}.log >> $dir/acats.log
1668 +      disinform
1669        egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
1670        if [ $? -ne 0 ]; then
1671           grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
1672 @@ -357,15 +314,12 @@
1673              failed="${failed}${i} "
1674           else
1675              log "UNSUPPORTED:  $i"
1676 -            as_fn_arith $glob_countn - 1
1677 -            glob_countn=$as_val
1678 -            as_fn_arith $glob_countu + 1
1679 -            glob_countu=$as_val
1680 +            glob_countn=`expr $glob_countn - 1`
1681 +            glob_countu=`expr $glob_countu + 1`
1682           fi
1683        else
1684           log "PASS:    $i"
1685 -         as_fn_arith $glob_countok + 1
1686 -         glob_countok=$as_val
1687 +         glob_countok=`expr $glob_countok + 1`
1688        fi
1689        clean_dir
1690     done
1691 --- /dev/null
1692 +++ gcc/testsuite/ada/acats/run_remote.sh
1693 @@ -0,0 +1,412 @@
1694 +#!/bin/sh
1695 +# Run ACATS with the GNU Ada compiler
1696 +
1697 +# The following functions are to be customized if you run in cross
1698 +# environment or want to change compilation flags.  Note that for
1699 +# tests requiring checks not turned on by default, this script
1700 +# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
1701 +
1702 +# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
1703 +# gnatflags="-gnatN"
1704 +
1705 +gccflags="-O2"
1706 +gnatflags="-gnatws"
1707 +tabtarget="/data/local/testsuite"
1708 +STRIP="@REMOTE_TARGET@-strip"
1709 +
1710 +target_run () {
1711 +  # Run on rooted tablet (port 22 vs port 2222)
1712 +  BN=`basename $*`
1713 +  $STRIP_FOR_TARGET $*
1714 +  /usr/bin/scp -qp $* root@tablet:$tabtarget/
1715 +  /usr/bin/ssh -q tablet $tabtarget/$BN
1716 +}
1717 +
1718 +target_cmd () {
1719 +  /usr/bin/ssh -q tablet "$1"
1720 +}
1721 +
1722 +# End of customization section.
1723 +
1724 +display_noeol () {
1725 +  printf "$@"
1726 +  printf "$@" >> $dir/acats.sum
1727 +  printf "$@" >> $dir/acats.log
1728 +}
1729 +
1730 +display () {
1731 +  echo "$@"
1732 +  echo "$@" >> $dir/acats.sum
1733 +  echo "$@" >> $dir/acats.log
1734 +}
1735 +
1736 +log () {
1737 +  echo "$@" >> $dir/acats.sum
1738 +  echo "$@" >> $dir/acats.log
1739 +}
1740 +
1741 +inform () {
1742 +  printf "%04d    %7s" $1 $2
1743 +}
1744 +
1745 +disinform () {
1746 +  printf "\r"
1747 +}
1748 +
1749 +dir=`${PWDCMD-pwd}`
1750 +
1751 +if [ "$testdir" = "" ]; then
1752 +   echo You must use make check or make check-ada
1753 +   exit 1
1754 +fi
1755 +
1756 +if [ "$dir" = "$testdir" ]; then
1757 +  echo "error: srcdir must be different than objdir, exiting."
1758 +  exit 1
1759 +fi
1760 +
1761 +target_gnatmake () {
1762 +  echo gnatmake-cross --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\" -fPIE -pie
1763 +  gnatmake-cross --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC" -fPIE -pie
1764 +}
1765 +
1766 +target_gcc () {
1767 +  $GCC $gccflags $*
1768 +}
1769 +
1770 +clean_dir () {
1771 +  rm -f "$binmain" *.o *.ali > /dev/null 2>&1
1772 +}
1773 +
1774 +find_main () {
1775 +  ls ${i}?.adb > ${i}.lst 2> /dev/null
1776 +  ls ${i}*m.adb >> ${i}.lst 2> /dev/null
1777 +  ls ${i}.adb >> ${i}.lst 2> /dev/null
1778 +  main=`tail -1 ${i}.lst`
1779 +}
1780 +
1781 +split_testid () {
1782 +  local mysplit=`echo $1 | awk -F/ '{print "section=" $1 "; TN=" $2 "; prog=" $3 ";"}'`
1783 +  eval ${mysplit}
1784 +}
1785 +
1786 +EXTERNAL_OBJECTS=""
1787 +# Global variable to communicate external objects to link with.
1788 +
1789 +rm -f $dir/acats.sum $dir/acats.log $dir/transfer.lst
1790 +
1791 +display "Test Run By $USER on `date`"
1792 +
1793 +display "              === acats configuration ==="
1794 +
1795 +target=`$GCC -dumpmachine`
1796 +
1797 +display target gcc is $GCC
1798 +display `$GCC -v 2>&1`
1799 +display host=`gcc -dumpmachine`
1800 +display target=$target
1801 +display `type gnatmake-cross`
1802 +gnatls-cross -v >> $dir/acats.log
1803 +display ""
1804 +
1805 +# Let's be tidy and clear off the remote device first
1806 +target_cmd "cd ${tabtarget}; rm logs/*; rmdir logs; rm *"
1807 +
1808 +display "              === acats support ==="
1809 +display_noeol "Generating support files..."
1810 +
1811 +rm -rf $dir/support
1812 +mkdir -p $dir/support
1813 +cd $dir/support
1814 +
1815 +cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
1816 +
1817 +# Find out the size in bit of an address on the target
1818 +target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
1819 +target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
1820 +target_bit=`cat $dir/support/impbit.out`
1821 +echo target_bit="$target_bit" >> $dir/acats.log
1822 +
1823 +# Find out a suitable asm statement
1824 +# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
1825 +case "$target" in
1826 +  ia64*-*-* | s390*-*-*)
1827 +    target_insn="nop 0"
1828 +    ;;
1829 +  mmix-*-*)
1830 +    target_insn="swym 0"
1831 +    ;;
1832 +  *)
1833 +    target_insn="nop"
1834 +    ;;
1835 +esac
1836 +echo target_insn="$target_insn" >> $dir/acats.log
1837 +
1838 +sed -e "s,ACATS4GNATDIR,$dir,g" \
1839 +  < $testdir/support/impdef.a > $dir/support/impdef.a
1840 +sed -e "s,ACATS4GNATDIR,$dir,g" \
1841 +  -e "s,ACATS4GNATBIT,$target_bit,g" \
1842 +  -e "s,ACATS4GNATINSN,$target_insn,g" \
1843 +  < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
1844 +sed -e "s,ACATS4GNATDIR,$dir,g" \
1845 +  < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
1846 +
1847 +cp $testdir/tests/cd/*.c $dir/support
1848 +cp $testdir/tests/cxb/*.c $dir/support
1849 +grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
1850 +
1851 +rm -rf $dir/run
1852 +mv $dir/tests $dir/tests.$$ 2> /dev/null
1853 +rm -rf $dir/tests.$$ &
1854 +mkdir -p $dir/run
1855 +
1856 +cp -pr $testdir/tests $dir/
1857 +
1858 +for i in $dir/support/*.ada $dir/support/*.a; do
1859 +   host_gnatchop $i >> $dir/acats.log 2>&1
1860 +done
1861 +
1862 +# These tools are used to preprocess some ACATS sources
1863 +# they need to be compiled native on the host.
1864 +
1865 +host_gnatmake -q -gnatws macrosub.adb
1866 +if [ $? -ne 0 ]; then
1867 +   display "**** Failed to compile macrosub"
1868 +   exit 1
1869 +fi
1870 +./macrosub > macrosub.out 2>&1
1871 +
1872 +gcc -c cd300051.c
1873 +host_gnatmake -q -gnatws widechr.adb
1874 +if [ $? -ne 0 ]; then
1875 +   display "**** Failed to compile widechr"
1876 +   exit 1
1877 +fi
1878 +./widechr > widechr.out 2>&1
1879 +
1880 +rm -f $dir/support/macrosub
1881 +rm -f $dir/support/widechr
1882 +rm -f $dir/support/*.ali
1883 +rm -f $dir/support/*.o
1884 +
1885 +display " done."
1886 +
1887 +# From here, all compilations will be made by the target compiler
1888 +
1889 +display_noeol "Compiling support files..."
1890 +
1891 +target_gcc -c *.c
1892 +if [ $? -ne 0 ]; then
1893 +   display "**** Failed to compile C code"
1894 +   exit 1
1895 +fi
1896 +
1897 +host_gnatchop *.adt >> $dir/acats.log 2>&1
1898 +
1899 +target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
1900 +target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
1901 +
1902 +display " done."
1903 +display ""
1904 +display "              === acats tests ==="
1905 +
1906 +if [ $# -eq 0 ]; then
1907 +   chapters=`cd $dir/tests; echo [a-z]*`
1908 +else
1909 +   chapters=$*
1910 +fi
1911 +
1912 +glob_countn=0
1913 +glob_countok=0
1914 +glob_countu=0
1915 +countdown=0
1916 +
1917 +for chapter in $chapters; do
1918 +   if [ -d $dir/tests/$chapter ]; then
1919 +      cd $dir/tests/$chapter
1920 +      ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
1921 +      cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
1922 +        > $dir/tests/$chapter/${chapter}.lst
1923 +      countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1924 +      countdown=`expr $countdown + $countn`
1925 +   fi
1926 +done
1927 +
1928 +cat > $dir/execute.sh << EOF
1929 +inform () {
1930 +  printf "left: %04d" \$1
1931 +}
1932 +disinform () {
1933 +  printf "\r"
1934 +}
1935 +cycle () {
1936 +  local countx=0
1937 +  local total=\$(echo \$testlist | awk '{print NF}')
1938 +  mkdir -p logs
1939 +  echo "Executing \$total tests on remote device"
1940 +  inform \$total
1941 +  for x in \$testlist; do
1942 +    timeout -t 30 ./\${x} > logs/\${x}.log 2>&1
1943 +    countx=\$(expr \$countx + 1)
1944 +    if [ \$countx -eq 25 ]; then
1945 +      total=\$(expr \$total - 25)
1946 +      countx=0
1947 +      disinform
1948 +      inform \$total
1949 +    fi
1950 +  done
1951 +  disinform
1952 +  tar -czf remote.logs.tar.gz logs
1953 +}
1954 +testlist=" \\
1955 +EOF
1956 +
1957 +display "All tests are being cross-compiled without execution first."
1958 +
1959 +for chapter in $chapters; do
1960 +   if [ ! -d $dir/tests/$chapter ]; then
1961 +      continue
1962 +   fi
1963 +
1964 +   countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1965 +   glob_countn=`expr $glob_countn + $countn`
1966 +   counti=0
1967 +   for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
1968 +      counti=`expr $counti + 1`
1969 +      extraflags="-gnat95"
1970 +      grep $i $testdir/overflow.lst > /dev/null 2>&1
1971 +      if [ $? -eq 0 ]; then
1972 +         extraflags="$extraflags -gnato"
1973 +      fi
1974 +      grep $i $testdir/elabd.lst > /dev/null 2>&1
1975 +      if [ $? -eq 0 ]; then
1976 +         extraflags="$extraflags -gnatE"
1977 +      fi
1978 +      grep $i $testdir/floatstore.lst > /dev/null 2>&1
1979 +      if [ $? -eq 0 ]; then
1980 +         extraflags="$extraflags -ffloat-store"
1981 +      fi
1982 +      grep $i $testdir/stackcheck.lst > /dev/null 2>&1
1983 +      if [ $? -eq 0 ]; then
1984 +         extraflags="$extraflags -fstack-check"
1985 +      fi
1986 +      inform $countdown $i
1987 +      countdown=`expr $countdown - 1`
1988 +      test=$dir/tests/$chapter/$i
1989 +      mkdir $test && cd $test >> $dir/acats.log 2>&1
1990 +
1991 +      if [ $? -ne 0 ]; then
1992 +         disinform
1993 +         display "FAIL:        $i"
1994 +         failed="${failed}${i} "
1995 +         clean_dir
1996 +         continue
1997 +      fi
1998 +
1999 +      host_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
2000 +      find_main
2001 +      if [ -z "$main" ]; then
2002 +         sync
2003 +         find_main
2004 +      fi
2005 +      binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
2006 +      echo "BUILD $main" >> $dir/acats.log
2007 +      EXTERNAL_OBJECTS=""
2008 +      case $i in
2009 +        cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
2010 +        ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
2011 +        ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
2012 +        cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
2013 +      esac
2014 +      if [ "$main" = "" ]; then
2015 +         disinform
2016 +         display "FAIL:        $i"
2017 +         failed="${failed}${i} "
2018 +         clean_dir
2019 +         continue
2020 +      fi
2021 +
2022 +      target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
2023 +      if [ $? -ne 0 ]; then
2024 +         disinform
2025 +         display "FAIL:        $i"
2026 +         failed="${failed}${i} "
2027 +         clean_dir
2028 +         continue
2029 +      fi
2030 +      echo $chapter/$i/$binmain >> $dir/transfer.lst
2031 +      echo "$binmain \\" >> $dir/execute.sh
2032 +      $STRIP $binmain
2033 +      disinform
2034 +   done
2035 +done
2036 +echo '"' >> $dir/execute.sh
2037 +echo "cycle" >> $dir/execute.sh
2038 +
2039 +sync
2040 +display "Transfer files to remote device: root@tablet:$tabtarget/"
2041 +cd $dir/tests
2042 +cat $dir/transfer.lst | xargs tar --strip-components=2 -czf - |  \
2043 +  target_cmd "tar -C $tabtarget -xzf -"
2044 +cd $dir
2045 +tar -czf - execute.sh | target_cmd "tar -C $tabtarget -xzf -"
2046 +target_cmd "cd $tabtarget; sh execute.sh"
2047 +rm -rf $dir/logs $dir/remote.logs.tar.gz
2048 +/usr/bin/scp -q root@tablet:$tabtarget/remote.logs.tar.gz $dir/
2049 +tar -xzf $dir/remote.logs.tar.gz
2050 +
2051 +countdown=`wc -l < $dir/transfer.lst`
2052 +glob_countn=${countdown}
2053 +for i in `cat $dir/transfer.lst`; do
2054 +  split_testid $i
2055 +  if [ "$section" != "$savedsect" ]; then
2056 +   display Running chapter $section ...
2057 +  fi
2058 +  savedsect=$section
2059 +
2060 +  #inform $countdown $TN
2061 +  countdown=`expr $countdown - 1`
2062 +  proglog="$dir/logs/${prog}.log"
2063 +  echo "RUN $prog" >> $dir/acats.log
2064 +  if [ ! -f $proglog ]; then
2065 +    echo "LOG NOT FOUND!" >> $proglog
2066 +  fi
2067 +
2068 +  cat $proglog >> $dir/acats.log
2069 +
2070 +  egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' $proglog > /dev/null 2>&1
2071 +  if [ $? -ne 0 ]; then
2072 +     grep 'tasking not implemented' $proglog > /dev/null 2>&1
2073 +
2074 +     if [ $? -ne 0 ]; then
2075 +        display "FAIL: ${TN}"
2076 +        failed="${failed}${TN} "
2077 +     else
2078 +        log "UNSUPPORTED:      ${TN}"
2079 +        glob_countn=`expr $glob_countn - 1`
2080 +        glob_countu=`expr $glob_countu + 1`
2081 +     fi
2082 +  else
2083 +     log "PASS:        ${TN}"
2084 +     glob_countok=`expr $glob_countok + 1`
2085 +  fi
2086 +  cd $dir/tests/$section/$TN
2087 +  clean_dir
2088 +  #disinform
2089 +done
2090 +
2091 +display "              === acats Summary ==="
2092 +display "# of expected passes          $glob_countok"
2093 +display "# of unexpected failures      `expr $glob_countn - $glob_countok`"
2094 +
2095 +if [ $glob_countu -ne 0 ]; then
2096 +   display "# of unsupported tests             $glob_countu"
2097 +fi
2098 +
2099 +if [ $glob_countok -ne $glob_countn ]; then
2100 +   display "*** FAILURES: $failed"
2101 +fi
2102 +
2103 +display "$0 completed at `date`"
2104 +
2105 +exit 0
2106 --- gcc/testsuite/gnat.dg/test_raise_from_pure.adb.orig
2107 +++ gcc/testsuite/gnat.dg/test_raise_from_pure.adb
2108 @@ -1,4 +1,4 @@
2109 --- { dg-do run }
2110 +-- { dg-do run { xfail *-*-openbsd* } }
2111  -- { dg-options "-O2" }
2112  
2113  -- This is an optimization test and its failure is only a missed optimization.
2114 --- gcc/testsuite/gnat.dg/unchecked_convert5.adb.orig
2115 +++ gcc/testsuite/gnat.dg/unchecked_convert5.adb
2116 @@ -1,22 +0,0 @@
2117 --- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
2118 -
2119 -with Unchecked_Conversion;
2120 -
2121 -procedure Unchecked_Convert5 is
2122 -
2123 -  subtype c_1 is string(1..1);
2124 -
2125 -  function int2c1 is  -- { dg-warning "different sizes" }
2126 -    new unchecked_conversion (source => integer, target => c_1);
2127 -
2128 -  c1 : c_1;
2129 -
2130 -begin
2131 -
2132 -  c1 := int2c1(16#12#);
2133 -
2134 -  if c1 (1) /= ASCII.Nul then
2135 -    raise Program_Error;
2136 -  end if;
2137 -
2138 -end;
2139 --- gcc/testsuite/gnat.dg/unchecked_convert6.adb.orig
2140 +++ gcc/testsuite/gnat.dg/unchecked_convert6.adb
2141 @@ -1,22 +0,0 @@
2142 --- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
2143 -
2144 -with Unchecked_Conversion;
2145 -
2146 -procedure Unchecked_Convert6 is
2147 -
2148 -  subtype c_5 is string(1..5);
2149 -
2150 -  function int2c5 is  -- { dg-warning "different sizes" }
2151 -    new unchecked_conversion (source => integer, target => c_5);
2152 -
2153 -  c5 : c_5;
2154 -
2155 -begin
2156 -
2157 -  c5 := int2c5(16#12#);
2158 -
2159 -  if c5 (4) /= ASCII.DC2 then
2160 -    raise Program_Error;
2161 -  end if;
2162 -
2163 -end;
2164
2165
2166 [FILE:6122:patches/patch-diff-core]
2167 --- gcc/config/darwin.h.orig
2168 +++ gcc/config/darwin.h
2169 @@ -237,7 +237,7 @@
2170     multiple times on a command line with different arguments each time,
2171     so put a * after their names so all of them get passed.  */
2172  #define LINK_SPEC  \
2173 -  "%{static}%{!static:-dynamic} \
2174 +  "%{static}%{!static:-dynamic -rpath @PREFIX@/@GCCAUX@/lib:@LOCALBASE@/lib} \
2175     %:remove-outfile(-ldl) \
2176     %:remove-outfile(-lm) \
2177     %:remove-outfile(-lpthread) \
2178 --- gcc/config/dragonfly.h.orig
2179 +++ gcc/config/dragonfly.h
2180 @@ -84,13 +84,13 @@
2181     } \
2182     %{static:-Bstatic} \
2183    } \
2184 -  %{!static:--hash-style=gnu} \
2185 +  %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib:@LOCALBASE@/lib} \
2186    %{symbolic:-Bsymbolic}"
2187  
2188  #undef  LINK_SPEC
2189  #define LINK_SPEC DFBSD_LINK_SPEC
2190  
2191 -#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
2192 +#define DFBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.2"
2193  
2194  
2195  /* Use --as-needed -lgcc_s for eh support.  */
2196 --- gcc/config/sol2.h.orig
2197 +++ gcc/config/sol2.h
2198 @@ -421,6 +421,7 @@
2199     %{static:-dn -Bstatic} \
2200     %{shared:-G -dy %{!mimpure-text:-z text}} " \
2201     LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC " \
2202 +   %{!static:-R/lib/amd64:@PREFIX@/@GCCAUX@/lib/amd64:@LOCALBASE@/lib} \
2203     %{symbolic:-Bsymbolic -G -dy -z text} \
2204     %(link_arch) \
2205     %{Qy:} %{!Qn:-Qy}"
2206 --- gcc/config/aarch64/aarch64-freebsd.h.orig
2207 +++ gcc/config/aarch64/aarch64-freebsd.h
2208 @@ -40,7 +40,7 @@
2209      %{shared:-Bshareable %{h*} %{soname*}}                      \
2210      %{symbolic:-Bsymbolic}                                      \
2211      %{static:-Bstatic}                                          \
2212 -    %{!static:                                                  \
2213 +    %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib:@LOCALBASE@/lib \
2214        %{rdynamic:-export-dynamic}                               \
2215        %{!shared:-dynamic-linker " FBSD_DYNAMIC_LINKER " }}      \
2216      -X" SUBTARGET_EXTRA_LINK_SPEC "                             \
2217 @@ -99,4 +99,6 @@
2218  #undef MCOUNT_NAME
2219  #define MCOUNT_NAME ".mcount"
2220  
2221 +/* Static stack checking is supported by means of probes.  */
2222 +#define STACK_CHECK_STATIC_BUILTIN 1
2223  #endif  /* GCC_AARCH64_FREEBSD_H */
2224 --- gcc/config/i386/freebsd.h.orig
2225 +++ gcc/config/i386/freebsd.h
2226 @@ -88,6 +88,7 @@
2227          %{rdynamic:-export-dynamic} \
2228          -dynamic-linker %(fbsd_dynamic_linker) } \
2229      %{static:-Bstatic}} \
2230 +  %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib:@LOCALBASE@/lib} \
2231    %{symbolic:-Bsymbolic}"
2232  
2233  /* A C statement to output to the stdio stream FILE an assembler
2234 --- gcc/config/i386/freebsd64.h.orig
2235 +++ gcc/config/i386/freebsd64.h
2236 @@ -41,4 +41,5 @@
2237          %{rdynamic:-export-dynamic} \
2238         -dynamic-linker %(fbsd_dynamic_linker) } \
2239      %{static:-Bstatic}} \
2240 +  %{!static:--hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib:@LOCALBASE@/lib} \
2241    %{symbolic:-Bsymbolic}"
2242 --- gcc/Makefile.in.orig
2243 +++ gcc/Makefile.in
2244 @@ -1225,7 +1225,6 @@
2245         insn-emit.o \
2246         insn-extract.o \
2247         insn-latencytab.o \
2248 -       insn-modes.o \
2249         insn-opinit.o \
2250         insn-output.o \
2251         insn-peep.o \
2252 @@ -1637,6 +1636,7 @@
2253    $(OBJS-libcommon-target) main.o c-family/cppspec.o \
2254    $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
2255    $(GCOV_TOOL_OBJS) $(GENGTYPE_OBJS) gcc-ar.o gcc-nm.o gcc-ranlib.o \
2256 +  insn-modes.o insn-modes-ada.o \
2257    lto-wrapper.o collect-utils.o
2258  
2259  # for anything that is shared use the cc1plus profile data, as that
2260 @@ -1652,6 +1652,11 @@
2261  ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
2262  
2263  BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \
2264 +       insn-modes.o \
2265 +       $(CPPLIB) $(LIBDECNUMBER)
2266 +
2267 +BACKEND2 = libbackend.a main.o libcommon-target.a libcommon.a \
2268 +       insn-modes-ada.o \
2269         $(CPPLIB) $(LIBDECNUMBER)
2270  
2271  # This is defined to "yes" if Tree checking is enabled, which roughly means
2272 @@ -2362,6 +2367,7 @@
2273  
2274  insn-modes.c: s-modes; @true
2275  insn-modes.h: s-modes-h; @true
2276 +insn-modes-ada.c: s-modes-ada; @true
2277  insn-modes-inline.h: s-modes-inline-h; @true
2278  min-insn-modes.c: s-modes-m; @true
2279  
2280 @@ -2386,6 +2392,12 @@
2281         $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
2282         $(STAMP) s-modes-m
2283  
2284 +s-modes-ada: s-modes
2285 +       $(shell sed -e 's/: TARGET_96_ROUND_53_LONG_DOUBLE \? &ieee_extended_intel_96_round_53_format //' \
2286 +               < insn-modes.c > tmp-modes-ada.c)
2287 +       $(SHELL) $(srcdir)/../move-if-change tmp-modes-ada.c insn-modes-ada.c
2288 +       $(STAMP) s-modes-ada
2289 +
2290  insn-preds.c: s-preds; @true
2291  tm-preds.h: s-preds-h; @true
2292  tm-constrs.h: s-constrs-h; @true
2293 @@ -3617,6 +3629,9 @@
2294             ( cd $(DESTDIR)$(bindir) && \
2295               $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \
2296           fi; \
2297 +         if [ -f gnat1$(exeext) ] ; then \
2298 +           ( cd $(DESTDIR)$(bindir) && $(LN) $(GCC_INSTALL_NAME)$(exeext) ada$(exeext) ) \
2299 +         fi; \
2300           if [ ! -f gcc-cross$(exeext) ] \
2301               && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
2302             rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
2303 --- gcc/config/i386/gnu-user64.h.orig
2304 +++ gcc/config/i386/gnu-user64.h
2305 @@ -57,6 +57,7 @@
2306                     %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
2307                     %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
2308    %{shared:-shared} \
2309 +  %{!static:--enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib64:@LOCALBASE@/lib} \
2310    %{!shared: \
2311      %{!static: \
2312        %{!static-pie: \
2313 --- gcc/gcc.c.orig
2314 +++ gcc/gcc.c
2315 @@ -1513,6 +1513,9 @@
2316  static const char *const standard_startfile_prefix_2
2317    = STANDARD_STARTFILE_PREFIX_2;
2318  
2319 +/* Since we hardset rpath to LOCALBASE, follow with library search path */
2320 +static const char *const standard_raven_prefix = "@LOCALBASE@/lib/";
2321 +
2322  /* A relative path to be used in finding the location of tools
2323     relative to the driver.  */
2324  static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
2325 @@ -4695,6 +4698,8 @@
2326  #endif
2327        add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
2328                   PREFIX_PRIORITY_LAST, 1, 0);
2329 +      add_prefix (&startfile_prefixes, standard_raven_prefix, "BINUTILS",
2330 +                 PREFIX_PRIORITY_LAST, 0, 0);
2331      }
2332  
2333    gcc_assert (!IS_ABSOLUTE_PATH (tooldir_base_prefix));
2334
2335
2336 [FILE:8497:patches/patch-diff-cxx]
2337 --- libstdc++-v3/configure.host.orig
2338 +++ libstdc++-v3/configure.host
2339 @@ -261,6 +261,9 @@
2340    freebsd*)
2341      os_include_dir="os/bsd/freebsd"
2342      ;;
2343 +  linux-android*)
2344 +    os_include_dir="os/bionic"
2345 +    ;;
2346    linux-musl*)
2347      os_include_dir="os/generic"
2348      ;;
2349 --- libstdc++-v3/config/os/bionic/ctype_base.h.orig
2350 +++ libstdc++-v3/config/os/bionic/ctype_base.h
2351 @@ -38,6 +38,18 @@
2352      // Non-standard typedefs.
2353      typedef const int*                 __to_type;
2354  
2355 +#ifdef _CTYPE_U
2356 +#define _U _CTYPE_U
2357 +#define _L _CTYPE_L
2358 +#define _D _CTYPE_D
2359 +#define _S _CTYPE_S
2360 +#define _P _CTYPE_P
2361 +#define _C _CTYPE_C
2362 +#define _X _CTYPE_X
2363 +#define _B _CTYPE_B
2364 +#define _N _CTYPE_D
2365 +#endif
2366 +
2367      // NB: Offsets into ctype<char>::_M_table force a particular size
2368      // on the mask type. Because of this, we don't use an enum.
2369      typedef char               mask;
2370 --- libstdc++-v3/src/c++11/futex.cc.orig
2371 +++ libstdc++-v3/src/c++11/futex.cc
2372 @@ -27,7 +27,11 @@
2373  #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
2374  #include <chrono>
2375  #include <climits>
2376 +#ifdef __ANDROID__
2377 +#include <sys/syscall.h>
2378 +#else
2379  #include <syscall.h>
2380 +#endif
2381  #include <unistd.h>
2382  #include <sys/time.h>
2383  #include <errno.h>
2384 --- libstdc++-v3/include/bits/c++config.orig
2385 +++ libstdc++-v3/include/bits/c++config
2386 @@ -30,6 +30,12 @@
2387  #ifndef _GLIBCXX_CXX_CONFIG_H
2388  #define _GLIBCXX_CXX_CONFIG_H 1
2389  
2390 +#ifdef __clang__
2391 +#define _GTHROW
2392 +#else
2393 +#define _GTHROW throw()
2394 +#endif
2395 +
2396  // The major release number for the GCC release the C++ library belongs to.
2397  #define _GLIBCXX_RELEASE
2398  
2399 --- libstdc++-v3/include/c_global/cstdio.orig
2400 +++ libstdc++-v3/include/c_global/cstdio
2401 @@ -159,16 +159,16 @@
2402  #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
2403    extern "C" int
2404    (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...)
2405 -  throw ();
2406 +  _GTHROW;
2407    extern "C" int
2408    (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
2409    extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
2410    extern "C" int
2411    (vsnprintf)(char * __restrict, std::size_t, const char * __restrict,
2412 -             __gnuc_va_list) throw ();
2413 +             __gnuc_va_list) _GTHROW;
2414    extern "C" int
2415    (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list)
2416 -  throw ();
2417 +  _GTHROW;
2418  #endif
2419  
2420  #if !_GLIBCXX_USE_C99_DYNAMIC
2421 --- libstdc++-v3/include/c_global/cstdlib.orig
2422 +++ libstdc++-v3/include/c_global/cstdlib
2423 @@ -54,15 +54,15 @@
2424  
2425  namespace std
2426  {
2427 -  extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
2428 -  extern "C" int atexit(void (*)(void)) throw ();
2429 -  extern "C" void exit(int) throw () _GLIBCXX_NORETURN;
2430 +  extern "C" void abort(void) _GTHROW _GLIBCXX_NORETURN;
2431 +  extern "C" int atexit(void (*)(void)) _GTHROW;
2432 +  extern "C" void exit(int) _GTHROW _GLIBCXX_NORETURN;
2433  #if __cplusplus >= 201103L
2434  # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
2435 -  extern "C" int at_quick_exit(void (*)(void)) throw ();
2436 +  extern "C" int at_quick_exit(void (*)(void)) _GTHROW;
2437  # endif
2438  # ifdef _GLIBCXX_HAVE_QUICK_EXIT
2439 -  extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN;
2440 +  extern "C" void quick_exit(int) _GTHROW _GLIBCXX_NORETURN;
2441  # endif
2442  #endif
2443  } // namespace std
2444 @@ -200,7 +200,7 @@
2445    using ::lldiv_t;
2446  #endif
2447  #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
2448 -  extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN;
2449 +  extern "C" void (_Exit)(int) _GTHROW _GLIBCXX_NORETURN;
2450  #endif
2451  #if !_GLIBCXX_USE_C99_DYNAMIC
2452    using ::_Exit;
2453 @@ -217,11 +217,11 @@
2454  #endif
2455  
2456  #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2457 -  extern "C" long long int (atoll)(const char *) throw ();
2458 +  extern "C" long long int (atoll)(const char *) _GTHROW;
2459    extern "C" long long int
2460 -    (strtoll)(const char * __restrict, char ** __restrict, int) throw ();
2461 +    (strtoll)(const char * __restrict, char ** __restrict, int) _GTHROW;
2462    extern "C" unsigned long long int
2463 -    (strtoull)(const char * __restrict, char ** __restrict, int) throw ();
2464 +    (strtoull)(const char * __restrict, char ** __restrict, int) _GTHROW;
2465  #endif
2466  #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2467    using ::atoll;
2468 --- libstdc++-v3/include/c_global/cwchar.orig
2469 +++ libstdc++-v3/include/c_global/cwchar
2470 @@ -245,16 +245,16 @@
2471  {
2472  #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
2473    extern "C" long double
2474 -    (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw ();
2475 +    (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) _GTHROW;
2476  #endif
2477  #if !_GLIBCXX_USE_C99_DYNAMIC
2478    using ::wcstold;
2479  #endif
2480  #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2481    extern "C" long long int
2482 -    (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
2483 +    (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW;
2484    extern "C" unsigned long long int
2485 -    (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
2486 +    (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW;
2487  #endif
2488  #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2489    using ::wcstoll;
2490 --- libstdc++-v3/include/c_std/cstdio.orig
2491 +++ libstdc++-v3/include/c_std/cstdio
2492 @@ -157,16 +157,16 @@
2493  #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
2494    extern "C" int
2495    (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...)
2496 -  throw ();
2497 +  _GTHROW;
2498    extern "C" int
2499    (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
2500    extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
2501    extern "C" int
2502    (vsnprintf)(char * __restrict, std::size_t, const char * __restrict,
2503 -             __gnuc_va_list) throw ();
2504 +             __gnuc_va_list) _GTHROW;
2505    extern "C" int
2506    (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list)
2507 -  throw ();
2508 +  _GTHROW;
2509  #endif
2510  
2511  #if !_GLIBCXX_USE_C99_DYNAMIC
2512 --- libstdc++-v3/include/c_std/cstdlib.orig
2513 +++ libstdc++-v3/include/c_std/cstdlib
2514 @@ -54,15 +54,15 @@
2515  
2516  namespace std
2517  {
2518 -  extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
2519 -  extern "C" int atexit(void (*)(void)) throw ();
2520 -  extern "C" void exit(int) throw () _GLIBCXX_NORETURN;
2521 +  extern "C" void abort(void) _GTHROW _GLIBCXX_NORETURN;
2522 +  extern "C" int atexit(void (*)(void)) _GTHROW;
2523 +  extern "C" void exit(int) _GTHROW _GLIBCXX_NORETURN;
2524  #if __cplusplus >= 201103L
2525  # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
2526 -  extern "C" int at_quick_exit(void (*)(void)) throw ();
2527 +  extern "C" int at_quick_exit(void (*)(void)) _GTHROW;
2528  # endif
2529  # ifdef _GLIBCXX_HAVE_QUICK_EXIT
2530 -  extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN;
2531 +  extern "C" void quick_exit(int) _GTHROW _GLIBCXX_NORETURN;
2532  # endif
2533  #endif
2534  } // namespace
2535 @@ -211,7 +211,7 @@
2536    using ::lldiv_t;
2537  #endif
2538  #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
2539 -  extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN;
2540 +  extern "C" void (_Exit)(int) _GTHROW _GLIBCXX_NORETURN;
2541  #endif
2542  #if !_GLIBCXX_USE_C99_DYNAMIC
2543    using ::_Exit;
2544 @@ -228,11 +228,11 @@
2545  #endif
2546  
2547  #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2548 -  extern "C" long long int (atoll)(const char *) throw ();
2549 +  extern "C" long long int (atoll)(const char *) _GTHROW;
2550    extern "C" long long int
2551 -    (strtoll)(const char * __restrict, char ** __restrict, int) throw ();
2552 +    (strtoll)(const char * __restrict, char ** __restrict, int) _GTHROW;
2553    extern "C" unsigned long long int
2554 -    (strtoull)(const char * __restrict, char ** __restrict, int) throw ();
2555 +    (strtoull)(const char * __restrict, char ** __restrict, int) _GTHROW;
2556  #endif
2557  #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2558    using ::atoll;
2559 --- libstdc++-v3/include/c_std/cwchar.orig
2560 +++ libstdc++-v3/include/c_std/cwchar
2561 @@ -238,16 +238,16 @@
2562  {
2563  #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
2564    extern "C" long double
2565 -    (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw ();
2566 +    (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) _GTHROW;
2567  #endif
2568  #if !_GLIBCXX_USE_C99_DYNAMIC
2569    using ::wcstold;
2570  #endif
2571  #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2572    extern "C" long long int
2573 -    (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
2574 +    (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW;
2575    extern "C" unsigned long long int
2576 -    (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
2577 +    (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW;
2578  #endif
2579  #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
2580    using ::wcstoll;
2581
2582
2583 [FILE:1612:patches/patch-diff-gcc-testsuite]
2584 --- gcc/testsuite/gcc.dg/format/ext-1.c.orig
2585 +++ gcc/testsuite/gcc.dg/format/ext-1.c
2586 @@ -8,7 +8,7 @@
2587  #include "format.h"
2588  
2589  void
2590 -foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
2591 +foo (quad2_t q, u_quad2_t uq, quad2_t *qn, size_t z, size_t *zn, long long int ll,
2592       unsigned long long int ull, int i, unsigned int u, double d,
2593       char *s, void *p, wchar_t *ls, wint_t lc, int *n, long int l)
2594  {
2595 --- gcc/testsuite/gcc.dg/format/ext-2.c.orig
2596 +++ gcc/testsuite/gcc.dg/format/ext-2.c
2597 @@ -8,7 +8,7 @@
2598  #include "format.h"
2599  
2600  void
2601 -foo (quad_t *qp, u_quad_t *uqp, quad_t *qn, long long int *llp,
2602 +foo (quad2_t *qp, u_quad2_t *uqp, quad2_t *qn, long long int *llp,
2603       unsigned long long int *ullp, float *fp, char *s, void **pp, wchar_t *ls,
2604       int *ip, unsigned int *up)
2605  {
2606 --- gcc/testsuite/gcc.dg/format/format.h.orig
2607 +++ gcc/testsuite/gcc.dg/format/format.h
2608 @@ -71,8 +71,8 @@
2609  #endif
2610  
2611  /* %q formats want a "quad"; GCC considers this to be a long long.  */
2612 -typedef llong quad_t;
2613 -typedef ullong u_quad_t;
2614 +typedef llong quad2_t;
2615 +typedef ullong u_quad2_t;
2616  
2617  __extension__ typedef __INTMAX_TYPE__ intmax_t;
2618  __extension__ typedef __UINTMAX_TYPE__ uintmax_t;
2619 --- gcc/testsuite/gcc.dg/pch/pch.exp.orig
2620 +++ gcc/testsuite/gcc.dg/pch/pch.exp
2621 @@ -44,6 +44,8 @@
2622  set test "largefile.c"
2623  set testh "largefile.hs"
2624  set f [open $test w]
2625 +puts $f "/* { dg-do run { target *-*-solaris* } } */"
2626 +puts $f "/* { dg-error \"dummy\" \"fool dejagnu\" { target { ! *-*-solaris* } 20 } } */"
2627  puts $f "/* { dg-timeout-factor 4.0 } */"
2628  set v 0
2629  for { set v 0 } { $v < 10000 } { incr v } {
2630