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