1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= GNU Compiler collection (GCC), Series 7
8 HOMEPAGE= https://gcc.gnu.org/
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[standard]= complete
23 OPTIONS_AVAILABLE= none
24 OPTIONS_STANDARD= none
26 BUILD_DEPENDS= gmp:static:standard
30 BUILDRUN_DEPENDS= binutils:single:ravensys
31 EXRUN[fortran_run]= gcc7:libs:standard
32 EXRUN[cxx_run]= gcc7:libs:standard
33 EXRUN[compilers]= gcc7:cxx_run:standard
34 EXRUN[ada_run]= gcc7:libs:standard
36 USES= cpe gmake iconv:build libtool makeinfo perl:build
40 LICENSE= GPLv2+:compilers LGPL21:compilers GPLv3+:compilers LGPL3:compilers
43 LICENSE_FILE= GPLv2+:{{WRKSRC}}/COPYING
44 LGPL21:{{WRKSRC}}/COPYING.LIB
45 GPLv3+:{{WRKSRC}}/COPYING3
46 LGPL3:{{WRKSRC}}/COPYING3.LIB
47 GPLv3RLE:{{WRKSRC}}/COPYING.RUNTIME
49 PREFIX= {{LOCALBASE}}/toolchain/{{NAMEBASE}}
51 infopages:cppinternals
66 CONFIGURE_OUTSOURCE= yes
67 CONFIGURE_ARGS= --enable-languages="c,c++,ada,fortran"
68 --with-local-prefix={{LOCALBASE}}
70 --with-gmp={{LOCALBASE}}
71 --with-mpc={{LOCALBASE}}
72 --with-mpfr={{LOCALBASE}}
73 {{ICONV_CONFIGURE_ARG}}
75 --enable-threads=posix
76 --enable-checking=release
80 --disable-libsanitizer
84 --with-ld={{LOCALBASE}}/toolchain/bin/ld
85 --with-as={{LOCALBASE}}/toolchain/bin/as
86 --with-pkgversion="Ravenports"
88 INSTALL_TARGET= install-strip
89 PLIST_SUB= GCCVER=7.2.0
90 TARGET={{CONFIGURE_TARGET}}
93 # Update LINK_SPEC to add gcc-aux lib runpath in every binary
94 @${ECHO} "Configuring LINK_SPEC runpath"
95 @${REINPLACE_CMD} -e 's;\@PREFIX\@;${PREFIX:H};' \
96 -e 's;\@GCCAUX\@;${NAMEBASE};' \
97 ${WRKSRC}/gcc/config/dragonfly.h \
98 ${WRKSRC}/gcc/config/i386/freebsd64.h \
99 ${WRKSRC}/gcc/config/i386/freebsd.h \
100 ${WRKSRC}/gcc/config/i386/gnu-user64.h \
101 ${WRKSRC}/gcc/config/aarch64/aarch64-freebsd.h
102 # Ensure dwarf4-compatible addr2line
103 ${REINPLACE_CMD} -e 's|/usr/bin/addr2line|${PREFIX:H}/bin/addr2line|g'\
104 ${WRKSRC}/gcc/ada/traceback_symbolic.c
105 ${REINPLACE_CMD} -e 's|static:crtbeginT.o%s;||' \
106 ${WRKSRC}/gcc/config/freebsd-spec.h
108 post-install-freebsd:
109 ${RM} -r ${STAGEDIR}${PREFIX}/lib/gcc/${CONFIGURE_TARGET}/7.2.0/include-fixed
111 post-install-dragonfly:
112 ${RM} -r ${STAGEDIR}${PREFIX}/lib/gcc/${CONFIGURE_TARGET}/7.2.0/include-fixed
115 cp ${STAGEDIR}${PREFIX}/bin/gcc ${STAGEDIR}${PREFIX}/bin/cc
116 cp ${STAGEDIR}${PREFIX}/bin/g++ ${STAGEDIR}${PREFIX}/bin/CC
117 ${RM} ${STAGEDIR}${MANPREFIX}/man/man7/*
118 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/gcc/${CONFIGURE_TARGET}/7.2.0/adalib/libgnarl.so
119 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/gcc/${CONFIGURE_TARGET}/7.2.0/adalib/libgnat.so
121 [FILE:329:descriptions/desc.compilers]
122 This is series 6 of the GNU Compiler Collection (GCC)
124 This compiler supports the following languages: C, C++, Fortran and Ada.
125 The GNAT front-end implements the full Ada-83, Ada-95, Ada-2005 and
126 Ada-2012 standards. The C++ front-end defaults to the gnu++14 standard.
128 This package contains the compilers, drivers, and headers.
131 [FILE:104:descriptions/desc.ada_run]
132 This is series 6 of the GNU Compiler Collection (GCC)
134 This package contains the Ada runtime libraries.
137 [FILE:104:descriptions/desc.cxx_run]
138 This is series 6 of the GNU Compiler Collection (GCC)
140 This package contains the C++ runtime libraries.
143 [FILE:108:descriptions/desc.fortran_run]
144 This is series 6 of the GNU Compiler Collection (GCC)
146 This package contains the Fortran runtime libraries.
149 [FILE:162:descriptions/desc.libs]
150 This is series 6 of the GNU Compiler Collection (GCC)
152 This package contains the remaining runtime libraries after excluding
153 the Ada, C++, and Fortran libraries.
156 [FILE:126:descriptions/desc.infopages]
157 This is series 6 of the GNU Compiler Collection (GCC)
159 This package contains the man pages and info pages that come with GCC.
163 1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a 62312628 gcc-7.2.0.tar.xz
166 [FILE:26037:manifests/plist.compilers]
167 %%ONLY-DRAGONFLY%%lib/gcc/%%TARGET%%/%%GCCVER%%/include/tgmath.h
168 %%ONLY-DRAGONFLY%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/
171 %%ONLY-DRAGONFLY%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/i386/dragonfly.h
172 %%ONLY-FREEBSD%%lib/gcc/%%TARGET%%/%%GCCVER%%/include/tgmath.h
173 %%ONLY-FREEBSD%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/
177 %%ONLY-FREEBSD%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/i386/
180 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/
186 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/include-fixed/
188 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/include-fixed/linux/a.out.h
191 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/
194 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/i386/
199 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/
203 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/cilk.h
204 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/cilk_api.h
205 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/cilk_api_linux.h
206 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/cilk_stub.h
207 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/cilk_undocumented.h
208 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/common.h
209 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/holder.h
210 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/hyperobject_base.h
211 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/metaprogramming.h
212 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer.h
213 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_file.h
214 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_list.h
215 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_max.h
216 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_min.h
217 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_min_max.h
218 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_opadd.h
219 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_opand.h
220 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_opmul.h
221 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_opor.h
222 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_opxor.h
223 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_ostream.h
224 @comment lib/gcc/%%TARGET%%/%%GCCVER%%/include/cilk/reducer_string.h
229 %%TARGET%%-gcc-%%GCCVER%%
232 %%TARGET%%-gcc-ranlib
260 include/c++/%%GCCVER%%/%%TARGET%%/bits/
283 include/c++/%%GCCVER%%/%%TARGET%%/ext/opt_random.h
284 include/c++/%%GCCVER%%/
289 include/c++/%%GCCVER%%/backward/
298 include/c++/%%GCCVER%%/bits/
305 atomic_lockfree_defines.h
310 boost_concept_check.h
319 cxxabi_init_exception.h
321 enable_special_members.h
345 locale_facets_nonio.h
346 locale_facets_nonio.tcc
393 stl_iterator_base_funcs.h
394 stl_iterator_base_types.h
402 stl_raw_storage_iter.h
425 include/c++/%%GCCVER%%/
459 include/c++/%%GCCVER%%/debug/
479 safe_local_iterator.h
480 safe_local_iterator.tcc
483 safe_unordered_base.h
484 safe_unordered_container.h
485 safe_unordered_container.tcc
493 include/c++/%%GCCVER%%/decimal/
496 include/c++/%%GCCVER%%/
499 include/c++/%%GCCVER%%/experimental/
503 include/c++/%%GCCVER%%/experimental/bits/
512 include/c++/%%GCCVER%%/experimental/
540 include/c++/%%GCCVER%%/ext/
549 codecvt_specializations.h
564 include/c++/%%GCCVER%%/ext/pb_ds/
566 include/c++/%%GCCVER%%/ext/pb_ds/detail/bin_search_tree_/
568 constructors_destructor_fn_imps.hpp
574 iterators_fn_imps.hpp
577 policy_access_fn_imps.hpp
580 split_join_fn_imps.hpp
582 include/c++/%%GCCVER%%/ext/pb_ds/detail/binary_heap_/
585 constructors_destructor_fn_imps.hpp
593 iterators_fn_imps.hpp
594 point_const_iterator.hpp
595 policy_access_fn_imps.hpp
597 split_join_fn_imps.hpp
599 include/c++/%%GCCVER%%/ext/pb_ds/detail/binomial_heap_/
601 constructors_destructor_fn_imps.hpp
603 include/c++/%%GCCVER%%/ext/pb_ds/detail/binomial_heap_base_/
604 binomial_heap_base_.hpp
605 constructors_destructor_fn_imps.hpp
610 split_join_fn_imps.hpp
611 include/c++/%%GCCVER%%/ext/pb_ds/detail/branch_policy/
613 null_node_metadata.hpp
615 include/c++/%%GCCVER%%/ext/pb_ds/detail/cc_hash_table_map_/
618 cond_key_dtor_entry_dealtor.hpp
619 constructor_destructor_fn_imps.hpp
620 constructor_destructor_no_store_hash_fn_imps.hpp
621 constructor_destructor_store_hash_fn_imps.hpp
623 debug_no_store_hash_fn_imps.hpp
624 debug_store_hash_fn_imps.hpp
625 entry_list_fn_imps.hpp
627 erase_no_store_hash_fn_imps.hpp
628 erase_store_hash_fn_imps.hpp
630 find_store_hash_fn_imps.hpp
633 insert_no_store_hash_fn_imps.hpp
634 insert_store_hash_fn_imps.hpp
635 iterators_fn_imps.hpp
636 policy_access_fn_imps.hpp
638 resize_no_store_hash_fn_imps.hpp
639 resize_store_hash_fn_imps.hpp
642 include/c++/%%GCCVER%%/ext/pb_ds/detail/
644 container_base_dispatch.hpp
646 include/c++/%%GCCVER%%/ext/pb_ds/detail/eq_fn/
649 include/c++/%%GCCVER%%/ext/pb_ds/detail/gp_hash_table_map_/
650 constructor_destructor_fn_imps.hpp
651 constructor_destructor_no_store_hash_fn_imps.hpp
652 constructor_destructor_store_hash_fn_imps.hpp
654 debug_no_store_hash_fn_imps.hpp
655 debug_store_hash_fn_imps.hpp
657 erase_no_store_hash_fn_imps.hpp
658 erase_store_hash_fn_imps.hpp
660 find_no_store_hash_fn_imps.hpp
661 find_store_hash_fn_imps.hpp
665 insert_no_store_hash_fn_imps.hpp
666 insert_store_hash_fn_imps.hpp
668 policy_access_fn_imps.hpp
670 resize_no_store_hash_fn_imps.hpp
671 resize_store_hash_fn_imps.hpp
673 include/c++/%%GCCVER%%/ext/pb_ds/detail/hash_fn/
674 direct_mask_range_hashing_imp.hpp
675 direct_mod_range_hashing_imp.hpp
676 linear_probe_fn_imp.hpp
677 mask_based_range_hashing.hpp
678 mod_based_range_hashing.hpp
680 quadratic_probe_fn_imp.hpp
684 sample_range_hashing.hpp
685 sample_ranged_hash_fn.hpp
686 sample_ranged_probe_fn.hpp
687 include/c++/%%GCCVER%%/ext/pb_ds/detail/left_child_next_sibling_heap_/
689 constructors_destructor_fn_imps.hpp
694 iterators_fn_imps.hpp
695 left_child_next_sibling_heap_.hpp
697 point_const_iterator.hpp
698 policy_access_fn_imps.hpp
700 include/c++/%%GCCVER%%/ext/pb_ds/detail/list_update_map_/
701 constructor_destructor_fn_imps.hpp
703 entry_metadata_base.hpp
708 iterators_fn_imps.hpp
711 include/c++/%%GCCVER%%/ext/pb_ds/detail/list_update_policy/
712 lu_counter_metadata.hpp
713 sample_update_policy.hpp
714 include/c++/%%GCCVER%%/ext/pb_ds/detail/ov_tree_map_/
715 constructors_destructor_fn_imps.hpp
720 iterators_fn_imps.hpp
723 policy_access_fn_imps.hpp
724 split_join_fn_imps.hpp
726 include/c++/%%GCCVER%%/ext/pb_ds/detail/pairing_heap_/
727 constructors_destructor_fn_imps.hpp
733 split_join_fn_imps.hpp
734 include/c++/%%GCCVER%%/ext/pb_ds/detail/pat_trie_/
735 constructors_destructor_fn_imps.hpp
740 insert_join_fn_imps.hpp
741 iterators_fn_imps.hpp
744 policy_access_fn_imps.hpp
748 synth_access_traits.hpp
752 include/c++/%%GCCVER%%/ext/pb_ds/detail/
753 priority_queue_base_dispatch.hpp
754 include/c++/%%GCCVER%%/ext/pb_ds/detail/rb_tree_map_/
755 constructors_destructor_fn_imps.hpp
763 split_join_fn_imps.hpp
765 include/c++/%%GCCVER%%/ext/pb_ds/detail/rc_binomial_heap_/
766 constructors_destructor_fn_imps.hpp
771 rc_binomial_heap_.hpp
772 split_join_fn_imps.hpp
774 include/c++/%%GCCVER%%/ext/pb_ds/detail/resize_policy/
775 cc_hash_max_collision_check_resize_trigger_imp.hpp
776 hash_exponential_size_policy_imp.hpp
777 hash_load_check_resize_trigger_imp.hpp
778 hash_load_check_resize_trigger_size_base.hpp
779 hash_prime_size_policy_imp.hpp
780 hash_standard_resize_policy_imp.hpp
781 sample_resize_policy.hpp
782 sample_resize_trigger.hpp
783 sample_size_policy.hpp
784 include/c++/%%GCCVER%%/ext/pb_ds/detail/splay_tree_/
785 constructors_destructor_fn_imps.hpp
794 split_join_fn_imps.hpp
796 include/c++/%%GCCVER%%/ext/pb_ds/detail/
797 standard_policies.hpp
798 include/c++/%%GCCVER%%/ext/pb_ds/detail/thin_heap_/
799 constructors_destructor_fn_imps.hpp
804 split_join_fn_imps.hpp
807 include/c++/%%GCCVER%%/ext/pb_ds/detail/tree_policy/
808 node_metadata_selector.hpp
809 order_statistics_imp.hpp
810 sample_tree_node_update.hpp
811 include/c++/%%GCCVER%%/ext/pb_ds/detail/
813 include/c++/%%GCCVER%%/ext/pb_ds/detail/trie_policy/
814 node_metadata_selector.hpp
815 order_statistics_imp.hpp
816 prefix_search_node_update_imp.hpp
817 sample_trie_access_traits.hpp
818 sample_trie_node_update.hpp
820 trie_string_access_traits_imp.hpp
821 include/c++/%%GCCVER%%/ext/pb_ds/detail/
824 include/c++/%%GCCVER%%/ext/pb_ds/detail/unordered_iterator/
827 point_const_iterator.hpp
829 include/c++/%%GCCVER%%/ext/pb_ds/
832 list_update_policy.hpp
837 include/c++/%%GCCVER%%/ext/
859 include/c++/%%GCCVER%%/
883 include/c++/%%GCCVER%%/parallel/
893 compiletime_settings.h
927 include/c++/%%GCCVER%%/profile/
933 include/c++/%%GCCVER%%/profile/impl/
936 profiler_container_size.h
938 profiler_hashtable_size.h
939 profiler_list_to_slist.h
940 profiler_list_to_vector.h
941 profiler_map_to_unordered_map.h
945 profiler_vector_size.h
946 profiler_vector_to_list.h
947 include/c++/%%GCCVER%%/profile/
961 include/c++/%%GCCVER%%/
979 include/c++/%%GCCVER%%/tr1/
1013 legendre_function.tcc
1017 modified_bessel_func.tcc
1026 special_function_util.h
1042 include/c++/%%GCCVER%%/tr2/
1049 include/c++/%%GCCVER%%/
1060 lib/gcc/%%TARGET%%/%%GCCVER%%/
1065 lib/gcc/%%TARGET%%/%%GCCVER%%/finclude/
1077 lib/gcc/%%TARGET%%/%%GCCVER%%/include/
1081 avx5124fmapsintrin.h
1082 avx5124vnniwintrin.h
1089 avx512ifmavlintrin.h
1092 avx512vbmivlintrin.h
1096 avx512vpopcntdqintrin.h
1136 lib/gcc/%%TARGET%%/%%GCCVER%%/include/ssp/
1141 lib/gcc/%%TARGET%%/%%GCCVER%%/include/
1164 lib/gcc/%%TARGET%%/%%GCCVER%%/install-tools/
1167 lib/gcc/%%TARGET%%/%%GCCVER%%/install-tools/include/
1170 lib/gcc/%%TARGET%%/%%GCCVER%%/install-tools/
1173 lib/gcc/%%TARGET%%/%%GCCVER%%/
1178 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/
1180 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/ada/gcc-interface/ada-tree.def
1181 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/
1202 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/c-family/
1208 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/
1233 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/
1236 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/i386/
1246 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/config/
1249 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/
1255 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/cp/
1261 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/
1325 gimple-pretty-print.h
1350 highlev-plugin-common.h
1406 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/include/objc/objc-tree.def
1489 substring-locations.h
1496 target-hooks-macros.h
1534 tree-scalar-evolution.h
1541 tree-ssa-loop-ivopts.h
1542 tree-ssa-loop-manip.h
1543 tree-ssa-loop-niter.h
1546 tree-ssa-propagate.h
1548 tree-ssa-scopedtables.h
1550 tree-ssa-threadbackward.h
1551 tree-ssa-threadedge.h
1552 tree-ssa-threadupdate.h
1578 lib/gcc/%%TARGET%%/%%GCCVER%%/plugin/
1581 libcc1plugin.so.0.0.0
1584 libcp1plugin.so.0.0.0
1585 libexec/gcc/%%TARGET%%/%%GCCVER%%/
1591 libexec/gcc/%%TARGET%%/%%GCCVER%%/install-tools/
1596 libexec/gcc/%%TARGET%%/%%GCCVER%%/
1599 liblto_plugin.so.0.0.0
1602 libexec/gcc/%%TARGET%%/%%GCCVER%%/plugin/gengtype
1605 [FILE:27199:manifests/plist.ada_run]
1606 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/adainclude/
1609 %%ONLY-LINUX%%lib/gcc/%%TARGET%%/%%GCCVER%%/adalib/
1612 lib/gcc/%%TARGET%%/%%GCCVER%%/adainclude/
2858 lib/gcc/%%TARGET%%/%%GCCVER%%/adalib/
3553 [FILE:262:manifests/plist.cxx_run]
3559 libstdc++.so.6.0.24-gdb.py
3562 share/gcc-%%GCCVER%%/python/libstdcxx/__init__.py
3563 share/gcc-%%GCCVER%%/python/libstdcxx/v6/
3569 [FILE:240:manifests/plist.fortran_run]
3574 libgfortran.so.4.0.0
3584 libquadmath.so.0.0.0
3587 [FILE:452:manifests/plist.libs]
3596 @comment %%ASLIB%%/libcilkrts.a
3597 @comment %%ASLIB%%/libcilkrts.so
3598 @comment %%ASLIB%%/libcilkrts.so.5
3599 @comment %%ASLIB%%/libcilkrts.so.5.0.0
3600 @comment %%ASLIB%%/libcilkrts.spec
3615 [FILE:104:manifests/plist.infopages]
3626 [FILE:39877:patches/patch-diff-ada]
3627 --- gcc/ada/adaint.c.orig
3628 +++ gcc/ada/adaint.c
3629 @@ -1174,6 +1174,47 @@
3633 +#elif defined (__ANDROID__)
3636 + * ext2 /ext3/ext4/fat16/fat32 have no path limits
3637 + * /data/local/tmp normally requires rooted devices, if it even exists
3638 + * /sdcard is the standard location for external storage. Nativeactivity
3639 + * manifest needs to authorize its use, otherwise it might not have the
3640 + * proper permissions.
3644 + char *datadir = getenv ("ANDROID_DATA");
3646 + if (datadir == NULL)
3647 + strncpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX", L_tmpnam);
3649 + snprintf (tmp_filename, L_tmpnam, "%s/local/tmp/gnat-XXXXXX", datadir);
3651 + testfd = mkstemp (tmp_filename);
3658 + char *sdcard = getenv ("EXTERNAL_STORAGE");
3660 + if (sdcard == NULL)
3661 + strncpy (tmp_filename, "/sdcard/gnat-XXXXXX", L_tmpnam);
3663 + snprintf (tmp_filename, L_tmpnam, "%s/gnat-XXXXXX", sdcard);
3665 + testfd = mkstemp (tmp_filename);
3672 + tmpnam (tmp_filename);
3674 #elif defined (__linux__) || defined (__FreeBSD__) || defined (__NetBSD__) \
3675 || defined (__OpenBSD__) || defined (__GLIBC__) || defined (__ANDROID__) \
3676 || defined (__DragonFly__)
3677 @@ -1460,7 +1501,7 @@
3678 utimbuf.modtime = time_stamp;
3680 /* Set access time to now in local time. */
3681 - t = time ((time_t) 0);
3683 utimbuf.actime = mktime (localtime (&t));
3685 utime (name, &utimbuf);
3686 --- gcc/ada/cio.c.orig
3690 /* Don't use macros on GNU/Linux since they cause incompatible changes between
3691 glibc 2.0 and 2.1 */
3693 +#if defined __linux__ && !defined __ANDROID__
3697 --- gcc/ada/cstreams.c.orig
3698 +++ gcc/ada/cstreams.c
3700 #include <unixlib.h>
3704 +#if defined __linux__ && !defined __ANDROID__
3705 /* Don't use macros on GNU/Linux since they cause incompatible changes between
3706 glibc 2.0 and 2.1 */
3709 +++ gcc/ada/g-socthi-bsd.adb
3711 +------------------------------------------------------------------------------
3713 +-- GNAT COMPILER COMPONENTS --
3715 +-- G N A T . S O C K E T S . T H I N --
3719 +-- Copyright (C) 2001-2013, AdaCore --
3721 +-- GNAT is free software; you can redistribute it and/or modify it under --
3722 +-- terms of the GNU General Public License as published by the Free Soft- --
3723 +-- ware Foundation; either version 3, or (at your option) any later ver- --
3724 +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
3725 +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
3726 +-- or FITNESS FOR A PARTICULAR PURPOSE. --
3728 +-- As a special exception under Section 7 of GPL version 3, you are granted --
3729 +-- additional permissions described in the GCC Runtime Library Exception, --
3730 +-- version 3.1, as published by the Free Software Foundation. --
3732 +-- You should have received a copy of the GNU General Public License and --
3733 +-- a copy of the GCC Runtime Library Exception along with this program; --
3734 +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
3735 +-- <http://www.gnu.org/licenses/>. --
3737 +-- GNAT was originally developed by the GNAT team at New York University. --
3738 +-- Extensive contributions were provided by Ada Core Technologies Inc. --
3740 +------------------------------------------------------------------------------
3742 +-- This package provides a target dependent thin interface to the sockets
3743 +-- layer for use by the GNAT.Sockets package (g-socket.ads). This package
3744 +-- should not be directly with'ed by an applications program.
3746 +-- This is the *BSD version which uses fcntl rather than ioctl
3747 +-- The constant SCON.Thread_Blocking_IO is always true (for all platforms, not
3748 +-- just *BSD), so this binding is significantly simpler than the standard
3749 +-- one it replaces.
3751 +with GNAT.OS_Lib; use GNAT.OS_Lib;
3753 +with Interfaces.C; use Interfaces.C;
3755 +package body GNAT.Sockets.Thin is
3757 + function Syscall_Accept
3759 + Addr : System.Address;
3760 + Addrlen : not null access C.int) return C.int;
3761 + pragma Import (C, Syscall_Accept, "accept");
3762 + -- The accept() function accepts a connection on a socket. An incoming
3763 + -- connection is acknowledged and associated with an immediately created
3764 + -- socket. The original socket is returned to the listening state.
3766 + function Syscall_Connect
3768 + Name : System.Address;
3769 + Namelen : C.int) return C.int;
3770 + pragma Import (C, Syscall_Connect, "connect");
3771 + -- The connect() system call initiates a connection on a socket. If the
3772 + -- parameter S is of type SOCK_DGRAM then connect() permanently specifies
3773 + -- the peer to which datagrams are to be sent. If S is type SOCK_STREAM
3774 + -- then connect() attempts to make a connection with another socket, which
3775 + -- is identified by the parameter Name.
3777 + function Syscall_Recv
3779 + Msg : System.Address;
3781 + Flags : C.int) return C.int;
3782 + pragma Import (C, Syscall_Recv, "recv");
3783 + -- The recv() function receives a message from a socket. The call can be
3784 + -- used on a connection mode socket or a bound, connectionless socket. If
3785 + -- no messages are available at the socket, the recv() call waits for a
3786 + -- message to arrive unless the socket is non-blocking. If a socket is
3787 + -- non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK.
3789 + function Syscall_Recvfrom
3791 + Msg : System.Address;
3794 + From : System.Address;
3795 + Fromlen : not null access C.int) return C.int;
3796 + pragma Import (C, Syscall_Recvfrom, "recvfrom");
3797 + -- The recvfrom() system call receives a message from a socket and captures
3798 + -- the address from which the data was sent. It can be used to receive
3799 + -- data on an unconnected socket as well. If no messages are available,
3800 + -- the call waits for a message to arrive on blocking sockets. For
3801 + -- non-blocking sockets without messages, -1 is returned and ERRNO is set
3802 + -- to EAGAIN or EWOULDBLOCK.
3804 + function Syscall_Recvmsg
3806 + Msg : System.Address;
3807 + Flags : C.int) return System.CRTL.ssize_t;
3808 + pragma Import (C, Syscall_Recvmsg, "recvmsg");
3809 + -- The recvmsg call receives a message from a socket, and can be used to
3810 + -- receive data on an unconnected socket as well. If no messages are
3811 + -- available, the call waits for a message to arrive on blocking sockets.
3812 + -- For non-blocking sockets without messages, -1 is returned and ERRNO is
3813 + -- set to EAGAIN or EWOULDBLOCK.
3815 + function Syscall_Sendmsg
3817 + Msg : System.Address;
3818 + Flags : C.int) return System.CRTL.ssize_t;
3819 + pragma Import (C, Syscall_Sendmsg, "sendmsg");
3820 + -- The sendmsg() function sends a message to a socket, and can be used with
3821 + -- unconnected sockets as well (the msg is ignored in this case). The
3822 + -- function returns the number of bytes sent when successful, otherwise it
3823 + -- returns -1 and ERRNO is set (many possible values).
3825 + function Syscall_Sendto
3827 + Msg : System.Address;
3830 + To : System.Address;
3831 + Tolen : C.int) return C.int;
3832 + pragma Import (C, Syscall_Sendto, "sendto");
3833 + -- The sendto() function only works for connected sockets and it initiates
3834 + -- the transmission of a message. A successful call returns the numbers of
3835 + -- bytes sent, and a failure returns a -1 and ERRNO is set.
3837 + function Syscall_Socket
3840 + Protocol : C.int) return C.int;
3841 + pragma Import (C, Syscall_Socket, "socket");
3842 + -- The socket() function is used to create an unbound socket and returns a
3843 + -- file descriptor that can be used with other socket functions. Upon
3844 + -- failure, a -1 is returned and ERRNO is set.
3846 + procedure Disable_SIGPIPE (S : C.int);
3847 + pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe");
3849 + procedure Disable_All_SIGPIPEs;
3850 + pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes");
3851 + -- Sets the process to ignore all SIGPIPE signals on platforms that
3852 + -- don't support Disable_SIGPIPE for particular streams.
3857 + Val : C.int) return C.int;
3858 + pragma Import (C, C_Fcntl, "fcntl");
3859 + -- The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support
3860 + -- setting a socket in non-blocking mode. fcntl must be used instead.
3868 + Addr : System.Address;
3869 + Addrlen : not null access C.int) return C.int
3871 + R : constant C.int := Syscall_Accept (S, Addr, Addrlen);
3874 + Disable_SIGPIPE (R);
3882 + function C_Connect
3884 + Name : System.Address;
3885 + Namelen : C.int) return C.int
3888 + return Syscall_Connect (S, Name, Namelen);
3891 + ------------------
3892 + -- Socket_Ioctl --
3893 + ------------------
3895 + function Socket_Ioctl
3897 + Req : SOSC.IOCTL_Req_T;
3898 + Arg : access C.int) return C.int
3901 + if Req = SOSC.FIONBIO then
3904 + flags : constant Unsigned_32 :=
3905 + Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
3906 + nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.O_NDELAY);
3907 + enabled : constant Boolean := Arg.all = 1;
3908 + newval : C.int := C.int (flags);
3911 + newval := C.int (flags or nonblock);
3912 + elsif (flags and nonblock) > 0 then
3913 + newval := C.int (flags - nonblock);
3915 + return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval);
3919 + return C_Ioctl (S, Req, Arg);
3928 + Msg : System.Address;
3930 + Flags : C.int) return C.int
3933 + return Syscall_Recv (S, Msg, Len, Flags);
3940 + function C_Recvfrom
3942 + Msg : System.Address;
3945 + From : System.Address;
3946 + Fromlen : not null access C.int) return C.int
3949 + return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
3956 + function C_Recvmsg
3958 + Msg : System.Address;
3959 + Flags : C.int) return System.CRTL.ssize_t
3962 + return Syscall_Recvmsg (S, Msg, Flags);
3969 + function C_Sendmsg
3971 + Msg : System.Address;
3972 + Flags : C.int) return System.CRTL.ssize_t
3975 + return Syscall_Sendmsg (S, Msg, Flags);
3984 + Msg : System.Address;
3987 + To : System.Address;
3988 + Tolen : C.int) return C.int
3991 + return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
4001 + Protocol : C.int) return C.int
4003 + R : constant C.int := Syscall_Socket (Domain, Typ, Protocol);
4005 + Disable_SIGPIPE (R);
4013 + procedure Finalize is
4018 + -------------------------
4019 + -- Host_Error_Messages --
4020 + -------------------------
4022 + package body Host_Error_Messages is separate;
4028 + procedure Initialize is
4030 + Disable_All_SIGPIPEs;
4033 + --------------------
4034 + -- Signalling_Fds --
4035 + --------------------
4037 + package body Signalling_Fds is
4039 + -- In this default implementation, we use a C version of these
4040 + -- subprograms provided by socket.c.
4042 + function C_Create (Fds : not null access Fd_Pair) return C.int;
4043 + function C_Read (Rsig : C.int) return C.int;
4044 + function C_Write (Wsig : C.int) return C.int;
4045 + procedure C_Close (Sig : C.int);
4047 + pragma Import (C, C_Create, "__gnat_create_signalling_fds");
4048 + pragma Import (C, C_Read, "__gnat_read_signalling_fd");
4049 + pragma Import (C, C_Write, "__gnat_write_signalling_fd");
4050 + pragma Import (C, C_Close, "__gnat_close_signalling_fd");
4053 + (Fds : not null access Fd_Pair) return C.int renames C_Create;
4054 + function Read (Rsig : C.int) return C.int renames C_Read;
4055 + function Write (Wsig : C.int) return C.int renames C_Write;
4056 + procedure Close (Sig : C.int) renames C_Close;
4058 + end Signalling_Fds;
4060 + --------------------------
4061 + -- Socket_Error_Message --
4062 + --------------------------
4064 + function Socket_Error_Message (Errno : Integer) return String is separate;
4066 +end GNAT.Sockets.Thin;
4067 --- gcc/ada/gnatchop.adb.orig
4068 +++ gcc/ada/gnatchop.adb
4070 Config_File_Name : constant String_Access := new String'("gnat.adc");
4071 -- The name of the file holding the GNAT configuration pragmas
4073 - Gcc : String_Access := new String'("gcc");
4074 + Gcc : String_Access := new String'("ada");
4075 -- May be modified by switch --GCC=
4077 Gcc_Set : Boolean := False;
4078 --- gcc/ada/gnatlink.adb.orig
4079 +++ gcc/ada/gnatlink.adb
4081 -- This table collects the arguments to be passed to compile the binder
4084 - Gcc : String_Access := Program_Name ("gcc", "gnatlink");
4085 + Gcc : String_Access := Program_Name ("ada", "gnatlink");
4087 Read_Mode : constant String := "r" & ASCII.NUL;
4089 --- gcc/ada/make.adb.orig
4090 +++ gcc/ada/make.adb
4092 -- Compiler, Binder & Linker Data and Subprograms --
4093 ----------------------------------------------------
4095 - Gcc : String_Access := Program_Name ("gcc", "gnatmake");
4096 + Gcc : String_Access := Program_Name ("ada", "gnatmake");
4097 Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
4098 Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
4099 -- Default compiler, binder, linker programs
4100 --- gcc/ada/mlib-prj.adb.orig
4101 +++ gcc/ada/mlib-prj.adb
4102 @@ -335,6 +335,11 @@
4104 Foreign_Sources : Boolean;
4106 + Rpath_Disabled : Boolean := False;
4107 + -- If -R is passed through the library options for the linker, it will
4108 + -- prevent the implemented libraries portion of the rpath switch from
4109 + -- being built, even if the linker is capable of supporting rpath.
4111 Rpath : String_Access := null;
4112 -- Allocated only if Path Option is supported
4115 Opts.Table (Opts.Last) :=
4116 new String'("-L" & Name_Buffer (1 .. Name_Len));
4118 - if Path_Option /= null then
4119 + if not Rpath_Disabled and then Path_Option /= null then
4120 Add_Rpath (Name_Buffer (1 .. Name_Len));
4123 @@ -1299,9 +1304,13 @@
4124 Get_Name_String (Element.Value);
4126 if Name_Len /= 0 then
4127 - Opts.Increment_Last;
4128 - Opts.Table (Opts.Last) :=
4129 - new String'(Name_Buffer (1 .. Name_Len));
4130 + if Name_Buffer (1 .. Name_Len) = "-R" then
4131 + Rpath_Disabled := True;
4133 + Opts.Increment_Last;
4134 + Opts.Table (Opts.Last) :=
4135 + new String'(Name_Buffer (1 .. Name_Len));
4139 Current := Element.Next;
4140 --- gcc/ada/mlib-utl.adb.orig
4141 +++ gcc/ada/mlib-utl.adb
4143 if Driver_Name = No_Name then
4144 if Gcc_Exec = null then
4145 if Gcc_Name = null then
4146 - Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
4147 + Gcc_Name := Osint.Program_Name ("ada", "gnatmake");
4150 Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
4151 --- gcc/ada/prj-makr.adb.orig
4152 +++ gcc/ada/prj-makr.adb
4155 procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
4157 - Gcc : constant String := "gcc";
4158 + Gcc : constant String := "ada";
4159 Gcc_Path : String_Access := null;
4161 Non_Empty_Node : constant Project_Node_Id := 1;
4163 +++ gcc/ada/s-trasym-bsd.adb
4165 +------------------------------------------------------------------------------
4167 +-- GNAT RUN-TIME COMPONENTS --
4169 +-- S Y S T E M . T R A C E B A C K . S Y M B O L I C --
4173 +-- Copyright (C) 1999-2009, AdaCore --
4175 +-- GNAT is free software; you can redistribute it and/or modify it under --
4176 +-- terms of the GNU General Public License as published by the Free Soft- --
4177 +-- ware Foundation; either version 2, or (at your option) any later ver- --
4178 +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
4179 +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
4180 +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
4181 +-- for more details. You should have received a copy of the GNU General --
4182 +-- Public License distributed with GNAT; see file COPYING. If not, write --
4183 +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
4184 +-- Boston, MA 02110-1301, USA. --
4186 +-- As a special exception, if other files instantiate generics from this --
4187 +-- unit, or you link this unit with other files to produce an executable, --
4188 +-- this unit does not by itself cause the resulting executable to be --
4189 +-- covered by the GNU General Public License. This exception does not --
4190 +-- however invalidate any other reasons why the executable file might be --
4191 +-- covered by the GNU Public License. --
4193 +-- GNAT was originally developed by the GNAT team at New York University. --
4194 +-- Extensive contributions were provided by Ada Core Technologies Inc. --
4196 +------------------------------------------------------------------------------
4198 +-- Run-time symbolic traceback support
4199 +-- This file is based on the work by Juergen Pfiefer which is still used
4200 +-- today to provide symbolic traceback support for gnu/kFreeBSD.
4201 +-- Incorporated in GNAT-AUX by John Marino <http://www.dragonlace.net>
4203 +with System.Soft_Links;
4204 +with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
4206 +package body System.Traceback.Symbolic is
4208 + package TSL renames System.Soft_Links;
4210 + -- To perform the raw addresses to symbolic form translation we rely on a
4211 + -- libaddr2line symbolizer which examines debug info from a provided
4212 + -- executable file name, and an absolute path is needed to ensure the file
4213 + -- is always found. This is "__gnat_locate_exec_on_path (gnat_argv [0])"
4214 + -- for our executable file, a fairly heavy operation so we cache the
4217 + Exename : System.Address;
4218 + -- Pointer to the name of the executable file to be used on all
4219 + -- invocations of the libaddr2line symbolization service.
4221 + Exename_Resolved : Boolean := False;
4222 + -- Flag to indicate whether we have performed the executable file name
4223 + -- resolution already. Relying on a not null Exename for this purpose
4224 + -- would be potentially inefficient as this is what we will get if the
4225 + -- resolution attempt fails.
4227 + ------------------------
4228 + -- Symbolic_Traceback --
4229 + ------------------------
4231 + function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is
4233 + procedure convert_addresses
4234 + (filename : System.Address;
4235 + addrs : System.Address;
4236 + n_addrs : Integer;
4237 + buf : System.Address;
4238 + len : System.Address);
4239 + pragma Import (C, convert_addresses, "convert_addresses");
4240 + -- This is the procedure version of the Ada-aware addr2line. It places
4241 + -- in BUF a string representing the symbolic translation of the N_ADDRS
4242 + -- raw addresses provided in ADDRS, looked up in debug information from
4243 + -- FILENAME. LEN points to an integer which contains the size of the
4244 + -- BUF buffer at input and the result length at output.
4246 + -- Note that this procedure is *not* thread-safe.
4248 + type Argv_Array is array (0 .. 0) of System.Address;
4249 + gnat_argv : access Argv_Array;
4250 + pragma Import (C, gnat_argv, "gnat_argv");
4252 + function locate_exec_on_path
4253 + (c_exename : System.Address) return System.Address;
4254 + pragma Import (C, locate_exec_on_path, "__gnat_locate_exec_on_path");
4256 + B_Size : constant Integer := 256 * Traceback'Length;
4257 + Len : Integer := B_Size;
4258 + Res : String (1 .. B_Size);
4260 + use type System.Address;
4263 + -- The symbolic translation of an empty set of addresses is an empty
4266 + if Traceback'Length = 0 then
4270 + -- If our input set of raw addresses is not empty, resort to the
4271 + -- libaddr2line service to symbolize it all.
4273 + -- Compute, cache and provide the absolute path to our executable file
4274 + -- name as the binary file where the relevant debug information is to be
4275 + -- found. If the executable file name resolution fails, we have no
4276 + -- sensible basis to invoke the symbolizer at all.
4278 + -- Protect all this against concurrent accesses explicitly, as the
4279 + -- underlying services are potentially thread unsafe.
4281 + TSL.Lock_Task.all;
4283 + if not Exename_Resolved then
4284 + Exename := locate_exec_on_path (gnat_argv (0));
4285 + Exename_Resolved := True;
4288 + if Exename /= System.Null_Address then
4289 + Len := Res'Length;
4291 + (Exename, Traceback'Address, Traceback'Length,
4292 + Res (1)'Address, Len'Address);
4295 + TSL.Unlock_Task.all;
4297 + -- Return what the addr2line symbolizer has produced if we have called
4298 + -- it (the executable name resolution succeeded), or an empty string
4301 + if Exename /= System.Null_Address then
4302 + return Res (1 .. Len);
4307 + end Symbolic_Traceback;
4309 + function Symbolic_Traceback
4310 + (E : Ada.Exceptions.Exception_Occurrence) return String is
4312 + return Symbolic_Traceback (Tracebacks (E));
4313 + end Symbolic_Traceback;
4315 +end System.Traceback.Symbolic;
4316 --- gcc/ada/terminals.c.orig
4317 +++ gcc/ada/terminals.c
4319 /* First all usupported platforms. Add stubs for exported routines. */
4321 #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \
4322 - || defined (__ANDROID__) || defined (__PikeOS__) || defined(__DJGPP__)
4323 + || defined (__PikeOS__) || defined(__DJGPP__)
4325 #define ATTRIBUTE_UNUSED __attribute__((unused))
4327 @@ -1052,7 +1052,7 @@
4328 || defined (__OpenBSD__) \
4329 || defined (__NetBSD__) \
4330 || defined (__DragonFly__)
4335 /* Include every system header we need */
4336 @@ -1063,8 +1063,8 @@
4338 /* On some system termio is either absent or including it will disable termios
4340 -#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
4341 - && !defined (__rtems__)
4342 +#if ! defined (__hpux__) && ! defined (FREEBSD) && \
4343 + ! defined (__APPLE__) && ! defined(__rtems__)
4344 # include <termio.h>
4347 @@ -1076,10 +1076,10 @@
4348 #include <sys/types.h>
4349 #include <sys/wait.h>
4351 -#if defined (__sun__)
4353 # include <sys/stropts.h>
4355 -#if defined (BSD) || defined (__sun__)
4356 +#if defined (FREEBSD) || defined (sun)
4357 # include <sys/signal.h>
4359 #if defined (__hpux__)
4360 @@ -1087,11 +1087,15 @@
4361 # include <sys/stropts.h>
4365 +#define CDISABLE _PC_VDISABLE
4367 #define CDISABLE _POSIX_VDISABLE
4370 /* On HP-UX and Sun system, there is a bzero function but with a different
4371 signature. Use memset instead */
4372 -#if defined (__hpux__) || defined (__sun__) || defined (_AIX)
4373 +#if defined (__hpux__) || defined (sun) || defined (_AIX)
4374 # define bzero(s,n) memset (s,0,n)
4377 @@ -1109,11 +1113,11 @@
4380 /* Configurable part */
4381 -#if defined (__APPLE__) || defined (BSD)
4382 +#if defined (__APPLE__) || defined (FREEBSD)
4384 -#elif defined (__linux__)
4385 +#elif defined (linux)
4387 -#elif defined (__sun__)
4388 +#elif defined (sun)
4389 #define USE_CLONE_DEVICE "/dev/ptmx"
4390 #elif defined (_AIX)
4391 #define USE_CLONE_DEVICE "/dev/ptc"
4392 @@ -1399,7 +1403,7 @@
4393 desc->slave_fd = open (desc->slave_name, O_RDWR, 0);
4396 -#if defined (__sun__) || defined (__hpux__)
4397 +#if defined (sun) || defined (__hpux__)
4398 /* On systems such as Solaris we are using stream. We need to push the right
4399 "modules" in order to get the expected terminal behaviors. Otherwise
4400 functionalities such as termios are not available. */
4402 +++ gcc/ada/traceback_symbolic.c
4405 + Copyright (C) 1999 by Juergen Pfeifer <juergen.pfeifer@gmx.net>
4406 + Ada for Linux Team (ALT)
4407 + Heavily modified by John Marino <http://www.dragonlace.net>
4409 + Permission is hereby granted, free of charge, to any person obtaining a
4410 + copy of this software and associated documentation files (the
4411 + "Software"), to deal in the Software without restriction, including
4412 + without limitation the rights to use, copy, modify, merge, publish,
4413 + distribute, distribute with modifications, sublicense, and/or sell
4414 + copies of the Software, and to permit persons to whom the Software is
4415 + furnished to do so, subject to the following conditions:
4417 + The above copyright notice and this permission notice shall be included
4418 + in all copies or substantial portions of the Software.
4420 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4421 + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4422 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
4423 + IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4424 + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4425 + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
4426 + THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4428 + Except as contained in this notice, the name(s) of the above copyright
4429 + holders shall not be used in advertising or otherwise to promote the
4430 + sale, use or other dealings in this Software without prior written
4438 + * Running addr2line doesn't make sense for cross-compiled objects.
4439 + * Create a dummy function to satisfy g-trasym.o
4443 +convert_addresses (const char *file_name ATTRIBUTE_UNUSED,
4444 + void *addrs ATTRIBUTE_UNUSED,
4445 + int n_addr ATTRIBUTE_UNUSED,
4446 + void *buf ATTRIBUTE_UNUSED,
4447 + int *len ATTRIBUTE_UNUSED)
4456 + * use the external program /usr/bin/addr2line to convert addresses
4457 + * into file names and line numbers
4460 +#include <sys/types.h>
4461 +#include <stdlib.h>
4462 +#include <unistd.h>
4463 +#include <string.h>
4464 +#include <signal.h>
4466 +#define CLOSE_SENDPIPE close(sendpipe[0]); close(sendpipe[1])
4467 +#define CLOSE_READPIPE close(readpipe[0]); close(readpipe[1])
4468 +#define DUP2CLOSE(oldfd, newfd) dup2(oldfd, newfd); close(oldfd);
4469 +#define RESTSIG sigaction(SIGPIPE,&oact,NULL)
4471 +#define MAX_LINE 1024
4472 +#define PARENT_READ readpipe[0]
4473 +#define CHILD_WRITE readpipe[1]
4474 +#define CHILD_READ sendpipe[0]
4475 +#define PARENT_WRITE sendpipe[1]
4477 +#if defined (__sun__)
4478 +#define ADDR2LINE_PROG "/usr/gnu/bin/addr2line"
4480 +#define ADDR2LINE_PROG "/usr/bin/addr2line"
4484 +convert_addresses (const char *file_name,
4490 + int max_len = *len;
4493 + struct sigaction act, oact;
4495 + int sendpipe[2] = {-1,-1}, /* parent -> child */
4496 + readpipe[2] = {-1,-1}; /* parent <- child */
4499 + act.sa_handler = SIG_IGN;
4500 + sigemptyset(&act.sa_mask);
4502 + if (sigaction(SIGPIPE,&act,&oact) < 0)
4505 + if (pipe(sendpipe) < 0) { RESTSIG; return; }
4506 + if (pipe(readpipe) < 0) { CLOSE_SENDPIPE; RESTSIG; return; }
4507 + if ((childpid = fork()) < 0) {
4514 + if (childpid == 0) { /* child process */
4515 + close(PARENT_WRITE);
4516 + close(PARENT_READ);
4517 + if ((CHILD_READ != STDIN_FILENO) && (CHILD_WRITE != STDOUT_FILENO)) {
4518 + if ((CHILD_READ == STDOUT_FILENO) && (CHILD_WRITE == STDIN_FILENO)) {
4519 + const int temp_fd = dup(CHILD_WRITE);
4520 + close (CHILD_WRITE);
4521 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
4522 + DUP2CLOSE (temp_fd, STDOUT_FILENO);
4524 + else if ((CHILD_READ == STDIN_FILENO) && (CHILD_WRITE > 1)) {
4525 + DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
4527 + else if ((CHILD_READ > 1) && (CHILD_WRITE == STDOUT_FILENO)) {
4528 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
4530 + else if ((CHILD_READ > 1) && (CHILD_WRITE == STDIN_FILENO)) {
4531 + DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
4532 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
4535 + /* CHILD_READ >= 1 and CHILD_WRITE > 1 */
4536 + DUP2CLOSE (CHILD_READ, STDIN_FILENO);
4537 + DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
4540 + /* As pointed out by Florian Weimer to JP, it is a security threat to call
4541 + the script with a user defined environment and using the path. That
4542 + would be Trojans pleasure. Therefore the absolute path to addr2line
4543 + and an empty environment is used. That should be safe.
4545 + char *const argv[] = { "addr2line",
4547 + "--demangle=gnat",
4551 + char *const envp[] = { NULL };
4552 + if (execve(ADDR2LINE_PROG, argv, envp) < 0) {
4553 + close (CHILD_WRITE);
4554 + close (CHILD_READ);
4560 + /* Below this line is parent process */
4563 + char line[MAX_LINE + 1];
4566 + long *trace_address = addrs;
4568 + close(CHILD_WRITE);
4569 + close(CHILD_READ);
4571 + for(i=0; i < n_addr; i++) {
4572 + snprintf(hex,sizeof(hex),"%#lx\n",*trace_address);
4573 + write(PARENT_WRITE,hex,strlen(hex));
4574 + n = read(PARENT_READ,line,MAX_LINE);
4579 + /* We have approx. 16 additional chars for "%#lx in " clause.
4580 + We use this info to prevent a buffer overrun. */
4581 + if (n + 16 + (*len) > max_len)
4584 + p = strchr(line,'\n');
4588 + *len += snprintf(s, (max_len - (*len)), "%#lx in %s at %s",
4589 + *trace_address, line, p+1);
4592 + *len += snprintf(s, (max_len - (*len)), "%#lx at %s",
4593 + *trace_address, line);
4597 + trace_address += 1;
4599 + close (PARENT_WRITE);
4600 + close (PARENT_READ);
4605 --- gcc/ada/gcc-interface/Makefile.in.orig
4606 +++ gcc/ada/gcc-interface/Makefile.in
4607 @@ -1227,6 +1227,7 @@
4608 ifeq ($(strip $(filter-out arm% linux-androideabi,$(target_cpu) $(target_os))),)
4609 LIBGNAT_TARGET_PAIRS = \
4610 a-intnam.ads<a-intnam-linux.ads \
4611 + g-socthi.adb<g-socthi-bsd.adb \
4612 s-inmaop.adb<s-inmaop-posix.adb \
4613 s-intman.adb<s-intman-android.adb \
4614 s-linux.ads<s-linux-android.ads \
4615 @@ -1311,6 +1312,7 @@
4616 a-intnam.ads<a-intnam-solaris.ads \
4617 s-inmaop.adb<s-inmaop-posix.adb \
4618 s-intman.adb<s-intman-solaris.adb \
4619 + s-trasym.adb<s-trasym-bsd.adb \
4620 s-mudido.adb<s-mudido-affinity.adb \
4621 s-osinte.adb<s-osinte-solaris.adb \
4622 s-osinte.ads<s-osinte-solaris.ads \
4623 @@ -1347,6 +1349,8 @@
4624 EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
4627 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
4628 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
4629 THREADSLIB = -lposix4 -lthread
4630 MISCLIB = -lposix4 -lnsl -lsocket
4632 @@ -1495,10 +1499,45 @@
4633 LIBRARY_VERSION := $(LIB_VERSION)
4637 +ifeq ($(strip $(filter-out %86 linux-android,$(target_cpu) $(target_os))),)
4638 + LIBGNAT_TARGET_PAIRS = \
4639 + a-intnam.ads<a-intnam-linux.ads \
4640 + g-socthi.adb<g-socthi-bsd.adb \
4641 + s-inmaop.adb<s-inmaop-posix.adb \
4642 + s-intman.adb<s-intman-posix.adb \
4643 + s-linux.ads<s-linux-android.ads \
4644 + s-osinte.adb<s-osinte-android.adb \
4645 + s-osinte.ads<s-osinte-android.ads \
4646 + s-osprim.adb<s-osprim-posix.adb \
4647 + s-taprop.adb<s-taprop-posix.adb \
4648 + s-taspri.ads<s-taspri-posix.ads \
4649 + s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
4650 + $(ATOMICS_TARGET_PAIRS) \
4651 + $(X86_TARGET_PAIRS) \
4652 + system.ads<system-linux-x86.ads
4654 + TOOLS_TARGET_PAIRS = \
4655 + mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
4656 + indepsw.adb<indepsw-gnu.adb
4658 + EXTRA_LIBGNAT_OBJS=
4659 + EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
4660 + EXTRA_GNATRTL_NONTASKING_OBJS=
4665 + GNATLIB_SHARED = gnatlib-shared-dual
4666 + LIBRARY_VERSION := $(LIB_VERSION)
4670 ifeq ($(strip $(filter-out %aarch64 freebsd%,$(target_cpu) $(target_os))),)
4671 LIBGNAT_TARGET_PAIRS = \
4672 a-intnam.ads<a-intnam-freebsd.ads \
4673 + g-socthi.adb<g-socthi-bsd.adb \
4674 + s-trasym.adb<s-trasym-bsd.adb \
4675 s-inmaop.adb<s-inmaop-posix.adb \
4676 s-intman.adb<s-intman-posix.adb \
4677 s-mudido.adb<s-mudido-affinity.adb \
4678 @@ -1516,6 +1555,9 @@
4679 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
4680 GNATLIB_SHARED = gnatlib-shared-dual
4682 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
4683 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
4686 THREADSLIB= -lpthread
4688 @@ -1527,6 +1569,8 @@
4689 ifeq ($(strip $(filter-out %86 freebsd%,$(target_cpu) $(target_os))),)
4690 LIBGNAT_TARGET_PAIRS = \
4691 a-intnam.ads<a-intnam-freebsd.ads \
4692 + g-socthi.adb<g-socthi-bsd.adb \
4693 + s-trasym.adb<s-trasym-bsd.adb \
4694 s-inmaop.adb<s-inmaop-posix.adb \
4695 s-intman.adb<s-intman-posix.adb \
4696 s-mudido.adb<s-mudido-affinity.adb \
4697 @@ -1544,6 +1588,8 @@
4698 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
4699 GNATLIB_SHARED = gnatlib-shared-dual
4701 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
4702 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
4703 EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
4706 @@ -1557,6 +1603,8 @@
4707 ifeq ($(strip $(filter-out %86_64 freebsd%,$(target_cpu) $(target_os))),)
4708 LIBGNAT_TARGET_PAIRS = \
4709 a-intnam.ads<a-intnam-freebsd.ads \
4710 + g-socthi.adb<g-socthi-bsd.adb \
4711 + s-trasym.adb<s-trasym-bsd.adb \
4712 s-inmaop.adb<s-inmaop-posix.adb \
4713 s-intman.adb<s-intman-posix.adb \
4714 s-mudido.adb<s-mudido-affinity.adb \
4715 @@ -1574,6 +1622,8 @@
4716 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
4717 GNATLIB_SHARED = gnatlib-shared-dual
4719 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
4720 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
4721 EXTRA_GNATRTL_NONTASKING_OBJS += g-sse.o g-ssvety.o
4724 @@ -1587,6 +1637,8 @@
4725 ifeq ($(strip $(filter-out %86_64 dragonfly%,$(target_cpu) $(target_os))),)
4726 LIBGNAT_TARGET_PAIRS = \
4727 a-intnam.ads<a-intnam-dragonfly.ads \
4728 + g-socthi.adb<g-socthi-bsd.adb \
4729 + s-trasym.adb<s-trasym-bsd.adb \
4730 s-inmaop.adb<s-inmaop-posix.adb \
4731 s-intman.adb<s-intman-posix.adb \
4732 s-mudido.adb<s-mudido-affinity.adb \
4733 @@ -1604,6 +1656,8 @@
4734 mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
4735 GNATLIB_SHARED = gnatlib-shared-dual
4737 + EXTRA_LIBGNAT_SRCS+= traceback_symbolic.c
4738 + EXTRA_LIBGNAT_OBJS+= traceback_symbolic.o
4739 EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
4742 --- gcc/ada/gcc-interface/Make-lang.in.orig
4743 +++ gcc/ada/gcc-interface/Make-lang.in
4747 # Language-independent object files.
4748 -ADA_BACKEND = $(BACKEND) attribs.o
4749 +ADA_BACKEND = $(BACKEND2) attribs.o
4751 # List of target dependent sources, overridden below as necessary
4753 --- gcc/ada/init.c.orig
4755 @@ -2541,8 +2541,15 @@
4757 mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
4759 +#if defined (__i386__)
4760 + unsigned long *pc = (unsigned long *)mcontext->gregs[REG_EIP];
4761 + /* The pattern is "orl $0x0,(%esp)" for a probe in 32-bit mode. */
4762 + if (signo == SIGSEGV && pc && *pc == 0x00240c83)
4763 + mcontext->gregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long);
4764 +#elif defined (__ARMEL__)
4765 /* ARM Bump has to be an even number because of odd/even architecture. */
4766 - ((mcontext_t *) mcontext)->arm_pc += 2;
4767 + mcontext->arm_pc += 2;
4774 [FILE:19397:patches/patch-diff-ada-testsuite]
4775 --- gcc/testsuite/ada/acats/run_acats.sh.orig
4776 +++ gcc/testsuite/ada/acats/run_acats.sh
4781 -# Provide which replacement.
4783 -# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
4784 -# ksh93 and bash have it.
4785 -# type output format differs between ksh88 and ksh93, so avoid it if
4786 -# type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type.
4787 -# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
4790 - path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
4791 - path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
4792 - path=`whence $* 2>/dev/null` && { echo $path; return 0; }
4796 # Set up environment to use the Ada compiler from the object tree
4798 --- gcc/testsuite/ada/acats/run_all.sh.orig
4799 +++ gcc/testsuite/ada/acats/run_all.sh
4802 # End of customization section.
4804 -# Perform arithmetic evaluation on the ARGs, and store the result in the
4805 -# global $as_val. Take advantage of shells that can avoid forks. The arguments
4806 -# must be portable across $(()) and expr.
4807 -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
4808 - eval 'as_fn_arith ()
4815 - as_val=`expr "$@" || test $? -eq 1`
4821 printf "$@" >> $dir/acats.sum
4823 echo "$@" >> $dir/acats.log
4827 + printf "%04d %7s" $1 $2
4836 if [ "$dir" = "$testdir" ]; then
4838 gnatls -v >> $dir/acats.log
4841 -if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
4842 - dir_support=$dir/../acats/support
4845 - mv $dir/tests $dir/tests.$$ 2> /dev/null
4846 - rm -rf $dir/tests.$$ &
4849 - cp -pr $dir/../acats/tests $dir/
4851 - dir_support=$dir/support
4853 display " === acats support ==="
4854 display_noeol "Generating support files..."
4863 display " === acats tests ==="
4865 if [ $# -eq 0 ]; then
4866 @@ -228,14 +206,20 @@
4875 for chapter in $chapters; do
4876 - # Used to generate support once and finish after that.
4877 - [ "$chapter" = "NONE" ] && continue
4878 + if [ -d $dir/tests/$chapter ]; then
4879 + cd $dir/tests/$chapter
4880 + ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
4881 + cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
4882 + > $dir/tests/$chapter/${chapter}.lst
4883 + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
4884 + countdown=`expr $countdown + $countn`
4888 +for chapter in $chapters; do
4889 display Running chapter $chapter ...
4891 if [ ! -d $dir/tests/$chapter ]; then
4892 @@ -244,45 +228,11 @@
4896 - cd $dir/tests/$chapter
4897 - ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
4898 - cut -c1-7 | sort | uniq | comm -23 - $dir_support/norun.lst \
4899 - > $dir/tests/$chapter/${chapter}.lst
4900 countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
4901 - as_fn_arith $glob_countn + $countn
4902 - glob_countn=$as_val
4903 + glob_countn=`expr $glob_countn + $countn`
4905 for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
4907 - # If running multiple run_all.sh jobs in parallel, decide
4908 - # if we should run this test in the current instance.
4909 - if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
4911 - # Ugh, some tests have inter-test dependencies, those
4912 - # tests have to be scheduled on the same parallel instance
4913 - # as previous test.
4914 - ce2108f | ce2108h | ce3112d) ;;
4915 - # All others can be hopefully scheduled freely.
4917 - as_fn_arith $par_countm + 1
4918 - par_countm=$as_val
4919 - [ $par_countm -eq 10 ] && par_countm=0
4920 - if [ $par_countm -eq 1 ]; then
4921 - as_fn_arith $par_count + 1
4923 - if mkdir $GCC_RUNTEST_PARALLELIZE_DIR/$par_count 2>/dev/null; then
4930 - if [ -z "$par_last" ]; then
4931 - as_fn_arith $glob_countn - 1
4932 - glob_countn=$as_val
4937 + counti=`expr $counti + 1`
4938 extraflags="-gnat95"
4939 grep $i $testdir/overflow.lst > /dev/null 2>&1
4940 if [ $? -eq 0 ]; then
4941 @@ -300,10 +250,13 @@
4942 if [ $? -eq 0 ]; then
4943 extraflags="$extraflags -fstack-check"
4945 + inform $countdown $i
4946 + countdown=`expr $countdown - 1`
4947 test=$dir/tests/$chapter/$i
4948 mkdir $test && cd $test >> $dir/acats.log 2>&1
4950 if [ $? -ne 0 ]; then
4953 failed="${failed}${i} "
4955 @@ -321,19 +274,22 @@
4956 echo "BUILD $main" >> $dir/acats.log
4959 - cxb30*) EXTERNAL_OBJECTS="$dir_support/cxb30040.o $dir_support/cxb30060.o $dir_support/cxb30130.o $dir_support/cxb30131.o";;
4960 + cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
4961 ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
4962 ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
4963 + cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
4965 if [ "$main" = "" ]; then
4968 failed="${failed}${i} "
4973 - target_gnatmake $extraflags -I$dir_support $main >> $dir/acats.log 2>&1
4974 + target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
4975 if [ $? -ne 0 ]; then
4978 failed="${failed}${i} "
4981 target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
4982 cd $dir/tests/$chapter/$i
4983 cat ${i}.log >> $dir/acats.log
4985 egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
4986 if [ $? -ne 0 ]; then
4987 grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
4988 @@ -357,15 +314,12 @@
4989 failed="${failed}${i} "
4991 log "UNSUPPORTED: $i"
4992 - as_fn_arith $glob_countn - 1
4993 - glob_countn=$as_val
4994 - as_fn_arith $glob_countu + 1
4995 - glob_countu=$as_val
4996 + glob_countn=`expr $glob_countn - 1`
4997 + glob_countu=`expr $glob_countu + 1`
5001 - as_fn_arith $glob_countok + 1
5002 - glob_countok=$as_val
5003 + glob_countok=`expr $glob_countok + 1`
5008 +++ gcc/testsuite/ada/acats/run_remote.sh
5011 +# Run ACATS with the GNU Ada compiler
5013 +# The following functions are to be customized if you run in cross
5014 +# environment or want to change compilation flags. Note that for
5015 +# tests requiring checks not turned on by default, this script
5016 +# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
5018 +# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
5019 +# gnatflags="-gnatN"
5022 +gnatflags="-gnatws"
5023 +tabtarget="/data/local/testsuite"
5024 +STRIP="@REMOTE_TARGET@-strip"
5027 + # Run on rooted tablet (port 22 vs port 2222)
5029 + $STRIP_FOR_TARGET $*
5030 + /usr/bin/scp -qp $* root@tablet:$tabtarget/
5031 + /usr/bin/ssh -q tablet $tabtarget/$BN
5035 + /usr/bin/ssh -q tablet "$1"
5038 +# End of customization section.
5042 + printf "$@" >> $dir/acats.sum
5043 + printf "$@" >> $dir/acats.log
5048 + echo "$@" >> $dir/acats.sum
5049 + echo "$@" >> $dir/acats.log
5053 + echo "$@" >> $dir/acats.sum
5054 + echo "$@" >> $dir/acats.log
5058 + printf "%04d %7s" $1 $2
5065 +dir=`${PWDCMD-pwd}`
5067 +if [ "$testdir" = "" ]; then
5068 + echo You must use make check or make check-ada
5072 +if [ "$dir" = "$testdir" ]; then
5073 + echo "error: srcdir must be different than objdir, exiting."
5077 +target_gnatmake () {
5078 + echo gnatmake-cross --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\" -fPIE -pie
5079 + gnatmake-cross --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC" -fPIE -pie
5087 + rm -f "$binmain" *.o *.ali > /dev/null 2>&1
5091 + ls ${i}?.adb > ${i}.lst 2> /dev/null
5092 + ls ${i}*m.adb >> ${i}.lst 2> /dev/null
5093 + ls ${i}.adb >> ${i}.lst 2> /dev/null
5094 + main=`tail -1 ${i}.lst`
5098 + local mysplit=`echo $1 | awk -F/ '{print "section=" $1 "; TN=" $2 "; prog=" $3 ";"}'`
5102 +EXTERNAL_OBJECTS=""
5103 +# Global variable to communicate external objects to link with.
5105 +rm -f $dir/acats.sum $dir/acats.log $dir/transfer.lst
5107 +display "Test Run By $USER on `date`"
5109 +display " === acats configuration ==="
5111 +target=`$GCC -dumpmachine`
5113 +display target gcc is $GCC
5114 +display `$GCC -v 2>&1`
5115 +display host=`gcc -dumpmachine`
5116 +display target=$target
5117 +display `type gnatmake-cross`
5118 +gnatls-cross -v >> $dir/acats.log
5121 +# Let's be tidy and clear off the remote device first
5122 +target_cmd "cd ${tabtarget}; rm logs/*; rmdir logs; rm *"
5124 +display " === acats support ==="
5125 +display_noeol "Generating support files..."
5127 +rm -rf $dir/support
5128 +mkdir -p $dir/support
5131 +cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
5133 +# Find out the size in bit of an address on the target
5134 +target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
5135 +target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
5136 +target_bit=`cat $dir/support/impbit.out`
5137 +echo target_bit="$target_bit" >> $dir/acats.log
5139 +# Find out a suitable asm statement
5140 +# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
5142 + ia64*-*-* | s390*-*-*)
5143 + target_insn="nop 0"
5146 + target_insn="swym 0"
5152 +echo target_insn="$target_insn" >> $dir/acats.log
5154 +sed -e "s,ACATS4GNATDIR,$dir,g" \
5155 + < $testdir/support/impdef.a > $dir/support/impdef.a
5156 +sed -e "s,ACATS4GNATDIR,$dir,g" \
5157 + -e "s,ACATS4GNATBIT,$target_bit,g" \
5158 + -e "s,ACATS4GNATINSN,$target_insn,g" \
5159 + < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
5160 +sed -e "s,ACATS4GNATDIR,$dir,g" \
5161 + < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
5163 +cp $testdir/tests/cd/*.c $dir/support
5164 +cp $testdir/tests/cxb/*.c $dir/support
5165 +grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
5168 +mv $dir/tests $dir/tests.$$ 2> /dev/null
5169 +rm -rf $dir/tests.$$ &
5172 +cp -pr $testdir/tests $dir/
5174 +for i in $dir/support/*.ada $dir/support/*.a; do
5175 + host_gnatchop $i >> $dir/acats.log 2>&1
5178 +# These tools are used to preprocess some ACATS sources
5179 +# they need to be compiled native on the host.
5181 +host_gnatmake -q -gnatws macrosub.adb
5182 +if [ $? -ne 0 ]; then
5183 + display "**** Failed to compile macrosub"
5186 +./macrosub > macrosub.out 2>&1
5189 +host_gnatmake -q -gnatws widechr.adb
5190 +if [ $? -ne 0 ]; then
5191 + display "**** Failed to compile widechr"
5194 +./widechr > widechr.out 2>&1
5196 +rm -f $dir/support/macrosub
5197 +rm -f $dir/support/widechr
5198 +rm -f $dir/support/*.ali
5199 +rm -f $dir/support/*.o
5203 +# From here, all compilations will be made by the target compiler
5205 +display_noeol "Compiling support files..."
5208 +if [ $? -ne 0 ]; then
5209 + display "**** Failed to compile C code"
5213 +host_gnatchop *.adt >> $dir/acats.log 2>&1
5215 +target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
5216 +target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
5220 +display " === acats tests ==="
5222 +if [ $# -eq 0 ]; then
5223 + chapters=`cd $dir/tests; echo [a-z]*`
5233 +for chapter in $chapters; do
5234 + if [ -d $dir/tests/$chapter ]; then
5235 + cd $dir/tests/$chapter
5236 + ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
5237 + cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
5238 + > $dir/tests/$chapter/${chapter}.lst
5239 + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
5240 + countdown=`expr $countdown + $countn`
5244 +cat > $dir/execute.sh << EOF
5246 + printf "left: %04d" \$1
5253 + local total=\$(echo \$testlist | awk '{print NF}')
5255 + echo "Executing \$total tests on remote device"
5257 + for x in \$testlist; do
5258 + timeout -t 30 ./\${x} > logs/\${x}.log 2>&1
5259 + countx=\$(expr \$countx + 1)
5260 + if [ \$countx -eq 25 ]; then
5261 + total=\$(expr \$total - 25)
5268 + tar -czf remote.logs.tar.gz logs
5273 +display "All tests are being cross-compiled without execution first."
5275 +for chapter in $chapters; do
5276 + if [ ! -d $dir/tests/$chapter ]; then
5280 + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
5281 + glob_countn=`expr $glob_countn + $countn`
5283 + for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
5284 + counti=`expr $counti + 1`
5285 + extraflags="-gnat95"
5286 + grep $i $testdir/overflow.lst > /dev/null 2>&1
5287 + if [ $? -eq 0 ]; then
5288 + extraflags="$extraflags -gnato"
5290 + grep $i $testdir/elabd.lst > /dev/null 2>&1
5291 + if [ $? -eq 0 ]; then
5292 + extraflags="$extraflags -gnatE"
5294 + grep $i $testdir/floatstore.lst > /dev/null 2>&1
5295 + if [ $? -eq 0 ]; then
5296 + extraflags="$extraflags -ffloat-store"
5298 + grep $i $testdir/stackcheck.lst > /dev/null 2>&1
5299 + if [ $? -eq 0 ]; then
5300 + extraflags="$extraflags -fstack-check"
5302 + inform $countdown $i
5303 + countdown=`expr $countdown - 1`
5304 + test=$dir/tests/$chapter/$i
5305 + mkdir $test && cd $test >> $dir/acats.log 2>&1
5307 + if [ $? -ne 0 ]; then
5309 + display "FAIL: $i"
5310 + failed="${failed}${i} "
5315 + host_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
5317 + if [ -z "$main" ]; then
5321 + binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
5322 + echo "BUILD $main" >> $dir/acats.log
5323 + EXTERNAL_OBJECTS=""
5325 + cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
5326 + ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
5327 + ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
5328 + cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
5330 + if [ "$main" = "" ]; then
5332 + display "FAIL: $i"
5333 + failed="${failed}${i} "
5338 + target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
5339 + if [ $? -ne 0 ]; then
5341 + display "FAIL: $i"
5342 + failed="${failed}${i} "
5346 + echo $chapter/$i/$binmain >> $dir/transfer.lst
5347 + echo "$binmain \\" >> $dir/execute.sh
5352 +echo '"' >> $dir/execute.sh
5353 +echo "cycle" >> $dir/execute.sh
5356 +display "Transfer files to remote device: root@tablet:$tabtarget/"
5358 +cat $dir/transfer.lst | xargs tar --strip-components=2 -czf - | \
5359 + target_cmd "tar -C $tabtarget -xzf -"
5361 +tar -czf - execute.sh | target_cmd "tar -C $tabtarget -xzf -"
5362 +target_cmd "cd $tabtarget; sh execute.sh"
5363 +rm -rf $dir/logs $dir/remote.logs.tar.gz
5364 +/usr/bin/scp -q root@tablet:$tabtarget/remote.logs.tar.gz $dir/
5365 +tar -xzf $dir/remote.logs.tar.gz
5367 +countdown=`wc -l < $dir/transfer.lst`
5368 +glob_countn=${countdown}
5369 +for i in `cat $dir/transfer.lst`; do
5371 + if [ "$section" != "$savedsect" ]; then
5372 + display Running chapter $section ...
5374 + savedsect=$section
5376 + #inform $countdown $TN
5377 + countdown=`expr $countdown - 1`
5378 + proglog="$dir/logs/${prog}.log"
5379 + echo "RUN $prog" >> $dir/acats.log
5380 + if [ ! -f $proglog ]; then
5381 + echo "LOG NOT FOUND!" >> $proglog
5384 + cat $proglog >> $dir/acats.log
5386 + egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' $proglog > /dev/null 2>&1
5387 + if [ $? -ne 0 ]; then
5388 + grep 'tasking not implemented' $proglog > /dev/null 2>&1
5390 + if [ $? -ne 0 ]; then
5391 + display "FAIL: ${TN}"
5392 + failed="${failed}${TN} "
5394 + log "UNSUPPORTED: ${TN}"
5395 + glob_countn=`expr $glob_countn - 1`
5396 + glob_countu=`expr $glob_countu + 1`
5400 + glob_countok=`expr $glob_countok + 1`
5402 + cd $dir/tests/$section/$TN
5407 +display " === acats Summary ==="
5408 +display "# of expected passes $glob_countok"
5409 +display "# of unexpected failures `expr $glob_countn - $glob_countok`"
5411 +if [ $glob_countu -ne 0 ]; then
5412 + display "# of unsupported tests $glob_countu"
5415 +if [ $glob_countok -ne $glob_countn ]; then
5416 + display "*** FAILURES: $failed"
5419 +display "$0 completed at `date`"
5422 --- gcc/testsuite/gnat.dg/test_raise_from_pure.adb.orig
5423 +++ gcc/testsuite/gnat.dg/test_raise_from_pure.adb
5426 +-- { dg-do run { xfail *-*-openbsd* } }
5427 -- { dg-options "-O2" }
5429 -- This is an optimization test and its failure is only a missed optimization.
5430 --- gcc/testsuite/gnat.dg/unchecked_convert5.adb.orig
5431 +++ gcc/testsuite/gnat.dg/unchecked_convert5.adb
5433 --- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
5435 -with Unchecked_Conversion;
5437 -procedure Unchecked_Convert5 is
5439 - subtype c_1 is string(1..1);
5441 - function int2c1 is -- { dg-warning "different sizes" }
5442 - new unchecked_conversion (source => integer, target => c_1);
5448 - c1 := int2c1(16#12#);
5450 - if c1 (1) /= ASCII.Nul then
5451 - raise Program_Error;
5455 --- gcc/testsuite/gnat.dg/unchecked_convert6.adb.orig
5456 +++ gcc/testsuite/gnat.dg/unchecked_convert6.adb
5458 --- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
5460 -with Unchecked_Conversion;
5462 -procedure Unchecked_Convert6 is
5464 - subtype c_5 is string(1..5);
5466 - function int2c5 is -- { dg-warning "different sizes" }
5467 - new unchecked_conversion (source => integer, target => c_5);
5473 - c5 := int2c5(16#12#);
5475 - if c5 (4) /= ASCII.DC2 then
5476 - raise Program_Error;
5482 [FILE:11341:patches/patch-diff-core]
5483 --- gcc/config/dragonfly.h.orig
5484 +++ gcc/config/dragonfly.h
5487 %{static:-Bstatic} \
5489 - %{!static:--hash-style=gnu} \
5490 + %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib} \
5491 %{symbolic:-Bsymbolic}"
5494 #define LINK_SPEC DFBSD_LINK_SPEC
5496 -#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
5497 +#define DFBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.2"
5500 /* Use --as-needed -lgcc_s for eh support. */
5501 --- gcc/config/aarch64/aarch64-freebsd.h.orig
5502 +++ gcc/config/aarch64/aarch64-freebsd.h
5504 %{symbolic:-Bsymbolic} \
5505 %{static:-Bstatic} \
5507 + %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib} \
5508 %{rdynamic:-export-dynamic} \
5509 %{!shared:-dynamic-linker " FBSD_DYNAMIC_LINKER " }} \
5510 -X" SUBTARGET_EXTRA_LINK_SPEC " \
5513 #define MCOUNT_NAME ".mcount"
5515 +/* Static stack checking is supported by means of probes. */
5516 +#define STACK_CHECK_STATIC_BUILTIN 1
5517 #endif /* GCC_AARCH64_FREEBSD_H */
5518 --- gcc/config/i386/freebsd.h.orig
5519 +++ gcc/config/i386/freebsd.h
5521 %{rdynamic:-export-dynamic} \
5522 -dynamic-linker %(fbsd_dynamic_linker) } \
5523 %{static:-Bstatic}} \
5524 + %{!static:--hash-style=gnu --enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib} \
5525 %{symbolic:-Bsymbolic}"
5527 /* A C statement to output to the stdio stream FILE an assembler
5528 --- gcc/config/i386/freebsd64.h.orig
5529 +++ gcc/config/i386/freebsd64.h
5531 %{rdynamic:-export-dynamic} \
5532 -dynamic-linker %(fbsd_dynamic_linker) } \
5533 %{static:-Bstatic}} \
5534 + %{!static:--hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib} \
5535 %{symbolic:-Bsymbolic}"
5536 --- gcc/Makefile.in.orig
5538 @@ -1200,7 +1200,6 @@
5546 @@ -1597,6 +1596,7 @@
5547 $(OBJS-libcommon-target) main.o c-family/cppspec.o \
5548 $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
5549 $(GCOV_TOOL_OBJS) $(GENGTYPE_OBJS) gcc-ar.o gcc-nm.o gcc-ranlib.o \
5550 + insn-modes.o insn-modes-ada.o \
5551 lto-wrapper.o collect-utils.o
5553 # for anything that is shared use the cc1plus profile data, as that
5554 @@ -1612,6 +1612,11 @@
5555 ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
5557 BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \
5559 + $(CPPLIB) $(LIBDECNUMBER)
5561 +BACKEND2 = libbackend.a main.o libcommon-target.a libcommon.a \
5562 + insn-modes-ada.o \
5563 $(CPPLIB) $(LIBDECNUMBER)
5565 # This is defined to "yes" if Tree checking is enabled, which roughly means
5566 @@ -2312,6 +2317,7 @@
5568 insn-modes.c: s-modes; @true
5569 insn-modes.h: s-modes-h; @true
5570 +insn-modes-ada.c: s-modes-ada; @true
5571 min-insn-modes.c: s-modes-m; @true
5573 s-modes: build/genmodes$(build_exeext)
5574 @@ -2329,6 +2335,12 @@
5575 $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
5578 +s-modes-ada: s-modes
5579 + $(shell sed -e 's/: TARGET_96_ROUND_53_LONG_DOUBLE \? &ieee_extended_intel_96_round_53_format //' \
5580 + < insn-modes.c > tmp-modes-ada.c)
5581 + $(SHELL) $(srcdir)/../move-if-change tmp-modes-ada.c insn-modes-ada.c
5582 + $(STAMP) s-modes-ada
5584 insn-preds.c: s-preds; @true
5585 tm-preds.h: s-preds-h; @true
5586 tm-constrs.h: s-constrs-h; @true
5587 @@ -3536,6 +3548,9 @@
5588 ( cd $(DESTDIR)$(bindir) && \
5589 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \
5591 + if [ -f gnat1$(exeext) ] ; then \
5592 + ( cd $(DESTDIR)$(bindir) && $(LN) $(GCC_INSTALL_NAME)$(exeext) ada$(exeext) ) \
5594 if [ ! -f gcc-cross$(exeext) ] \
5595 && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
5596 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
5597 --- gcc/config/i386/gnu-user64.h.orig
5598 +++ gcc/config/i386/gnu-user64.h
5600 %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
5601 %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
5603 + %{!static:--enable-new-dtags -rpath @PREFIX@/@GCCAUX@/lib64} \
5606 %{rdynamic:-export-dynamic} \
5607 --- gcc/dwarf2out.c.orig
5609 @@ -12514,6 +12514,15 @@
5611 if (qualified_type == dtype)
5613 + tree origin = decl_ultimate_origin (name);
5615 + /* Typedef variants that have an abstract origin don't get their own
5616 + type DIE (see gen_typedef_die), so fall back on the ultimate
5617 + abstract origin instead. */
5618 + if (origin != NULL)
5619 + return modified_type_die (TREE_TYPE (origin), cv_quals, reverse,
5622 /* For a named type, use the typedef. */
5623 gen_type_die (qualified_type, context_die);
5624 return lookup_type_die (qualified_type);
5625 @@ -24346,7 +24355,7 @@
5626 gen_typedef_die (tree decl, dw_die_ref context_die)
5628 dw_die_ref type_die;
5632 if (TREE_ASM_WRITTEN (decl))
5634 @@ -24355,75 +24364,71 @@
5638 + /* As we avoid creating DIEs for local typedefs (see decl_ultimate_origin
5639 + checks in process_scope_var and modified_type_die), this should be called
5640 + only for original types. */
5641 + gcc_assert (decl_ultimate_origin (decl) == NULL);
5643 TREE_ASM_WRITTEN (decl) = 1;
5644 type_die = new_die (DW_TAG_typedef, context_die, decl);
5645 - origin = decl_ultimate_origin (decl);
5646 - if (origin != NULL)
5647 - add_abstract_origin_attribute (type_die, origin);
5650 + add_name_and_src_coords_attributes (type_die, decl);
5651 + if (DECL_ORIGINAL_TYPE (decl))
5653 - tree type = TREE_TYPE (decl);
5654 + type = DECL_ORIGINAL_TYPE (decl);
5655 + if (type == error_mark_node)
5658 + gcc_assert (type != TREE_TYPE (decl));
5659 + equate_type_number_to_die (TREE_TYPE (decl), type_die);
5663 + type = TREE_TYPE (decl);
5664 if (type == error_mark_node)
5667 - add_name_and_src_coords_attributes (type_die, decl);
5668 - if (DECL_ORIGINAL_TYPE (decl))
5669 + if (is_naming_typedef_decl (TYPE_NAME (type)))
5671 - type = DECL_ORIGINAL_TYPE (decl);
5673 - if (type == error_mark_node)
5676 - gcc_assert (type != TREE_TYPE (decl));
5677 - equate_type_number_to_die (TREE_TYPE (decl), type_die);
5678 + /* Here, we are in the case of decl being a typedef naming
5679 + an anonymous type, e.g:
5680 + typedef struct {...} foo;
5681 + In that case TREE_TYPE (decl) is not a typedef variant
5682 + type and TYPE_NAME of the anonymous type is set to the
5683 + TYPE_DECL of the typedef. This construct is emitted by
5686 + TYPE is the anonymous struct named by the typedef
5687 + DECL. As we need the DW_AT_type attribute of the
5688 + DW_TAG_typedef to point to the DIE of TYPE, let's
5689 + generate that DIE right away. add_type_attribute
5690 + called below will then pick (via lookup_type_die) that
5691 + anonymous struct DIE. */
5692 + if (!TREE_ASM_WRITTEN (type))
5693 + gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
5695 + /* This is a GNU Extension. We are adding a
5696 + DW_AT_linkage_name attribute to the DIE of the
5697 + anonymous struct TYPE. The value of that attribute
5698 + is the name of the typedef decl naming the anonymous
5699 + struct. This greatly eases the work of consumers of
5700 + this debug info. */
5701 + add_linkage_name_raw (lookup_type_die (type), decl);
5705 - if (is_naming_typedef_decl (TYPE_NAME (type)))
5707 - /* Here, we are in the case of decl being a typedef naming
5708 - an anonymous type, e.g:
5709 - typedef struct {...} foo;
5710 - In that case TREE_TYPE (decl) is not a typedef variant
5711 - type and TYPE_NAME of the anonymous type is set to the
5712 - TYPE_DECL of the typedef. This construct is emitted by
5715 - TYPE is the anonymous struct named by the typedef
5716 - DECL. As we need the DW_AT_type attribute of the
5717 - DW_TAG_typedef to point to the DIE of TYPE, let's
5718 - generate that DIE right away. add_type_attribute
5719 - called below will then pick (via lookup_type_die) that
5720 - anonymous struct DIE. */
5721 - if (!TREE_ASM_WRITTEN (type))
5722 - gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
5724 - /* This is a GNU Extension. We are adding a
5725 - DW_AT_linkage_name attribute to the DIE of the
5726 - anonymous struct TYPE. The value of that attribute
5727 - is the name of the typedef decl naming the anonymous
5728 - struct. This greatly eases the work of consumers of
5729 - this debug info. */
5730 - add_linkage_name_raw (lookup_type_die (type), decl);
5734 - add_type_attribute (type_die, type, decl_quals (decl), false,
5738 - if (is_naming_typedef_decl (decl))
5739 - /* We want that all subsequent calls to lookup_type_die with
5740 - TYPE in argument yield the DW_TAG_typedef we have just
5742 - equate_type_number_to_die (type, type_die);
5743 + add_type_attribute (type_die, type, decl_quals (decl), false,
5746 - type = TREE_TYPE (decl);
5747 + if (is_naming_typedef_decl (decl))
5748 + /* We want that all subsequent calls to lookup_type_die with
5749 + TYPE in argument yield the DW_TAG_typedef we have just
5751 + equate_type_number_to_die (type, type_die);
5753 - add_alignment_attribute (type_die, type);
5754 + add_alignment_attribute (type_die, TREE_TYPE (decl));
5756 - add_accessibility_attribute (type_die, decl);
5758 + add_accessibility_attribute (type_die, decl);
5760 if (DECL_ABSTRACT_P (decl))
5761 equate_decl_number_to_die (decl, type_die);
5762 @@ -24535,15 +24540,23 @@
5763 if (TREE_ASM_WRITTEN (type))
5766 + tree name = TYPE_NAME (type);
5767 + tree origin = decl_ultimate_origin (name);
5768 + if (origin != NULL)
5770 + gen_decl_die (origin, NULL, NULL, context_die);
5774 /* Prevent broken recursion; we can't hand off to the same type. */
5775 - gcc_assert (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) != type);
5776 + gcc_assert (DECL_ORIGINAL_TYPE (name) != type);
5778 /* Give typedefs the right scope. */
5779 context_die = scope_die_for (type, context_die);
5781 TREE_ASM_WRITTEN (type) = 1;
5783 - gen_decl_die (TYPE_NAME (type), NULL, NULL, context_die);
5784 + gen_decl_die (name, NULL, NULL, context_die);
5788 @@ -24862,6 +24875,22 @@
5792 + /* Avoid creating DIEs for local typedefs and concrete static variables that
5793 + will only be pruned later. */
5794 + if ((origin || decl_ultimate_origin (decl))
5795 + && (TREE_CODE (decl_or_origin) == TYPE_DECL
5796 + || (VAR_P (decl_or_origin) && TREE_STATIC (decl_or_origin))))
5798 + origin = decl_ultimate_origin (decl_or_origin);
5799 + if (decl && VAR_P (decl) && die != NULL)
5801 + die = lookup_decl_die (origin);
5803 + equate_decl_number_to_die (decl, die);
5808 if (die != NULL && die->die_parent == NULL)
5809 add_child_die (context_die, die);
5810 else if (TREE_CODE (decl_or_origin) == IMPORTED_DECL)
5813 [FILE:1498:patches/patch-diff-cxx]
5814 --- libstdc++-v3/configure.host.orig
5815 +++ libstdc++-v3/configure.host
5818 os_include_dir="os/bsd/freebsd"
5821 + os_include_dir="os/bionic"
5824 os_include_dir="os/generic"
5826 --- libstdc++-v3/config/os/bionic/ctype_base.h.orig
5827 +++ libstdc++-v3/config/os/bionic/ctype_base.h
5829 // Non-standard typedefs.
5830 typedef const int* __to_type;
5833 +#define _U _CTYPE_U
5834 +#define _L _CTYPE_L
5835 +#define _D _CTYPE_D
5836 +#define _S _CTYPE_S
5837 +#define _P _CTYPE_P
5838 +#define _C _CTYPE_C
5839 +#define _X _CTYPE_X
5840 +#define _B _CTYPE_B
5841 +#define _N _CTYPE_D
5844 // NB: Offsets into ctype<char>::_M_table force a particular size
5845 // on the mask type. Because of this, we don't use an enum.
5847 --- libstdc++-v3/src/c++11/futex.cc.orig
5848 +++ libstdc++-v3/src/c++11/futex.cc
5850 #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
5854 +#include <sys/syscall.h>
5856 #include <syscall.h>
5859 #include <sys/time.h>
5861 --- libstdc++-v3/src/filesystem/dir.cc.orig
5862 +++ libstdc++-v3/src/filesystem/dir.cc
5863 @@ -146,7 +146,13 @@
5865 int err = std::exchange(errno, 0);
5866 const auto entp = readdir(dirp);
5868 + int tmperr = errno;
5872 std::swap(errno, err);
5879 [FILE:1612:patches/patch-diff-gcc-testsuite]
5880 --- gcc/testsuite/gcc.dg/format/ext-1.c.orig
5881 +++ gcc/testsuite/gcc.dg/format/ext-1.c
5886 -foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
5887 +foo (quad2_t q, u_quad2_t uq, quad2_t *qn, size_t z, size_t *zn, long long int ll,
5888 unsigned long long int ull, int i, unsigned int u, double d,
5889 char *s, void *p, wchar_t *ls, wint_t lc, int *n, long int l)
5891 --- gcc/testsuite/gcc.dg/format/ext-2.c.orig
5892 +++ gcc/testsuite/gcc.dg/format/ext-2.c
5897 -foo (quad_t *qp, u_quad_t *uqp, quad_t *qn, long long int *llp,
5898 +foo (quad2_t *qp, u_quad2_t *uqp, quad2_t *qn, long long int *llp,
5899 unsigned long long int *ullp, float *fp, char *s, void **pp, wchar_t *ls,
5900 int *ip, unsigned int *up)
5902 --- gcc/testsuite/gcc.dg/format/format.h.orig
5903 +++ gcc/testsuite/gcc.dg/format/format.h
5907 /* %q formats want a "quad"; GCC considers this to be a long long. */
5908 -typedef llong quad_t;
5909 -typedef ullong u_quad_t;
5910 +typedef llong quad2_t;
5911 +typedef ullong u_quad2_t;
5913 __extension__ typedef __INTMAX_TYPE__ intmax_t;
5914 __extension__ typedef __UINTMAX_TYPE__ uintmax_t;
5915 --- gcc/testsuite/gcc.dg/pch/pch.exp.orig
5916 +++ gcc/testsuite/gcc.dg/pch/pch.exp
5918 set test "largefile.c"
5919 set testh "largefile.hs"
5920 set f [open $test w]
5921 +puts $f "/* { dg-do run { target *-*-solaris* } } */"
5922 +puts $f "/* { dg-error \"dummy\" \"fool dejagnu\" { target { ! *-*-solaris* } 20 } } */"
5923 puts $f "/* { dg-timeout-factor 4.0 } */"
5925 for { set v 0 } { $v < 10000 } { incr v } {