1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[FARM64_R11]= C/Ada cross-compiler, target: FreeBSD/ARM64 (R11)
8 HOMEPAGE= http://www.dragonlace.net
9 CONTACT= John_Marino[draco@marino.st]
12 SITES[main]= GCC/releases/gcc-7.2.0
13 DISTFILE[1]= gcc-7.2.0.tar.xz:main
15 SPKGS[FARM64_R11]= single
17 OPTIONS_AVAILABLE= FARM64R11
18 OPTIONS_STANDARD= none
19 VOPTS[FARM64_R11]= FARM64R11=ON
21 BUILD_DEPENDS= gmp:static:standard
25 libiconv:static:standard
27 USES= gmake libtool perl:build
31 LICENSE= GPLv2+:single LGPL21:single GPLv3+:single
32 LGPL3:single GPLv3RLE:single
34 LICENSE_FILE= GPLv2+:{{WRKSRC}}/COPYING
35 LGPL21:{{WRKSRC}}/COPYING.LIB
36 GPLv3+:{{WRKSRC}}/COPYING3
37 LGPL3:{{WRKSRC}}/COPYING3.LIB
38 GPLv3RLE:{{WRKSRC}}/COPYING.RUNTIME
41 CONFIGURE_OUTSOURCE= yes
42 CONFIGURE_ARGS= --enable-languages="c c++ ada fortran"
43 --target={{XCCTARGET}}
44 --program-prefix={{XCCTARGET}}-
46 --with-sysroot={{SRPREFIX}}
48 --with-gmp={{LOCALBASE}}
49 --with-mpfr={{LOCALBASE}}
50 --with-mpc={{LOCALBASE}}
51 --with-iconv={{LOCALBASE}}
52 --enable-threads=posix
53 --enable-checking=release
59 --disable-libsanitizer
65 PLIST_SUB= GCCVERS="7.2.0"
66 TARGET="{{XCCTARGET}}"
67 SUB_FILES= pkg-message-single
68 SUB_LIST= TARGET="{{XCCTARGET}}"
70 [FARM64R11].DESCRIPTION= Set target to FreeBSD/ARM64 (Release 11)
71 [FARM64R11].BUILDRUN_DEPENDS_ON= gnatcross-binutils:single:FARM64_R11
72 [FARM64R11].MAKEFILE_ON= OS_LABEL4VERS="[{{OPSYS}}/{{ARCH}} x FreeBSD_11/ARM64]"
73 PREFIX={{LOCALBASE}}/FreeBSD11_ARM64
74 SRPREFIX={{PREFIX}}/sysroot
75 XCCTARGET=aarch64-raven-freebsd11.1
79 # Update LINK_SPEC to add gcc-aux lib runpath in every binary
80 @${ECHO} "Configuring LINK_SPEC runpath"
81 @${REINPLACE_CMD} -e 's;\@PREFIX\@;${PREFIX};' \
82 ${WRKSRC}/gcc/config/dragonfly.h \
83 ${WRKSRC}/gcc/config/i386/freebsd64.h \
84 ${WRKSRC}/gcc/config/i386/freebsd.h \
85 ${WRKSRC}/gcc/config/i386/gnu-user64.h \
86 ${WRKSRC}/gcc/config/aarch64/aarch64-freebsd.h
87 # work around malloc detection issue
88 ${REINPLACE_CMD} -e 's/#undef HAVE_ALIGNED_ALLOC/#define HAVE_ALIGNED_ALLOC 1/' \
89 ${WRKSRC}/libstdc++-v3/config.h.in
92 ${RM} -r ${STAGEDIR}${PREFIX}/lib/gcc/${XCCTARGET}/7.2.0/include-fixed/
93 ${RM} -r ${STAGEDIR}${MANPREFIX}
95 (cd ${STAGEDIR}${PREFIX}; ${FIND} * -type d -empty | \
96 ${SORT} -dr | ${XARGS} ${RMDIR})
98 (cd ${STAGEDIR}${PREFIX}; \
99 ${FIND} * \( -type f -or -type l \) | ${SORT} | \
100 ${SED} -e '/^bin\//d' -e '/^${XCCTARGET}\/bin\//d' \
101 >> ${WRKDIR}/.manifest.single.mktmp)
104 # Personalize GNAT for each different machine
105 @${ECHO} "-=> GNATCROSS ${OS_LABEL4VERS}" > ${WRKSRC}/gcc/REVISION
108 # Buggy makefile; seems to have forgotten this is a cross compiler
109 # Manually rename products so it doesn't rebuild them with new name
110 .for X in gnat gnatbind gnatchop gnatclean gnatfind gnatkr gnatlink gnatls \
111 gnatmake gnatprep gnatxref
112 if [ ! -f "${BUILD_WRKSRC}/gcc/${X}" ]; then \
113 ${CP} -a ${BUILD_WRKSRC}/gcc/${X}-cross ${BUILD_WRKSRC}/gcc/${X}; \
116 (cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV:C/^PATH=/&${PREFIX}\/bin:/} \
117 ${MAKE_CMD} install-strip DESTDIR=${STAGEDIR})
118 ${MV} ${STAGEDIR}${PREFIX}/bin/ada \
119 ${STAGEDIR}${PREFIX}/bin/${XCCTARGET}-ada
121 [FILE:134:descriptions/desc.single.FARM64_R11]
122 This package contains a C/C++/Fortran/Ada cross-compiler based on GCC 7
123 that targets the FreeBSD/ARM64 operating system (Release 11).
127 1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a 62312628 gcc-7.2.0.tar.xz
130 [FILE:501:manifests/plist.single]
135 %%TARGET%%-gcc-%%GCCVERS%%
141 %%TARGET%%-gcc-ranlib
159 [FILE:39877:patches/patch-diff-ada]
160 --- gcc/ada/adaint.c.orig
162 @@ -1174,6 +1174,47 @@
166 +#elif defined (__ANDROID__)
169 + * ext2 /ext3/ext4/fat16/fat32 have no path limits
170 + * /data/local/tmp normally requires rooted devices, if it even exists
171 + * /sdcard is the standard location for external storage. Nativeactivity
172 + * manifest needs to authorize its use, otherwise it might not have the
173 + * proper permissions.
177 + char *datadir = getenv ("ANDROID_DATA");
179 + if (datadir == NULL)
180 + strncpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX", L_tmpnam);
182 + snprintf (tmp_filename, L_tmpnam, "%s/local/tmp/gnat-XXXXXX", datadir);
184 + testfd = mkstemp (tmp_filename);
191 + char *sdcard = getenv ("EXTERNAL_STORAGE");
193 + if (sdcard == NULL)
194 + strncpy (tmp_filename, "/sdcard/gnat-XXXXXX", L_tmpnam);
196 + snprintf (tmp_filename, L_tmpnam, "%s/gnat-XXXXXX", sdcard);
198 + testfd = mkstemp (tmp_filename);
205 + tmpnam (tmp_filename);
207 #elif defined (__linux__) || defined (__FreeBSD__) || defined (__NetBSD__) \
208 || defined (__OpenBSD__) || defined (__GLIBC__) || defined (__ANDROID__) \
209 || defined (__DragonFly__)
210 @@ -1460,7 +1501,7 @@
211 utimbuf.modtime = time_stamp;
213 /* Set access time to now in local time. */
214 - t = time ((time_t) 0);
216 utimbuf.actime = mktime (localtime (&t));
218 utime (name, &utimbuf);
219 --- gcc/ada/cio.c.orig
223 /* Don't use macros on GNU/Linux since they cause incompatible changes between
226 +#if defined __linux__ && !defined __ANDROID__
230 --- gcc/ada/cstreams.c.orig
231 +++ gcc/ada/cstreams.c
237 +#if defined __linux__ && !defined __ANDROID__
238 /* Don't use macros on GNU/Linux since they cause incompatible changes between
242 +++ gcc/ada/g-socthi-bsd.adb
244 +------------------------------------------------------------------------------
246 +-- GNAT COMPILER COMPONENTS --
248 +-- G N A T . S O C K E T S . T H I N --
252 +-- Copyright (C) 2001-2013, AdaCore --
254 +-- GNAT is free software; you can redistribute it and/or modify it under --
255 +-- terms of the GNU General Public License as published by the Free Soft- --
256 +-- ware Foundation; either version 3, or (at your option) any later ver- --
257 +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
258 +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
259 +-- or FITNESS FOR A PARTICULAR PURPOSE. --
261 +-- As a special exception under Section 7 of GPL version 3, you are granted --
262 +-- additional permissions described in the GCC Runtime Library Exception, --
263 +-- version 3.1, as published by the Free Software Foundation. --
265 +-- You should have received a copy of the GNU General Public License and --
266 +-- a copy of the GCC Runtime Library Exception along with this program; --
267 +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
268 +-- <http://www.gnu.org/licenses/>. --
270 +-- GNAT was originally developed by the GNAT team at New York University. --
271 +-- Extensive contributions were provided by Ada Core Technologies Inc. --
273 +------------------------------------------------------------------------------
275 +-- This package provides a target dependent thin interface to the sockets
276 +-- layer for use by the GNAT.Sockets package (g-socket.ads). This package
277 +-- should not be directly with'ed by an applications program.
279 +-- This is the *BSD version which uses fcntl rather than ioctl
280 +-- The constant SCON.Thread_Blocking_IO is always true (for all platforms, not
281 +-- just *BSD), so this binding is significantly simpler than the standard
284 +with GNAT.OS_Lib; use GNAT.OS_Lib;
286 +with Interfaces.C; use Interfaces.C;
288 +package body GNAT.Sockets.Thin is
290 + function Syscall_Accept
292 + Addr : System.Address;
293 + Addrlen : not null access C.int) return C.int;
294 + pragma Import (C, Syscall_Accept, "accept");
295 + -- The accept() function accepts a connection on a socket. An incoming
296 + -- connection is acknowledged and associated with an immediately created
297 + -- socket. The original socket is returned to the listening state.
299 + function Syscall_Connect
301 + Name : System.Address;
302 + Namelen : C.int) return C.int;
303 + pragma Import (C, Syscall_Connect, "connect");
304 + -- The connect() system call initiates a connection on a socket. If the
305 + -- parameter S is of type SOCK_DGRAM then connect() permanently specifies
306 + -- the peer to which datagrams are to be sent. If S is type SOCK_STREAM
307 + -- then connect() attempts to make a connection with another socket, which
308 + -- is identified by the parameter Name.
310 + function Syscall_Recv
312 + Msg : System.Address;
314 + Flags : C.int) return C.int;
315 + pragma Import (C, Syscall_Recv, "recv");
316 + -- The recv() function receives a message from a socket. The call can be
317 + -- used on a connection mode socket or a bound, connectionless socket. If
318 + -- no messages are available at the socket, the recv() call waits for a
319 + -- message to arrive unless the socket is non-blocking. If a socket is
320 + -- non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK.
322 + function Syscall_Recvfrom
324 + Msg : System.Address;
327 + From : System.Address;
328 + Fromlen : not null access C.int) return C.int;
329 + pragma Import (C, Syscall_Recvfrom, "recvfrom");
330 + -- The recvfrom() system call receives a message from a socket and captures
331 + -- the address from which the data was sent. It can be used to receive
332 + -- data on an unconnected socket as well. If no messages are available,
333 + -- the call waits for a message to arrive on blocking sockets. For
334 + -- non-blocking sockets without messages, -1 is returned and ERRNO is set
335 + -- to EAGAIN or EWOULDBLOCK.
337 + function Syscall_Recvmsg
339 + Msg : System.Address;
340 + Flags : C.int) return System.CRTL.ssize_t;
341 + pragma Import (C, Syscall_Recvmsg, "recvmsg");
342 + -- The recvmsg call receives a message from a socket, and can be used to
343 + -- receive data on an unconnected socket as well. If no messages are
344 + -- available, the call waits for a message to arrive on blocking sockets.
345 + -- For non-blocking sockets without messages, -1 is returned and ERRNO is
346 + -- set to EAGAIN or EWOULDBLOCK.
348 + function Syscall_Sendmsg
350 + Msg : System.Address;
351 + Flags : C.int) return System.CRTL.ssize_t;
352 + pragma Import (C, Syscall_Sendmsg, "sendmsg");
353 + -- The sendmsg() function sends a message to a socket, and can be used with
354 + -- unconnected sockets as well (the msg is ignored in this case). The
355 + -- function returns the number of bytes sent when successful, otherwise it
356 + -- returns -1 and ERRNO is set (many possible values).
358 + function Syscall_Sendto
360 + Msg : System.Address;
363 + To : System.Address;
364 + Tolen : C.int) return C.int;
365 + pragma Import (C, Syscall_Sendto, "sendto");
366 + -- The sendto() function only works for connected sockets and it initiates
367 + -- the transmission of a message. A successful call returns the numbers of
368 + -- bytes sent, and a failure returns a -1 and ERRNO is set.
370 + function Syscall_Socket
373 + Protocol : C.int) return C.int;
374 + pragma Import (C, Syscall_Socket, "socket");
375 + -- The socket() function is used to create an unbound socket and returns a
376 + -- file descriptor that can be used with other socket functions. Upon
377 + -- failure, a -1 is returned and ERRNO is set.
379 + procedure Disable_SIGPIPE (S : C.int);
380 + pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe");
382 + procedure Disable_All_SIGPIPEs;
383 + pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes");
384 + -- Sets the process to ignore all SIGPIPE signals on platforms that
385 + -- don't support Disable_SIGPIPE for particular streams.
390 + Val : C.int) return C.int;
391 + pragma Import (C, C_Fcntl, "fcntl");
392 + -- The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support
393 + -- setting a socket in non-blocking mode. fcntl must be used instead.
401 + Addr : System.Address;
402 + Addrlen : not null access C.int) return C.int
404 + R : constant C.int := Syscall_Accept (S, Addr, Addrlen);
407 + Disable_SIGPIPE (R);
417 + Name : System.Address;
418 + Namelen : C.int) return C.int
421 + return Syscall_Connect (S, Name, Namelen);
428 + function Socket_Ioctl
430 + Req : SOSC.IOCTL_Req_T;
431 + Arg : access C.int) return C.int
434 + if Req = SOSC.FIONBIO then
437 + flags : constant Unsigned_32 :=
438 + Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
439 + nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.O_NDELAY);
440 + enabled : constant Boolean := Arg.all = 1;
441 + newval : C.int := C.int (flags);
444 + newval := C.int (flags or nonblock);
445 + elsif (flags and nonblock) > 0 then
446 + newval := C.int (flags - nonblock);
448 + return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval);
452 + return C_Ioctl (S, Req, Arg);
461 + Msg : System.Address;
463 + Flags : C.int) return C.int
466 + return Syscall_Recv (S, Msg, Len, Flags);
473 + function C_Recvfrom
475 + Msg : System.Address;
478 + From : System.Address;
479 + Fromlen : not null access C.int) return C.int
482 + return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
491 + Msg : System.Address;
492 + Flags : C.int) return System.CRTL.ssize_t
495 + return Syscall_Recvmsg (S, Msg, Flags);
504 + Msg : System.Address;
505 + Flags : C.int) return System.CRTL.ssize_t
508 + return Syscall_Sendmsg (S, Msg, Flags);
517 + Msg : System.Address;
520 + To : System.Address;
521 + Tolen : C.int) return C.int
524 + return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
534 + Protocol : C.int) return C.int
536 + R : constant C.int := Syscall_Socket (Domain, Typ, Protocol);
538 + Disable_SIGPIPE (R);
546 + procedure Finalize is
551 + -------------------------
552 + -- Host_Error_Messages --
553 + -------------------------
555 + package body Host_Error_Messages is separate;
561 + procedure Initialize is
563 + Disable_All_SIGPIPEs;
566 + --------------------
567 + -- Signalling_Fds --
568 + --------------------
570 + package body Signalling_Fds is
572 + -- In this default implementation, we use a C version of these
573 + -- subprograms provided by socket.c.
575 + function C_Create (Fds : not null access Fd_Pair) return C.int;
576 + function C_Read (Rsig : C.int) return C.int;
577 + function C_Write (Wsig : C.int) return C.int;
578 + procedure C_Close (Sig : C.int);
580 + pragma Import (C, C_Create, "__gnat_create_signalling_fds");
581 + pragma Import (C, C_Read, "__gnat_read_signalling_fd");
582 + pragma Import (C, C_Write, "__gnat_write_signalling_fd");
583 + pragma Import (C, C_Close, "__gnat_close_signalling_fd");
586 + (Fds : not null access Fd_Pair) return C.int renames C_Create;
587 + function Read (Rsig : C.int) return C.int renames C_Read;
588 + function Write (Wsig : C.int) return C.int renames C_Write;
589 + procedure Close (Sig : C.int) renames C_Close;
591 + end Signalling_Fds;
593 + --------------------------
594 + -- Socket_Error_Message --
595 + --------------------------
597 + function Socket_Error_Message (Errno : Integer) return String is separate;
599 +end GNAT.Sockets.Thin;
600 --- gcc/ada/gnatchop.adb.orig
601 +++ gcc/ada/gnatchop.adb
603 Config_File_Name : constant String_Access := new String'("gnat.adc");
604 -- The name of the file holding the GNAT configuration pragmas
606 - Gcc : String_Access := new String'("gcc");
607 + Gcc : String_Access := new String'("ada");
608 -- May be modified by switch --GCC=
610 Gcc_Set : Boolean := False;
611 --- gcc/ada/gnatlink.adb.orig
612 +++ gcc/ada/gnatlink.adb
614 -- This table collects the arguments to be passed to compile the binder
617 - Gcc : String_Access := Program_Name ("gcc", "gnatlink");
618 + Gcc : String_Access := Program_Name ("ada", "gnatlink");
620 Read_Mode : constant String := "r" & ASCII.NUL;
622 --- gcc/ada/make.adb.orig
625 -- Compiler, Binder & Linker Data and Subprograms --
626 ----------------------------------------------------
628 - Gcc : String_Access := Program_Name ("gcc", "gnatmake");
629 + Gcc : String_Access := Program_Name ("ada", "gnatmake");
630 Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
631 Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
632 -- Default compiler, binder, linker programs
633 --- gcc/ada/mlib-prj.adb.orig
634 +++ gcc/ada/mlib-prj.adb
637 Foreign_Sources : Boolean;
639 + Rpath_Disabled : Boolean := False;
640 + -- If -R is passed through the library options for the linker, it will
641 + -- prevent the implemented libraries portion of the rpath switch from
642 + -- being built, even if the linker is capable of supporting rpath.
644 Rpath : String_Access := null;
645 -- Allocated only if Path Option is supported
648 Opts.Table (Opts.Last) :=
649 new String'("-L" & Name_Buffer (1 .. Name_Len));
651 - if Path_Option /= null then
652 + if not Rpath_Disabled and then Path_Option /= null then
653 Add_Rpath (Name_Buffer (1 .. Name_Len));
656 @@ -1299,9 +1304,13 @@
657 Get_Name_String (Element.Value);
659 if Name_Len /= 0 then
660 - Opts.Increment_Last;
661 - Opts.Table (Opts.Last) :=
662 - new String'(Name_Buffer (1 .. Name_Len));
663 + if Name_Buffer (1 .. Name_Len) = "-R" then
664 + Rpath_Disabled := True;
666 + Opts.Increment_Last;
667 + Opts.Table (Opts.Last) :=
668 + new String'(Name_Buffer (1 .. Name_Len));
672 Current := Element.Next;
673 --- gcc/ada/mlib-utl.adb.orig
674 +++ gcc/ada/mlib-utl.adb
676 if Driver_Name = No_Name then
677 if Gcc_Exec = null then
678 if Gcc_Name = null then
679 - Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
680 + Gcc_Name := Osint.Program_Name ("ada", "gnatmake");
683 Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
684 --- gcc/ada/prj-makr.adb.orig
685 +++ gcc/ada/prj-makr.adb
688 procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
690 - Gcc : constant String := "gcc";
691 + Gcc : constant String := "ada";
692 Gcc_Path : String_Access := null;
694 Non_Empty_Node : constant Project_Node_Id := 1;
696 +++ gcc/ada/s-trasym-bsd.adb
698 +------------------------------------------------------------------------------
700 +-- GNAT RUN-TIME COMPONENTS --
702 +-- S Y S T E M . T R A C E B A C K . S Y M B O L I C --
706 +-- Copyright (C) 1999-2009, AdaCore --
708 +-- GNAT is free software; you can redistribute it and/or modify it under --
709 +-- terms of the GNU General Public License as published by the Free Soft- --
710 +-- ware Foundation; either version 2, or (at your option) any later ver- --
711 +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
712 +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
713 +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
714 +-- for more details. You should have received a copy of the GNU General --
715 +-- Public License distributed with GNAT; see file COPYING. If not, write --
716 +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
717 +-- Boston, MA 02110-1301, USA. --
719 +-- As a special exception, if other files instantiate generics from this --
720 +-- unit, or you link this unit with other files to produce an executable, --
721 +-- this unit does not by itself cause the resulting executable to be --
722 +-- covered by the GNU General Public License. This exception does not --
723 +-- however invalidate any other reasons why the executable file might be --
724 +-- covered by the GNU Public License. --
726 +-- GNAT was originally developed by the GNAT team at New York University. --
727 +-- Extensive contributions were provided by Ada Core Technologies Inc. --
729 +------------------------------------------------------------------------------
731 +-- Run-time symbolic traceback support
732 +-- This file is based on the work by Juergen Pfiefer which is still used
733 +-- today to provide symbolic traceback support for gnu/kFreeBSD.
734 +-- Incorporated in GNAT-AUX by John Marino <http://www.dragonlace.net>
736 +with System.Soft_Links;
737 +with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
739 +package body System.Traceback.Symbolic is
741 + package TSL renames System.Soft_Links;
743 + -- To perform the raw addresses to symbolic form translation we rely on a
744 + -- libaddr2line symbolizer which examines debug info from a provided
745 + -- executable file name, and an absolute path is needed to ensure the file
746 + -- is always found. This is "__gnat_locate_exec_on_path (gnat_argv [0])"
747 + -- for our executable file, a fairly heavy operation so we cache the
750 + Exename : System.Address;
751 + -- Pointer to the name of the executable file to be used on all
752 + -- invocations of the libaddr2line symbolization service.
754 + Exename_Resolved : Boolean := False;
755 + -- Flag to indicate whether we have performed the executable file name
756 + -- resolution already. Relying on a not null Exename for this purpose
757 + -- would be potentially inefficient as this is what we will get if the
758 + -- resolution attempt fails.
760 + ------------------------
761 + -- Symbolic_Traceback --
762 + ------------------------
764 + function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is
766 + procedure convert_addresses
767 + (filename : System.Address;
768 + addrs : System.Address;
770 + buf : System.Address;
771 + len : System.Address);
772 + pragma Import (C, convert_addresses, "convert_addresses");
773 + -- This is the procedure version of the Ada-aware addr2line. It places
774 + -- in BUF a string representing the symbolic translation of the N_ADDRS
775 + -- raw addresses provided in ADDRS, looked up in debug information from
776 + -- FILENAME. LEN points to an integer which contains the size of the
777 + -- BUF buffer at input and the result length at output.
779 + -- Note that this procedure is *not* thread-safe.
781 + type Argv_Array is array (0 .. 0) of System.Address;
782 + gnat_argv : access Argv_Array;
783 + pragma Import (C, gnat_argv, "gnat_argv");
785 + function locate_exec_on_path
786 + (c_exename : System.Address) return System.Address;
787 + pragma Import (C, locate_exec_on_path, "__gnat_locate_exec_on_path");
789 + B_Size : constant Integer := 256 * Traceback'Length;
790 + Len : Integer := B_Size;
791 + Res : String (1 .. B_Size);
793 + use type System.Address;
796 + -- The symbolic translation of an empty set of addresses is an empty
799 + if Traceback'Length = 0 then
803 + -- If our input set of raw addresses is not empty, resort to the
804 + -- libaddr2line service to symbolize it all.
806 + -- Compute, cache and provide the absolute path to our executable file
807 + -- name as the binary file where the relevant debug information is to be
808 + -- found. If the executable file name resolution fails, we have no
809 + -- sensible basis to invoke the symbolizer at all.
811 + -- Protect all this against concurrent accesses explicitly, as the
812 + -- underlying services are potentially thread unsafe.
816 + if not Exename_Resolved then
817 + Exename := locate_exec_on_path (gnat_argv (0));
818 + Exename_Resolved := True;
821 + if Exename /= System.Null_Address then
824 + (Exename, Traceback'Address, Traceback'Length,
825 + Res (1)'Address, Len'Address);
828 + TSL.Unlock_Task.all;
830 + -- Return what the addr2line symbolizer has produced if we have called
831 + -- it (the executable name resolution succeeded), or an empty string
834 + if Exename /= System.Null_Address then
835 + return Res (1 .. Len);
840 + end Symbolic_Traceback;
842 + function Symbolic_Traceback
843 + (E : Ada.Exceptions.Exception_Occurrence) return String is
845 + return Symbolic_Traceback (Tracebacks (E));
846 + end Symbolic_Traceback;
848 +end System.Traceback.Symbolic;
849 --- gcc/ada/terminals.c.orig
850 +++ gcc/ada/terminals.c
852 /* First all usupported platforms. Add stubs for exported routines. */
854 #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \
855 - || defined (__ANDROID__) || defined (__PikeOS__) || defined(__DJGPP__)
856 + || defined (__PikeOS__) || defined(__DJGPP__)
858 #define ATTRIBUTE_UNUSED __attribute__((unused))
860 @@ -1052,7 +1052,7 @@
861 || defined (__OpenBSD__) \
862 || defined (__NetBSD__) \
863 || defined (__DragonFly__)
868 /* Include every system header we need */
869 @@ -1063,8 +1063,8 @@
871 /* On some system termio is either absent or including it will disable termios
873 -#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
874 - && !defined (__rtems__)
875 +#if ! defined (__hpux__) && ! defined (FREEBSD) && \
876 + ! defined (__APPLE__) && ! defined(__rtems__)
880 @@ -1076,10 +1076,10 @@
881 #include <sys/types.h>
882 #include <sys/wait.h>
884 -#if defined (__sun__)
886 # include <sys/stropts.h>
888 -#if defined (BSD) || defined (__sun__)
889 +#if defined (FREEBSD) || defined (sun)
890 # include <sys/signal.h>
892 #if defined (__hpux__)
893 @@ -1087,11 +1087,15 @@
894 # include <sys/stropts.h>
898 +#define CDISABLE _PC_VDISABLE
900 #define CDISABLE _POSIX_VDISABLE
903 /* On HP-UX and Sun system, there is a bzero function but with a different
904 signature. Use memset instead */
905 -#if defined (__hpux__) || defined (__sun__) || defined (_AIX)
906 +#if defined (__hpux__) || defined (sun) || defined (_AIX)
907 # define bzero(s,n) memset (s,0,n)
910 @@ -1109,11 +1113,11 @@
913 /* Configurable part */
914 -#if defined (__APPLE__) || defined (BSD)
915 +#if defined (__APPLE__) || defined (FREEBSD)
917 -#elif defined (__linux__)
918 +#elif defined (linux)
920 -#elif defined (__sun__)
922 #define USE_CLONE_DEVICE "/dev/ptmx"
924 #define USE_CLONE_DEVICE "/dev/ptc"
925 @@ -1399,7 +1403,7 @@
926 desc->slave_fd = open (desc->slave_name, O_RDWR, 0);
929 -#if defined (__sun__) || defined (__hpux__)
930 +#if defined (sun) || defined (__hpux__)
931 /* On systems such as Solaris we are using stream. We need to push the right
932 "modules" in order to get the expected terminal behaviors. Otherwise
933 functionalities such as termios are not available. */
935 +++ gcc/ada/traceback_symbolic.c
938 + Copyright (C) 1999 by Juergen Pfeifer <juergen.pfeifer@gmx.net>
939 + Ada for Linux Team (ALT)
940 + Heavily modified by John Marino <http://www.dragonlace.net>
942 + Permission is hereby granted, free of charge, to any person obtaining a
943 + copy of this software and associated documentation files (the
944 + "Software"), to deal in the Software without restriction, including
945 + without limitation the rights to use, copy, modify, merge, publish,
946 + distribute, distribute with modifications, sublicense, and/or sell
947 + copies of the Software, and to permit persons to whom the Software is
948 + furnished to do so, subject to the following conditions:
950 + The above copyright notice and this permission notice shall be included
951 + in all copies or substantial portions of the Software.
953 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
954 + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
955 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
956 + IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
957 + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
958 + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
959 + THE USE OR OTHER DEALINGS IN THE SOFTWARE.
961 + Except as contained in this notice, the name(s) of the above copyright
962 + holders shall not be used in advertising or otherwise to promote the
963 + sale, use or other dealings in this Software without prior written
971 + * Running addr2line doesn't make sense for cross-compiled objects.
972 + * Create a dummy function to satisfy g-trasym.o
976 +convert_addresses (const char *file_name ATTRIBUTE_UNUSED,
977 + void *addrs ATTRIBUTE_UNUSED,
978 + int n_addr ATTRIBUTE_UNUSED,
979 + void *buf ATTRIBUTE_UNUSED,
980 + int *len ATTRIBUTE_UNUSED)
989 + * use the external program /usr/bin/addr2line to convert addresses
990 + * into file names and line numbers
993 +#include <sys/types.h>
999 +#define CLOSE_SENDPIPE close(sendpipe[0]); close(sendpipe[1])
1000 +#define CLOSE_READPIPE close(readpipe[0]); close(readpipe[1])
1001 +#define DUP2CLOSE(oldfd, newfd) dup2(oldfd, newfd); close(oldfd);
1002 +#define RESTSIG sigaction(SIGPIPE,&oact,NULL)
1004 +#define MAX_LINE 1024
1005 +#define PARENT_READ readpipe[0]
1006 +#define CHILD_WRITE readpipe[1]
1007 +#define CHILD_READ sendpipe[0]
1008 +#define PARENT_WRITE sendpipe[1]
1010 +#if defined (__sun__)
1011 +#define ADDR2LINE_PROG "/usr/gnu/bin/addr2line"
1013 +#define ADDR2LINE_PROG "/usr/bin/addr2line"
1017 +convert_addresses (const char *file_name,
1023 + int max_len = *len;
1026 + struct sigaction act, oact;
1028 + int sendpipe[2] = {-1,-1}, /* parent -> child */
1029 + readpipe[2] = {-1,-1}; /* parent <- child */
1032 + act.sa_handler = SIG_IGN;
1033 + sigemptyset(&act.sa_mask);
1035 + if (sigaction(SIGPIPE,&act,&oact) < 0)
1038 + if (pipe(sendpipe) < 0) { RESTSIG; return; }
1039 + if (pipe(readpipe) < 0) { CLOSE_SENDPIPE; RESTSIG; return; }
1040 + if ((childpid = fork()) < 0) {
1047 + if (childpid == 0) { /* child process */
1048 + close(PARENT_WRITE);
1049 + close(PARENT_READ);
1050 + if ((CHILD_READ != STDIN_FILENO) && (CHILD_WRITE != STDOUT_FILENO)) {
1051 + if ((CHILD_READ == STDOUT_FILENO) && (CHILD_WRITE == STDIN_FILENO)) {
1052 + const int temp_fd = dup(CHILD_WRITE);
1053 + close (CHILD_WRITE);
1054 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
1055 + DUP2CLOSE (temp_fd, STDOUT_FILENO);
1057 + else if ((CHILD_READ == STDIN_FILENO) && (CHILD_WRITE > 1)) {
1058 + DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
1060 + else if ((CHILD_READ > 1) && (CHILD_WRITE == STDOUT_FILENO)) {
1061 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
1063 + else if ((CHILD_READ > 1) && (CHILD_WRITE == STDIN_FILENO)) {
1064 + DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
1065 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
1068 + /* CHILD_READ >= 1 and CHILD_WRITE > 1 */
1069 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
1070 + DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
1073 + /* As pointed out by Florian Weimer to JP, it is a security threat to call
1074 + the script with a user defined environment and using the path. That
1075 + would be Trojans pleasure. Therefore the absolute path to addr2line
1076 + and an empty environment is used. That should be safe.
1078 + char *const argv[] = { "addr2line",
1080 + "--demangle=gnat",
1084 + char *const envp[] = { NULL };
1085 + if (execve(ADDR2LINE_PROG, argv, envp) < 0) {
1086 + close (CHILD_WRITE);
1087 + close (CHILD_READ);
1093 + /* Below this line is parent process */
1096 + char line[MAX_LINE + 1];
1099 + long *trace_address = addrs;
1101 + close(CHILD_WRITE);
1102 + close(CHILD_READ);
1104 + for(i=0; i < n_addr; i++) {
1105 + snprintf(hex,sizeof(hex),"%#lx\n",*trace_address);
1106 + write(PARENT_WRITE,hex,strlen(hex));
1107 + n = read(PARENT_READ,line,MAX_LINE);
1112 + /* We have approx. 16 additional chars for "%#lx in " clause.
1113 + We use this info to prevent a buffer overrun. */
1114 + if (n + 16 + (*len) > max_len)
1117 + p = strchr(line,'\n');
1121 + *len += snprintf(s, (max_len - (*len)), "%#lx in %s at %s",
1122 + *trace_address, line, p+1);
1125 + *len += snprintf(s, (max_len - (*len)), "%#lx at %s",
1126 + *trace_address, line);
1130 + trace_address += 1;
1132 + close (PARENT_WRITE);
1133 + close (PARENT_READ);
1138 --- gcc/ada/gcc-interface/Makefile.in.orig
1139 +++ gcc/ada/gcc-interface/Makefile.in
1140 @@ -1227,6 +1227,7 @@
1141 ifeq ($(strip $(filter-out arm% linux-androideabi,$(target_cpu) $(target_os))),)
1142 LIBGNAT_TARGET_PAIRS = \
1143 a-intnam.ads<a-intnam-linux.ads \
1144 + g-socthi.adb<g-socthi-bsd.adb \
1145 s-inmaop.adb<s-inmaop-posix.adb \
1146 s-intman.adb<s-intman-android.adb \
1147 s-linux.ads<s-linux-android.ads \
1148 @@ -1311,6 +1312,7 @@
1149 a-intnam.ads<a-intnam-solaris.ads \
1150 s-inmaop.adb<s-inmaop-posix.adb \
1151 s-intman.adb<s-intman-solaris.adb \
1152 + s-trasym.adb<s-trasym-bsd.adb \
1153 s-mudido.adb<s-mudido-affinity.adb \
1154 s-osinte.adb<s-osinte-solaris.adb \
1155 s-osinte.ads<s-osinte-solaris.ads \
1156 @@ -1347,6 +1349,8 @@
1157 EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
1160 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
1161 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
1162 THREADSLIB = -lposix4 -lthread
1163 MISCLIB = -lposix4 -lnsl -lsocket
1165 @@ -1495,10 +1499,45 @@
1166 LIBRARY_VERSION := $(LIB_VERSION)
1170 +ifeq ($(strip $(filter-out %86 linux-android,$(target_cpu) $(target_os))),)
1171 + LIBGNAT_TARGET_PAIRS = \
1172 + a-intnam.ads<a-intnam-linux.ads \
1173 + g-socthi.adb<g-socthi-bsd.adb \
1174 + s-inmaop.adb<s-inmaop-posix.adb \
1175 + s-intman.adb<s-intman-posix.adb \
1176 + s-linux.ads<s-linux-android.ads \
1177 + s-osinte.adb<s-osinte-android.adb \
1178 + s-osinte.ads<s-osinte-android.ads \
1179 + s-osprim.adb<s-osprim-posix.adb \
1180 + s-taprop.adb<s-taprop-posix.adb \
1181 + s-taspri.ads<s-taspri-posix.ads \
1182 + s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1183 + $(ATOMICS_TARGET_PAIRS) \
1184 + $(X86_TARGET_PAIRS) \
1185 + system.ads<system-linux-x86.ads
1187 + TOOLS_TARGET_PAIRS = \
1188 + mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1189 + indepsw.adb<indepsw-gnu.adb
1191 + EXTRA_LIBGNAT_OBJS=
1192 + EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1193 + EXTRA_GNATRTL_NONTASKING_OBJS=
1198 + GNATLIB_SHARED = gnatlib-shared-dual
1199 + LIBRARY_VERSION := $(LIB_VERSION)
1203 ifeq ($(strip $(filter-out %aarch64 freebsd%,$(target_cpu) $(target_os))),)
1204 LIBGNAT_TARGET_PAIRS = \
1205 a-intnam.ads<a-intnam-freebsd.ads \
1206 + g-socthi.adb<g-socthi-bsd.adb \
1207 + s-trasym.adb<s-trasym-bsd.adb \
1208 s-inmaop.adb<s-inmaop-posix.adb \
1209 s-intman.adb<s-intman-posix.adb \
1210 s-mudido.adb<s-mudido-affinity.adb \
1211 @@ -1516,6 +1555,9 @@
1212 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1213 GNATLIB_SHARED = gnatlib-shared-dual
1215 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
1216 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
1219 THREADSLIB= -lpthread
1221 @@ -1527,6 +1569,8 @@
1222 ifeq ($(strip $(filter-out %86 freebsd%,$(target_cpu) $(target_os))),)
1223 LIBGNAT_TARGET_PAIRS = \
1224 a-intnam.ads<a-intnam-freebsd.ads \
1225 + g-socthi.adb<g-socthi-bsd.adb \
1226 + s-trasym.adb<s-trasym-bsd.adb \
1227 s-inmaop.adb<s-inmaop-posix.adb \
1228 s-intman.adb<s-intman-posix.adb \
1229 s-mudido.adb<s-mudido-affinity.adb \
1230 @@ -1544,6 +1588,8 @@
1231 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1232 GNATLIB_SHARED = gnatlib-shared-dual
1234 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
1235 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
1236 EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
1239 @@ -1557,6 +1603,8 @@
1240 ifeq ($(strip $(filter-out %86_64 freebsd%,$(target_cpu) $(target_os))),)
1241 LIBGNAT_TARGET_PAIRS = \
1242 a-intnam.ads<a-intnam-freebsd.ads \
1243 + g-socthi.adb<g-socthi-bsd.adb \
1244 + s-trasym.adb<s-trasym-bsd.adb \
1245 s-inmaop.adb<s-inmaop-posix.adb \
1246 s-intman.adb<s-intman-posix.adb \
1247 s-mudido.adb<s-mudido-affinity.adb \
1248 @@ -1574,6 +1622,8 @@
1249 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1250 GNATLIB_SHARED = gnatlib-shared-dual
1252 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
1253 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
1254 EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
1257 @@ -1587,6 +1637,8 @@
1258 ifeq ($(strip $(filter-out %86_64 dragonfly%,$(target_cpu) $(target_os))),)
1259 LIBGNAT_TARGET_PAIRS = \
1260 a-intnam.ads<a-intnam-dragonfly.ads \
1261 + g-socthi.adb<g-socthi-bsd.adb \
1262 + s-trasym.adb<s-trasym-bsd.adb \
1263 s-inmaop.adb<s-inmaop-posix.adb \
1264 s-intman.adb<s-intman-posix.adb \
1265 s-mudido.adb<s-mudido-affinity.adb \
1266 @@ -1604,6 +1656,8 @@
1267 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1268 GNATLIB_SHARED = gnatlib-shared-dual
1270 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
1271 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
1272 EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1275 --- gcc/ada/gcc-interface/Make-lang.in.orig
1276 +++ gcc/ada/gcc-interface/Make-lang.in
1280 # Language-independent object files.
1281 -ADA_BACKEND = $(BACKEND) attribs.o
1282 +ADA_BACKEND = $(BACKEND2) attribs.o
1284 # List of target dependent sources, overridden below as necessary
1286 --- gcc/ada/init.c.orig
1288 @@ -2541,8 +2541,15 @@
1290 mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
1292 +#if defined (__i386__)
1293 + unsigned long *pc = (unsigned long *)mcontext->gregs[REG_EIP];
1294 + /* The pattern is "orl $0x0,(%esp)" for a probe in 32-bit mode. */
1295 + if (signo == SIGSEGV && pc && *pc == 0x00240c83)
1296 + mcontext->gregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long);
1297 +#elif defined (__ARMEL__)
1298 /* ARM Bump has to be an even number because of odd/even architecture. */
1299 - ((mcontext_t *) mcontext)->arm_pc += 2;
1300 + mcontext->arm_pc += 2;
1307 [FILE:19397:patches/patch-diff-ada-testsuite]
1308 --- gcc/testsuite/ada/acats/run_acats.sh.orig
1309 +++ gcc/testsuite/ada/acats/run_acats.sh
1314 -# Provide which replacement.
1316 -# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
1317 -# ksh93 and bash have it.
1318 -# type output format differs between ksh88 and ksh93, so avoid it if
1319 -# type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type.
1320 -# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
1323 - path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
1324 - path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
1325 - path=`whence $* 2>/dev/null` && { echo $path; return 0; }
1329 # Set up environment to use the Ada compiler from the object tree
1331 --- gcc/testsuite/ada/acats/run_all.sh.orig
1332 +++ gcc/testsuite/ada/acats/run_all.sh
1335 # End of customization section.
1337 -# Perform arithmetic evaluation on the ARGs, and store the result in the
1338 -# global $as_val. Take advantage of shells that can avoid forks. The arguments
1339 -# must be portable across $(()) and expr.
1340 -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
1341 - eval 'as_fn_arith ()
1348 - as_val=`expr "$@" || test $? -eq 1`
1354 printf "$@" >> $dir/acats.sum
1356 echo "$@" >> $dir/acats.log
1360 + printf "%04d %7s" $1 $2
1369 if [ "$dir" = "$testdir" ]; then
1371 gnatls -v >> $dir/acats.log
1374 -if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
1375 - dir_support=$dir/../acats/support
1378 - mv $dir/tests $dir/tests.$$ 2> /dev/null
1379 - rm -rf $dir/tests.$$ &
1382 - cp -pr $dir/../acats/tests $dir/
1384 - dir_support=$dir/support
1386 display " === acats support ==="
1387 display_noeol "Generating support files..."
1396 display " === acats tests ==="
1398 if [ $# -eq 0 ]; then
1399 @@ -228,14 +206,20 @@
1408 for chapter in $chapters; do
1409 - # Used to generate support once and finish after that.
1410 - [ "$chapter" = "NONE" ] && continue
1411 + if [ -d $dir/tests/$chapter ]; then
1412 + cd $dir/tests/$chapter
1413 + ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
1414 + cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
1415 + > $dir/tests/$chapter/${chapter}.lst
1416 + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1417 + countdown=`expr $countdown + $countn`
1421 +for chapter in $chapters; do
1422 display Running chapter $chapter ...
1424 if [ ! -d $dir/tests/$chapter ]; then
1425 @@ -244,45 +228,11 @@
1429 - cd $dir/tests/$chapter
1430 - ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
1431 - cut -c1-7 | sort | uniq | comm -23 - $dir_support/norun.lst \
1432 - > $dir/tests/$chapter/${chapter}.lst
1433 countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1434 - as_fn_arith $glob_countn + $countn
1435 - glob_countn=$as_val
1436 + glob_countn=`expr $glob_countn + $countn`
1438 for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
1440 - # If running multiple run_all.sh jobs in parallel, decide
1441 - # if we should run this test in the current instance.
1442 - if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
1444 - # Ugh, some tests have inter-test dependencies, those
1445 - # tests have to be scheduled on the same parallel instance
1446 - # as previous test.
1447 - ce2108f | ce2108h | ce3112d) ;;
1448 - # All others can be hopefully scheduled freely.
1450 - as_fn_arith $par_countm + 1
1451 - par_countm=$as_val
1452 - [ $par_countm -eq 10 ] && par_countm=0
1453 - if [ $par_countm -eq 1 ]; then
1454 - as_fn_arith $par_count + 1
1456 - if mkdir $GCC_RUNTEST_PARALLELIZE_DIR/$par_count 2>/dev/null; then
1463 - if [ -z "$par_last" ]; then
1464 - as_fn_arith $glob_countn - 1
1465 - glob_countn=$as_val
1470 + counti=`expr $counti + 1`
1471 extraflags="-gnat95"
1472 grep $i $testdir/overflow.lst > /dev/null 2>&1
1473 if [ $? -eq 0 ]; then
1474 @@ -300,10 +250,13 @@
1475 if [ $? -eq 0 ]; then
1476 extraflags="$extraflags -fstack-check"
1478 + inform $countdown $i
1479 + countdown=`expr $countdown - 1`
1480 test=$dir/tests/$chapter/$i
1481 mkdir $test && cd $test >> $dir/acats.log 2>&1
1483 if [ $? -ne 0 ]; then
1486 failed="${failed}${i} "
1488 @@ -321,19 +274,22 @@
1489 echo "BUILD $main" >> $dir/acats.log
1492 - cxb30*) EXTERNAL_OBJECTS="$dir_support/cxb30040.o $dir_support/cxb30060.o $dir_support/cxb30130.o $dir_support/cxb30131.o";;
1493 + cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
1494 ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
1495 ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
1496 + cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
1498 if [ "$main" = "" ]; then
1501 failed="${failed}${i} "
1506 - target_gnatmake $extraflags -I$dir_support $main >> $dir/acats.log 2>&1
1507 + target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
1508 if [ $? -ne 0 ]; then
1511 failed="${failed}${i} "
1514 target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
1515 cd $dir/tests/$chapter/$i
1516 cat ${i}.log >> $dir/acats.log
1518 egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
1519 if [ $? -ne 0 ]; then
1520 grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
1521 @@ -357,15 +314,12 @@
1522 failed="${failed}${i} "
1524 log "UNSUPPORTED: $i"
1525 - as_fn_arith $glob_countn - 1
1526 - glob_countn=$as_val
1527 - as_fn_arith $glob_countu + 1
1528 - glob_countu=$as_val
1529 + glob_countn=`expr $glob_countn - 1`
1530 + glob_countu=`expr $glob_countu + 1`
1534 - as_fn_arith $glob_countok + 1
1535 - glob_countok=$as_val
1536 + glob_countok=`expr $glob_countok + 1`
1541 +++ gcc/testsuite/ada/acats/run_remote.sh
1544 +# Run ACATS with the GNU Ada compiler
1546 +# The following functions are to be customized if you run in cross
1547 +# environment or want to change compilation flags. Note that for
1548 +# tests requiring checks not turned on by default, this script
1549 +# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
1551 +# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
1552 +# gnatflags="-gnatN"
1555 +gnatflags="-gnatws"
1556 +tabtarget="/data/local/testsuite"
1557 +STRIP="@REMOTE_TARGET@-strip"
1560 + # Run on rooted tablet (port 22 vs port 2222)
1562 + $STRIP_FOR_TARGET $*
1563 + /usr/bin/scp -qp $* root@tablet:$tabtarget/
1564 + /usr/bin/ssh -q tablet $tabtarget/$BN
1568 + /usr/bin/ssh -q tablet "$1"
1571 +# End of customization section.
1575 + printf "$@" >> $dir/acats.sum
1576 + printf "$@" >> $dir/acats.log
1581 + echo "$@" >> $dir/acats.sum
1582 + echo "$@" >> $dir/acats.log
1586 + echo "$@" >> $dir/acats.sum
1587 + echo "$@" >> $dir/acats.log
1591 + printf "%04d %7s" $1 $2
1598 +dir=`${PWDCMD-pwd}`
1600 +if [ "$testdir" = "" ]; then
1601 + echo You must use make check or make check-ada
1605 +if [ "$dir" = "$testdir" ]; then
1606 + echo "error: srcdir must be different than objdir, exiting."
1610 +target_gnatmake () {
1611 + echo gnatmake-cross --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\" -fPIE -pie
1612 + gnatmake-cross --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC" -fPIE -pie
1620 + rm -f "$binmain" *.o *.ali > /dev/null 2>&1
1624 + ls ${i}?.adb > ${i}.lst 2> /dev/null
1625 + ls ${i}*m.adb >> ${i}.lst 2> /dev/null
1626 + ls ${i}.adb >> ${i}.lst 2> /dev/null
1627 + main=`tail -1 ${i}.lst`
1631 + local mysplit=`echo $1 | awk -F/ '{print "section=" $1 "; TN=" $2 "; prog=" $3 ";"}'`
1635 +EXTERNAL_OBJECTS=""
1636 +# Global variable to communicate external objects to link with.
1638 +rm -f $dir/acats.sum $dir/acats.log $dir/transfer.lst
1640 +display "Test Run By $USER on `date`"
1642 +display " === acats configuration ==="
1644 +target=`$GCC -dumpmachine`
1646 +display target gcc is $GCC
1647 +display `$GCC -v 2>&1`
1648 +display host=`gcc -dumpmachine`
1649 +display target=$target
1650 +display `type gnatmake-cross`
1651 +gnatls-cross -v >> $dir/acats.log
1654 +# Let's be tidy and clear off the remote device first
1655 +target_cmd "cd ${tabtarget}; rm logs/*; rmdir logs; rm *"
1657 +display " === acats support ==="
1658 +display_noeol "Generating support files..."
1660 +rm -rf $dir/support
1661 +mkdir -p $dir/support
1664 +cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
1666 +# Find out the size in bit of an address on the target
1667 +target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
1668 +target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
1669 +target_bit=`cat $dir/support/impbit.out`
1670 +echo target_bit="$target_bit" >> $dir/acats.log
1672 +# Find out a suitable asm statement
1673 +# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
1675 + ia64*-*-* | s390*-*-*)
1676 + target_insn="nop 0"
1679 + target_insn="swym 0"
1685 +echo target_insn="$target_insn" >> $dir/acats.log
1687 +sed -e "s,ACATS4GNATDIR,$dir,g" \
1688 + < $testdir/support/impdef.a > $dir/support/impdef.a
1689 +sed -e "s,ACATS4GNATDIR,$dir,g" \
1690 + -e "s,ACATS4GNATBIT,$target_bit,g" \
1691 + -e "s,ACATS4GNATINSN,$target_insn,g" \
1692 + < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
1693 +sed -e "s,ACATS4GNATDIR,$dir,g" \
1694 + < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
1696 +cp $testdir/tests/cd/*.c $dir/support
1697 +cp $testdir/tests/cxb/*.c $dir/support
1698 +grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
1701 +mv $dir/tests $dir/tests.$$ 2> /dev/null
1702 +rm -rf $dir/tests.$$ &
1705 +cp -pr $testdir/tests $dir/
1707 +for i in $dir/support/*.ada $dir/support/*.a; do
1708 + host_gnatchop $i >> $dir/acats.log 2>&1
1711 +# These tools are used to preprocess some ACATS sources
1712 +# they need to be compiled native on the host.
1714 +host_gnatmake -q -gnatws macrosub.adb
1715 +if [ $? -ne 0 ]; then
1716 + display "**** Failed to compile macrosub"
1719 +./macrosub > macrosub.out 2>&1
1722 +host_gnatmake -q -gnatws widechr.adb
1723 +if [ $? -ne 0 ]; then
1724 + display "**** Failed to compile widechr"
1727 +./widechr > widechr.out 2>&1
1729 +rm -f $dir/support/macrosub
1730 +rm -f $dir/support/widechr
1731 +rm -f $dir/support/*.ali
1732 +rm -f $dir/support/*.o
1736 +# From here, all compilations will be made by the target compiler
1738 +display_noeol "Compiling support files..."
1741 +if [ $? -ne 0 ]; then
1742 + display "**** Failed to compile C code"
1746 +host_gnatchop *.adt >> $dir/acats.log 2>&1
1748 +target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
1749 +target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
1753 +display " === acats tests ==="
1755 +if [ $# -eq 0 ]; then
1756 + chapters=`cd $dir/tests; echo [a-z]*`
1766 +for chapter in $chapters; do
1767 + if [ -d $dir/tests/$chapter ]; then
1768 + cd $dir/tests/$chapter
1769 + ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
1770 + cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
1771 + > $dir/tests/$chapter/${chapter}.lst
1772 + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1773 + countdown=`expr $countdown + $countn`
1777 +cat > $dir/execute.sh << EOF
1779 + printf "left: %04d" \$1
1786 + local total=\$(echo \$testlist | awk '{print NF}')
1788 + echo "Executing \$total tests on remote device"
1790 + for x in \$testlist; do
1791 + timeout -t 30 ./\${x} > logs/\${x}.log 2>&1
1792 + countx=\$(expr \$countx + 1)
1793 + if [ \$countx -eq 25 ]; then
1794 + total=\$(expr \$total - 25)
1801 + tar -czf remote.logs.tar.gz logs
1806 +display "All tests are being cross-compiled without execution first."
1808 +for chapter in $chapters; do
1809 + if [ ! -d $dir/tests/$chapter ]; then
1813 + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
1814 + glob_countn=`expr $glob_countn + $countn`
1816 + for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
1817 + counti=`expr $counti + 1`
1818 + extraflags="-gnat95"
1819 + grep $i $testdir/overflow.lst > /dev/null 2>&1
1820 + if [ $? -eq 0 ]; then
1821 + extraflags="$extraflags -gnato"
1823 + grep $i $testdir/elabd.lst > /dev/null 2>&1
1824 + if [ $? -eq 0 ]; then
1825 + extraflags="$extraflags -gnatE"
1827 + grep $i $testdir/floatstore.lst > /dev/null 2>&1
1828 + if [ $? -eq 0 ]; then
1829 + extraflags="$extraflags -ffloat-store"
1831 + grep $i $testdir/stackcheck.lst > /dev/null 2>&1
1832 + if [ $? -eq 0 ]; then
1833 + extraflags="$extraflags -fstack-check"
1835 + inform $countdown $i
1836 + countdown=`expr $countdown - 1`
1837 + test=$dir/tests/$chapter/$i
1838 + mkdir $test && cd $test >> $dir/acats.log 2>&1
1840 + if [ $? -ne 0 ]; then
1842 + display "FAIL: $i"
1843 + failed="${failed}${i} "
1848 + host_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
1850 + if [ -z "$main" ]; then
1854 + binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
1855 + echo "BUILD $main" >> $dir/acats.log
1856 + EXTERNAL_OBJECTS=""
1858 + cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
1859 + ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
1860 + ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
1861 + cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
1863 + if [ "$main" = "" ]; then
1865 + display "FAIL: $i"
1866 + failed="${failed}${i} "
1871 + target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
1872 + if [ $? -ne 0 ]; then
1874 + display "FAIL: $i"
1875 + failed="${failed}${i} "
1879 + echo $chapter/$i/$binmain >> $dir/transfer.lst
1880 + echo "$binmain \\" >> $dir/execute.sh
1885 +echo '"' >> $dir/execute.sh
1886 +echo "cycle" >> $dir/execute.sh
1889 +display "Transfer files to remote device: root@tablet:$tabtarget/"
1891 +cat $dir/transfer.lst | xargs tar --strip-components=2 -czf - | \
1892 + target_cmd "tar -C $tabtarget -xzf -"
1894 +tar -czf - execute.sh | target_cmd "tar -C $tabtarget -xzf -"
1895 +target_cmd "cd $tabtarget; sh execute.sh"
1896 +rm -rf $dir/logs $dir/remote.logs.tar.gz
1897 +/usr/bin/scp -q root@tablet:$tabtarget/remote.logs.tar.gz $dir/
1898 +tar -xzf $dir/remote.logs.tar.gz
1900 +countdown=`wc -l < $dir/transfer.lst`
1901 +glob_countn=${countdown}
1902 +for i in `cat $dir/transfer.lst`; do
1904 + if [ "$section" != "$savedsect" ]; then
1905 + display Running chapter $section ...
1907 + savedsect=$section
1909 + #inform $countdown $TN
1910 + countdown=`expr $countdown - 1`
1911 + proglog="$dir/logs/${prog}.log"
1912 + echo "RUN $prog" >> $dir/acats.log
1913 + if [ ! -f $proglog ]; then
1914 + echo "LOG NOT FOUND!" >> $proglog
1917 + cat $proglog >> $dir/acats.log
1919 + egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' $proglog > /dev/null 2>&1
1920 + if [ $? -ne 0 ]; then
1921 + grep 'tasking not implemented' $proglog > /dev/null 2>&1
1923 + if [ $? -ne 0 ]; then
1924 + display "FAIL: ${TN}"
1925 + failed="${failed}${TN} "
1927 + log "UNSUPPORTED: ${TN}"
1928 + glob_countn=`expr $glob_countn - 1`
1929 + glob_countu=`expr $glob_countu + 1`
1933 + glob_countok=`expr $glob_countok + 1`
1935 + cd $dir/tests/$section/$TN
1940 +display " === acats Summary ==="
1941 +display "# of expected passes $glob_countok"
1942 +display "# of unexpected failures `expr $glob_countn - $glob_countok`"
1944 +if [ $glob_countu -ne 0 ]; then
1945 + display "# of unsupported tests $glob_countu"
1948 +if [ $glob_countok -ne $glob_countn ]; then
1949 + display "*** FAILURES: $failed"
1952 +display "$0 completed at `date`"
1955 --- gcc/testsuite/gnat.dg/test_raise_from_pure.adb.orig
1956 +++ gcc/testsuite/gnat.dg/test_raise_from_pure.adb
1959 +-- { dg-do run { xfail *-*-openbsd* } }
1960 -- { dg-options "-O2" }
1962 -- This is an optimization test and its failure is only a missed optimization.
1963 --- gcc/testsuite/gnat.dg/unchecked_convert5.adb.orig
1964 +++ gcc/testsuite/gnat.dg/unchecked_convert5.adb
1966 --- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
1968 -with Unchecked_Conversion;
1970 -procedure Unchecked_Convert5 is
1972 - subtype c_1 is string(1..1);
1974 - function int2c1 is -- { dg-warning "different sizes" }
1975 - new unchecked_conversion (source => integer, target => c_1);
1981 - c1 := int2c1(16#12#);
1983 - if c1 (1) /= ASCII.Nul then
1984 - raise Program_Error;
1988 --- gcc/testsuite/gnat.dg/unchecked_convert6.adb.orig
1989 +++ gcc/testsuite/gnat.dg/unchecked_convert6.adb
1991 --- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
1993 -with Unchecked_Conversion;
1995 -procedure Unchecked_Convert6 is
1997 - subtype c_5 is string(1..5);
1999 - function int2c5 is -- { dg-warning "different sizes" }
2000 - new unchecked_conversion (source => integer, target => c_5);
2006 - c5 := int2c5(16#12#);
2008 - if c5 (4) /= ASCII.DC2 then
2009 - raise Program_Error;
2015 [FILE:11296:patches/patch-diff-core]
2016 --- gcc/config/dragonfly.h.orig
2017 +++ gcc/config/dragonfly.h
2020 %{static:-Bstatic} \
2022 - %{!static:--hash-style=gnu} \
2023 + %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/lib} \
2024 %{symbolic:-Bsymbolic}"
2027 #define LINK_SPEC DFBSD_LINK_SPEC
2029 -#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
2030 +#define DFBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.2"
2033 /* Use --as-needed -lgcc_s for eh support. */
2034 --- gcc/config/aarch64/aarch64-freebsd.h.orig
2035 +++ gcc/config/aarch64/aarch64-freebsd.h
2037 %{symbolic:-Bsymbolic} \
2038 %{static:-Bstatic} \
2040 + %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/lib} \
2041 %{rdynamic:-export-dynamic} \
2042 %{!shared:-dynamic-linker " FBSD_DYNAMIC_LINKER " }} \
2043 -X" SUBTARGET_EXTRA_LINK_SPEC " \
2046 #define MCOUNT_NAME ".mcount"
2048 +/* Static stack checking is supported by means of probes. */
2049 +#define STACK_CHECK_STATIC_BUILTIN 1
2050 #endif /* GCC_AARCH64_FREEBSD_H */
2051 --- gcc/config/i386/freebsd.h.orig
2052 +++ gcc/config/i386/freebsd.h
2054 %{rdynamic:-export-dynamic} \
2055 -dynamic-linker %(fbsd_dynamic_linker) } \
2056 %{static:-Bstatic}} \
2057 + %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/lib} \
2058 %{symbolic:-Bsymbolic}"
2060 /* A C statement to output to the stdio stream FILE an assembler
2061 --- gcc/config/i386/freebsd64.h.orig
2062 +++ gcc/config/i386/freebsd64.h
2064 %{rdynamic:-export-dynamic} \
2065 -dynamic-linker %(fbsd_dynamic_linker) } \
2066 %{static:-Bstatic}} \
2067 + %{!static:--hash-style=gnu -rpath @PREFIX@/lib} \
2068 %{symbolic:-Bsymbolic}"
2069 --- gcc/Makefile.in.orig
2071 @@ -1200,7 +1200,6 @@
2079 @@ -1597,6 +1596,7 @@
2080 $(OBJS-libcommon-target) main.o c-family/cppspec.o \
2081 $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
2082 $(GCOV_TOOL_OBJS) $(GENGTYPE_OBJS) gcc-ar.o gcc-nm.o gcc-ranlib.o \
2083 + insn-modes.o insn-modes-ada.o \
2084 lto-wrapper.o collect-utils.o
2086 # for anything that is shared use the cc1plus profile data, as that
2087 @@ -1612,6 +1612,11 @@
2088 ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
2090 BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \
2092 + $(CPPLIB) $(LIBDECNUMBER)
2094 +BACKEND2 = libbackend.a main.o libcommon-target.a libcommon.a \
2095 + insn-modes-ada.o \
2096 $(CPPLIB) $(LIBDECNUMBER)
2098 # This is defined to "yes" if Tree checking is enabled, which roughly means
2099 @@ -2312,6 +2317,7 @@
2101 insn-modes.c: s-modes; @true
2102 insn-modes.h: s-modes-h; @true
2103 +insn-modes-ada.c: s-modes-ada; @true
2104 min-insn-modes.c: s-modes-m; @true
2106 s-modes: build/genmodes$(build_exeext)
2107 @@ -2329,6 +2335,12 @@
2108 $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
2111 +s-modes-ada: s-modes
2112 + $(shell sed -e 's/: TARGET_96_ROUND_53_LONG_DOUBLE \? &ieee_extended_intel_96_round_53_format //' \
2113 + < insn-modes.c > tmp-modes-ada.c)
2114 + $(SHELL) $(srcdir)/../move-if-change tmp-modes-ada.c insn-modes-ada.c
2115 + $(STAMP) s-modes-ada
2117 insn-preds.c: s-preds; @true
2118 tm-preds.h: s-preds-h; @true
2119 tm-constrs.h: s-constrs-h; @true
2120 @@ -3536,6 +3548,9 @@
2121 ( cd $(DESTDIR)$(bindir) && \
2122 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \
2124 + if [ -f gnat1$(exeext) ] ; then \
2125 + ( cd $(DESTDIR)$(bindir) && $(LN) $(GCC_INSTALL_NAME)$(exeext) ada$(exeext) ) \
2127 if [ ! -f gcc-cross$(exeext) ] \
2128 && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
2129 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
2130 --- gcc/config/i386/gnu-user64.h.orig
2131 +++ gcc/config/i386/gnu-user64.h
2133 %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
2134 %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
2136 + %{!static:--enable-new-dtags -rpath @PREFIX@/lib64} \
2139 %{rdynamic:-export-dynamic} \
2140 --- gcc/dwarf2out.c.orig
2142 @@ -12514,6 +12514,15 @@
2144 if (qualified_type == dtype)
2146 + tree origin = decl_ultimate_origin (name);
2148 + /* Typedef variants that have an abstract origin don't get their own
2149 + type DIE (see gen_typedef_die), so fall back on the ultimate
2150 + abstract origin instead. */
2151 + if (origin != NULL)
2152 + return modified_type_die (TREE_TYPE (origin), cv_quals, reverse,
2155 /* For a named type, use the typedef. */
2156 gen_type_die (qualified_type, context_die);
2157 return lookup_type_die (qualified_type);
2158 @@ -24346,7 +24355,7 @@
2159 gen_typedef_die (tree decl, dw_die_ref context_die)
2161 dw_die_ref type_die;
2165 if (TREE_ASM_WRITTEN (decl))
2167 @@ -24355,75 +24364,71 @@
2171 + /* As we avoid creating DIEs for local typedefs (see decl_ultimate_origin
2172 + checks in process_scope_var and modified_type_die), this should be called
2173 + only for original types. */
2174 + gcc_assert (decl_ultimate_origin (decl) == NULL);
2176 TREE_ASM_WRITTEN (decl) = 1;
2177 type_die = new_die (DW_TAG_typedef, context_die, decl);
2178 - origin = decl_ultimate_origin (decl);
2179 - if (origin != NULL)
2180 - add_abstract_origin_attribute (type_die, origin);
2183 + add_name_and_src_coords_attributes (type_die, decl);
2184 + if (DECL_ORIGINAL_TYPE (decl))
2186 - tree type = TREE_TYPE (decl);
2187 + type = DECL_ORIGINAL_TYPE (decl);
2188 + if (type == error_mark_node)
2191 + gcc_assert (type != TREE_TYPE (decl));
2192 + equate_type_number_to_die (TREE_TYPE (decl), type_die);
2196 + type = TREE_TYPE (decl);
2197 if (type == error_mark_node)
2200 - add_name_and_src_coords_attributes (type_die, decl);
2201 - if (DECL_ORIGINAL_TYPE (decl))
2202 + if (is_naming_typedef_decl (TYPE_NAME (type)))
2204 - type = DECL_ORIGINAL_TYPE (decl);
2206 - if (type == error_mark_node)
2209 - gcc_assert (type != TREE_TYPE (decl));
2210 - equate_type_number_to_die (TREE_TYPE (decl), type_die);
2211 + /* Here, we are in the case of decl being a typedef naming
2212 + an anonymous type, e.g:
2213 + typedef struct {...} foo;
2214 + In that case TREE_TYPE (decl) is not a typedef variant
2215 + type and TYPE_NAME of the anonymous type is set to the
2216 + TYPE_DECL of the typedef. This construct is emitted by
2219 + TYPE is the anonymous struct named by the typedef
2220 + DECL. As we need the DW_AT_type attribute of the
2221 + DW_TAG_typedef to point to the DIE of TYPE, let's
2222 + generate that DIE right away. add_type_attribute
2223 + called below will then pick (via lookup_type_die) that
2224 + anonymous struct DIE. */
2225 + if (!TREE_ASM_WRITTEN (type))
2226 + gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
2228 + /* This is a GNU Extension. We are adding a
2229 + DW_AT_linkage_name attribute to the DIE of the
2230 + anonymous struct TYPE. The value of that attribute
2231 + is the name of the typedef decl naming the anonymous
2232 + struct. This greatly eases the work of consumers of
2233 + this debug info. */
2234 + add_linkage_name_raw (lookup_type_die (type), decl);
2238 - if (is_naming_typedef_decl (TYPE_NAME (type)))
2240 - /* Here, we are in the case of decl being a typedef naming
2241 - an anonymous type, e.g:
2242 - typedef struct {...} foo;
2243 - In that case TREE_TYPE (decl) is not a typedef variant
2244 - type and TYPE_NAME of the anonymous type is set to the
2245 - TYPE_DECL of the typedef. This construct is emitted by
2248 - TYPE is the anonymous struct named by the typedef
2249 - DECL. As we need the DW_AT_type attribute of the
2250 - DW_TAG_typedef to point to the DIE of TYPE, let's
2251 - generate that DIE right away. add_type_attribute
2252 - called below will then pick (via lookup_type_die) that
2253 - anonymous struct DIE. */
2254 - if (!TREE_ASM_WRITTEN (type))
2255 - gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
2257 - /* This is a GNU Extension. We are adding a
2258 - DW_AT_linkage_name attribute to the DIE of the
2259 - anonymous struct TYPE. The value of that attribute
2260 - is the name of the typedef decl naming the anonymous
2261 - struct. This greatly eases the work of consumers of
2262 - this debug info. */
2263 - add_linkage_name_raw (lookup_type_die (type), decl);
2267 - add_type_attribute (type_die, type, decl_quals (decl), false,
2271 - if (is_naming_typedef_decl (decl))
2272 - /* We want that all subsequent calls to lookup_type_die with
2273 - TYPE in argument yield the DW_TAG_typedef we have just
2275 - equate_type_number_to_die (type, type_die);
2276 + add_type_attribute (type_die, type, decl_quals (decl), false,
2279 - type = TREE_TYPE (decl);
2280 + if (is_naming_typedef_decl (decl))
2281 + /* We want that all subsequent calls to lookup_type_die with
2282 + TYPE in argument yield the DW_TAG_typedef we have just
2284 + equate_type_number_to_die (type, type_die);
2286 - add_alignment_attribute (type_die, type);
2287 + add_alignment_attribute (type_die, TREE_TYPE (decl));
2289 - add_accessibility_attribute (type_die, decl);
2291 + add_accessibility_attribute (type_die, decl);
2293 if (DECL_ABSTRACT_P (decl))
2294 equate_decl_number_to_die (decl, type_die);
2295 @@ -24535,15 +24540,23 @@
2296 if (TREE_ASM_WRITTEN (type))
2299 + tree name = TYPE_NAME (type);
2300 + tree origin = decl_ultimate_origin (name);
2301 + if (origin != NULL)
2303 + gen_decl_die (origin, NULL, NULL, context_die);
2307 /* Prevent broken recursion; we can't hand off to the same type. */
2308 - gcc_assert (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) != type);
2309 + gcc_assert (DECL_ORIGINAL_TYPE (name) != type);
2311 /* Give typedefs the right scope. */
2312 context_die = scope_die_for (type, context_die);
2314 TREE_ASM_WRITTEN (type) = 1;
2316 - gen_decl_die (TYPE_NAME (type), NULL, NULL, context_die);
2317 + gen_decl_die (name, NULL, NULL, context_die);
2321 @@ -24862,6 +24875,22 @@
2325 + /* Avoid creating DIEs for local typedefs and concrete static variables that
2326 + will only be pruned later. */
2327 + if ((origin || decl_ultimate_origin (decl))
2328 + && (TREE_CODE (decl_or_origin) == TYPE_DECL
2329 + || (VAR_P (decl_or_origin) && TREE_STATIC (decl_or_origin))))
2331 + origin = decl_ultimate_origin (decl_or_origin);
2332 + if (decl && VAR_P (decl) && die != NULL)
2334 + die = lookup_decl_die (origin);
2336 + equate_decl_number_to_die (decl, die);
2341 if (die != NULL && die->die_parent == NULL)
2342 add_child_die (context_die, die);
2343 else if (TREE_CODE (decl_or_origin) == IMPORTED_DECL)
2346 [FILE:1498:patches/patch-diff-cxx]
2347 --- libstdc++-v3/configure.host.orig
2348 +++ libstdc++-v3/configure.host
2351 os_include_dir="os/bsd/freebsd"
2354 + os_include_dir="os/bionic"
2357 os_include_dir="os/generic"
2359 --- libstdc++-v3/config/os/bionic/ctype_base.h.orig
2360 +++ libstdc++-v3/config/os/bionic/ctype_base.h
2362 // Non-standard typedefs.
2363 typedef const int* __to_type;
2366 +#define _U _CTYPE_U
2367 +#define _L _CTYPE_L
2368 +#define _D _CTYPE_D
2369 +#define _S _CTYPE_S
2370 +#define _P _CTYPE_P
2371 +#define _C _CTYPE_C
2372 +#define _X _CTYPE_X
2373 +#define _B _CTYPE_B
2374 +#define _N _CTYPE_D
2377 // NB: Offsets into ctype<char>::_M_table force a particular size
2378 // on the mask type. Because of this, we don't use an enum.
2380 --- libstdc++-v3/src/c++11/futex.cc.orig
2381 +++ libstdc++-v3/src/c++11/futex.cc
2383 #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
2387 +#include <sys/syscall.h>
2389 #include <syscall.h>
2392 #include <sys/time.h>
2394 --- libstdc++-v3/src/filesystem/dir.cc.orig
2395 +++ libstdc++-v3/src/filesystem/dir.cc
2396 @@ -146,7 +146,13 @@
2398 int err = std::exchange(errno, 0);
2399 const auto entp = readdir(dirp);
2401 + int tmperr = errno;
2405 std::swap(errno, err);
2412 [FILE:1612:patches/patch-diff-gcc-testsuite]
2413 --- gcc/testsuite/gcc.dg/format/ext-1.c.orig
2414 +++ gcc/testsuite/gcc.dg/format/ext-1.c
2419 -foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
2420 +foo (quad2_t q, u_quad2_t uq, quad2_t *qn, size_t z, size_t *zn, long long int ll,
2421 unsigned long long int ull, int i, unsigned int u, double d,
2422 char *s, void *p, wchar_t *ls, wint_t lc, int *n, long int l)
2424 --- gcc/testsuite/gcc.dg/format/ext-2.c.orig
2425 +++ gcc/testsuite/gcc.dg/format/ext-2.c
2430 -foo (quad_t *qp, u_quad_t *uqp, quad_t *qn, long long int *llp,
2431 +foo (quad2_t *qp, u_quad2_t *uqp, quad2_t *qn, long long int *llp,
2432 unsigned long long int *ullp, float *fp, char *s, void **pp, wchar_t *ls,
2433 int *ip, unsigned int *up)
2435 --- gcc/testsuite/gcc.dg/format/format.h.orig
2436 +++ gcc/testsuite/gcc.dg/format/format.h
2440 /* %q formats want a "quad"; GCC considers this to be a long long. */
2441 -typedef llong quad_t;
2442 -typedef ullong u_quad_t;
2443 +typedef llong quad2_t;
2444 +typedef ullong u_quad2_t;
2446 __extension__ typedef __INTMAX_TYPE__ intmax_t;
2447 __extension__ typedef __UINTMAX_TYPE__ uintmax_t;
2448 --- gcc/testsuite/gcc.dg/pch/pch.exp.orig
2449 +++ gcc/testsuite/gcc.dg/pch/pch.exp
2451 set test "largefile.c"
2452 set testh "largefile.hs"
2453 set f [open $test w]
2454 +puts $f "/* { dg-do run { target *-*-solaris* } } */"
2455 +puts $f "/* { dg-error \"dummy\" \"fool dejagnu\" { target { ! *-*-solaris* } 20 } } */"
2456 puts $f "/* { dg-timeout-factor 4.0 } */"
2458 for { set v 0 } { $v < 10000 } { incr v } {
2461 [FILE:121:files/pkg-message-single.in]
2462 Add to path: %%PREFIX%%/bin
2463 All binaries have prefix of %%TARGET%%-