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