aboutsummaryrefslogtreecommitdiff
path: root/libgcc
AgeCommit message (Collapse)AuthorFilesLines
2022-05-03Daily bump.GCC Administrator1-0/+4
2022-05-02libgcov: add ATTRIBUTE_UNUSED for dump_stringMartin Liska1-0/+1
Mitigates the following clang warning: libgcc/libgcov-driver.c:416:1: warning: unused function 'dump_string' [-Wunused-function] libgcc/ChangeLog: * libgcov-driver.c: Add ATTRIBUTE_UNUSED.
2022-04-29Daily bump.GCC Administrator1-0/+65
2022-04-28gcov: Use xstrerror()Sebastian Huber1-2/+2
libgcc/ * libgcov-util.c (ftw_read_file): Improve notice using xstrerror(). (gcov_profile_merge_stream): Likewise.
2022-04-28gcov-tool: Add merge-stream subcommandSebastian Huber1-0/+95
gcc/ * doc/gcov-tool.texi: Document merge-stream subcommand. * doc/invoke.texi (fprofile-info-section): Mention merge-stream subcommand of gcov-tool. * gcov-tool.cc (gcov_profile_merge_stream): Declare. (print_merge_stream_usage_message): New. (merge_stream_usage): Likewise. (do_merge_stream): Likewise. (print_usage): Call print_merge_stream_usage_message(). (main): Call do_merge_stream() to execute merge-stream subcommand. libgcc/ * libgcov-util.c (consume_stream): New. (get_target_profiles_for_merge): Likewise. (gcov_profile_merge_stream): Likewise.
2022-04-28gcov: Fix integer types in ftw_read_file()Sebastian Huber1-2/+2
libgcc/ * libgcov-util.c (ftw_read_file): Use size_t for strlen() variables.
2022-04-28gcov: Move gcov_open() to caller of read_gcda_file()Sebastian Huber1-9/+7
This allows to reuse read_gcda_file() to read multiple objects from a single file. libgcc/ * libgcov-util.c (read_gcda_file): Do not open file. (ftw_read_file): Open file here.
2022-04-28gcov: Move prepend to list to read_gcda_file()Sebastian Huber1-7/+4
This helps to reuse read_gcda_file(). libgcc/ * libgcov-util.c (read_gcda_file): Prepend new info object to global list. (ftw_read_file): Remove list append here.
2022-04-28gcov: Use xstrdup()Sebastian Huber1-7/+2
Move duplication of filename to caller and use xstrdup() instead of custom code. This helps to reuse read_gcda_file() for other purposes. libgcc/ * libgcov-util.c (read_gcda_file): Do not duplicate filename. (ftw_read_file): Duplicate filename for read_gcda_file().
2022-04-28gcov: Add __gcov_filename_to_gcfn()Sebastian Huber2-2/+47
gcc/ * doc/invoke.texi (fprofile-info-section): Mention __gcov_filename_to_gcfn(). Use "freestanding" to match with C11 standard language. Fix minor example code issues. * gcov-io.h (GCOV_FILENAME_MAGIC): Define and document. gcc/testsuite/ * gcc.dg/gcov-info-to-gcda.c: Test __gcov_filename_to_gcfn(). libgcc/ * gcov.h (__gcov_info_to_gcda): Mention __gcov_filename_to_gcfn(). (__gcov_filename_to_gcfn): Declare and document. * libgcov-driver.c (dump_string): New. (__gcov_filename_to_gcfn): Likewise. (__gcov_info_to_gcda): Adjust comment to match C11 standard language.
2022-04-28gcov: Make gcov_seek() staticSebastian Huber1-2/+0
This function is only used by gcov_write_length() in the gcov-io.cc file. gcc/ * gcov-io.cc (gcov_seek): Make it static. * gcov-io.h (struct gcov_summary): Do not mention gcov_seek(). libgcc/ * libgcov.h (gcov_seek): Remove define and declaration.
2022-04-28gcov: Add open mode parameter to gcov_do_dump()Sebastian Huber2-9/+10
gcc/ * gcov-tool.cc (gcov_do_dump): Add mode parameter. (gcov_output_files): Open files for reading and writing. libgcc/ * libgcov-driver-system.c (gcov_exit_open_gcda_file): Add mode parameter. Pass mode to gcov_open() calls. * libgcov-driver.c (dump_one_gcov): Add mode parameter. Pass mode to gcov_exit_open_gcda_file() call. (gcov_do_dump): Add mode parameter. Pass mode to dump_one_gcov() calls. (__gcov_dump_one): Open file for reading and writing.
2022-04-28gcov: Add mode to all gcov_open()Sebastian Huber3-4/+3
gcc/ * gcov-io.cc (gcov_open): Always use the mode parameter. * gcov-io.h (gcov_open): Declare it unconditionally. libgcc/ * libgcov-driver-system.c (gcov_exit_open_gcda_file): Open file for reading and writing. * libgcov-util.c (read_gcda_file): Open file for reading. * libgcov.h (gcov_open): Delete declaration.
2022-04-28gcov-tool: Allow merging of empty profile listsSebastian Huber1-8/+11
The gcov_profile_merge() already had code to deal with profile information which had no counterpart to merge with. For profile information from files with no associated counterpart, the profile information is simply used as is with the weighting transformation applied. Make sure that gcov_profile_merge() works with an empty target profile list. Return the merged profile list. gcc/ * gcov-tool.cc (gcov_profile_merge): Adjust return type. (profile_merge): Allow merging of directories which contain no profile files. libgcc/ * libgcov-util.c (gcov_profile_merge): Return the list of merged profiles. Accept empty target and source profile lists.
2022-04-09Daily bump.GCC Administrator1-0/+4
2022-04-08libgcc: IA64: don't compile glibc-based unwinder without libc headersSergei Trofimovich1-0/+2
In --without-headers mode gcc fails to bootstrap on libgcc as: /build/build/./gcc/xgcc -B/build/build/./gcc/ ... -Dinhibit_libc -c fde-glibc.c ../../../gcc-12-20220403/libgcc/config/ia64/fde-glibc.c:33:10: fatal error: stdlib.h: No such file or directory Most other linux targets are able to build the --without-headers compiler without additional effort. This change adds IA64 to the fold. The change drops part of the code that relies on DYNAMIC glibc section traversal for backtraces. Tested bootstrap of ia64-unknown-linux-gnu with and without libc headers present. libgcc/ * config/ia64/fde-glibc.c: Make a no-op in inhibit_libc mode.
2022-03-30Daily bump.GCC Administrator1-0/+18
2022-03-29LoongArch Port: Regenerate libgcc/configure.chenglulu1-1/+4
2022-03-29 Chenghua Xu <xuchenghua@loongson.cn> Lulu Cheng <chenglulu@loongson.cn> libgcc/ChangeLog: * configure: Regenerate file.
2022-03-29LoongArch Port: libgccchenglulu9-2/+328
2022-03-29 Chenghua Xu <xuchenghua@loongson.cn> Lulu Cheng <chenglulu@loongson.cn> libgcc/ChangeLog: * config/loongarch/crtfastmath.c: New file. * config/loongarch/linux-unwind.h: Like wise. * config/loongarch/sfp-machine.h: Like wise. * config/loongarch/t-crtstuff: Like wise. * config/loongarch/t-loongarch: Like wise. * config/loongarch/t-loongarch64: Like wise. * config/loongarch/t-softfp-tf: Like wise. * config.host: Add LoongArch tuples. * configure.ac: Add LoongArch support.
2022-03-20Daily bump.GCC Administrator1-0/+8
2022-03-19libgcc: m68k: avoid TEXTRELs in shared library (PR 86224)Sergei Trofimovich1-5/+14
libgcc/ PR libgcc/86224 * config/m68k/lb1sf68.S (__mulsi3_internal): Internal, hidden alias for __mulsi3. (__udivsi3_internal, __divsi3_internal): Similarly. (__umodsi3, __modsi3): Use the internal function names.
2022-03-10Daily bump.GCC Administrator1-0/+8
2022-03-09GCN: Implement __atomic_compare_exchange_{1,2} in libgcc [PR102215]Tobias Burnus1-1/+28
libgcc/ChangeLog: PR target/102215 * config/gcn/atomic.c (__sync_val_compare_and_swap_##SIZE): Move a line up to non-arg-dependent value first. (__ATOMIC_COMPARE_EXCHANGE): Define + call to generate __atomic_compare_exchange_{1,2}.
2022-03-05Daily bump.GCC Administrator1-0/+5
2022-03-04Darwin, libgcc: Fix build errors on powerpc-darwin8.Iain Sandoe2-3/+3
PowerPC Darwin8 is the last version to use an unwind frame fallback routine. This had been omitted from the new shared EH library, along with one more header dependency that only fires there. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> libgcc/ChangeLog: * config/rs6000/t-darwin-ehs: Add darwin-fallback.o. * config/t-darwin-ehs: Add dependency on unwind.h.
2022-02-25Daily bump.GCC Administrator1-0/+11
2022-02-25libgcc: fix a warning calling find_fde_tailXi Ruoyao1-1/+1
The third parameter of find_fde_tail is an _Unwind_Ptr (which is an integer type instead of a pointer), but we are passing NULL to it. This causes a -Wint-conversion warning. libgcc/ * unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Call find_fde_tail with 0 instead of NULL.
2022-02-24bpf: do not --enable-gcov for bpf-*-* targetsJose E. Marchesi2-17/+31
This patch changes the build machinery in order to disable the build of GCOV (both compiler and libgcc) in bpf-*-* targets. The reason for this change is that BPF is (currently) too restricted in order to support the coverage instrumentalization. Tested in bpf-unknown-none and x86_64-linux-gnu targets. 2022-02-23 Jose E. Marchesi <jose.marchesi@oracle.com> gcc/ChangeLog PR target/104656 * configure.ac: --disable-gcov if targetting bpf-*. * configure: Regenerate. libgcc/ChangeLog PR target/104656 * configure.ac: --disable-gcov if targetting bpf-*. * configure: Regenerate.
2022-01-26Daily bump.GCC Administrator1-0/+5
2022-01-25libgcc: Fix _Unwind_Find_FDE for missing unwind data with glibc 2.35Florian Weimer1-1/+1
_dl_find_object returns success even if no unwind information has been found, and dlfo_eh_frame is NULL. libgcc/ChangeLog: PR libgcc/104207 * unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Add NULL check.
2022-01-18Daily bump.GCC Administrator1-0/+4
2022-01-17Manual changes for .cc renaming.Martin Liska1-1/+1
gcc/ChangeLog: * Makefile.in: Rename .c names to .cc. * config.gcc: Likewise. * configure: Regenerate. Likewise. * configure.ac: Likewise. * gengtype.cc (set_gc_used): Likewise. (source_dot_c_frul): Likewise. (source_dot_cc_frul): Likewise. (struct file_rule_st): Likewise. (close_output_files): Likewise. * config/avr/t-avr: Use CXXFLAGS_* and CXX_FOR_BUILD. gcc/ada/ChangeLog: * Makefile.rtl: Rename .c names to .cc. * gcc-interface/Make-lang.in: Likewise. * gcc-interface/Makefile.in: Likewise. libgcc/ChangeLog: * libgcov-driver.c: Rename .c names to .cc. libcpp/ChangeLog: * Makefile.in: Rename .c names to .cc.
2022-01-16Daily bump.GCC Administrator1-0/+7
2022-01-15libgcc: Fix __gthr_i486_lock_cmp_xchg clobber for WindowsJonathan Yong2-23/+2
2022-01-14 David <gccbugzilla@limegreensocks.com> libgcc/ * config/i386/gthr-win32.c (__gthr_i486_lock_cmp_xchg): Remove inlined version, Windows 95 is no longer relevant. * config/i386/gthr-win32.h (__GTHREAD_I486_INLINE_LOCK_PRIMITIVES): unset.
2022-01-15Daily bump.GCC Administrator1-0/+5
2022-01-14arc: Add DWARF2 alternate CFA column.Claudiu Zissulescu1-4/+5
Add DWARF 2 CFA column which tracks the return address from a signal handler context. This value must not correspond to a hard register and must be out of the range of DWARF_FRAME_REGNUM(). gcc/ * config/arc/arc.h (DWARF_FRAME_REGNUM): Update definition. (DWARF_FRAME_RETURN_COLUMN): Use RETURN_ADDR_REGNUM macro. (INCOMING_RETURN_ADDR_RTX): Likewise. (DWARF_ALT_FRAME_RETURN_COLUMN): Define. gcc/testsuite/ * gcc.target/arc/cancel-1.c: New file. libgcc/ * config/arc/linux-unwind.h (arc_fallback_frame_state): Use DWARF_ALT_FRAME_RETURN_COLUMN macro. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2022-01-05Daily bump.GCC Administrator1-0/+5
2022-01-04libgcc: Use _dl_find_object in _Unwind_Find_FDEFlorian Weimer1-0/+18
libgcc/ChangeLog: * unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Call _dl_find_object if available.
2022-01-03Update copyright years.Jakub Jelinek1064-1064/+1064
2022-01-03Update Copyright in ChangeLog filesJakub Jelinek2-2/+2
Do this separately from all other Copyright updates, as ChangeLog files can be modified only separately.
2022-01-03Daily bump.GCC Administrator1-0/+7
2022-01-02Generate illegal instruction fault if LWS syscall returns -EFAULT.John David Anglin1-0/+6
2022-01-02 John David Anglin <danglin@gcc.gnu.org> libgcc/ChangeLog: * config/pa/linux-atomic.c (_ASM_EFAULT): Define. (__kernel_cmpxchg): Nullify illegal iitlbp instruction if error return is not equal _ASM_EFAULT. (__kernel_cmpxchg2): Likewise.
2021-12-18Daily bump.GCC Administrator1-0/+11
2021-12-17libgcc, Darwin: Add missing build dependencies.Iain Sandoe4-7/+12
There was a race condition where the link for the new shared EH library (only used on earlier Darwin) could fail because the new crts had not been copied to the gcc directory. This can cause a build failure (although currently only seen on powerpc-darwin). Fixed by adding specific dependency on the crts and on the multi target. We also add the declaration header for the Darwin10 unwinder shim to the powerpc cases, since we build that there for Rosetta use. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> libgcc/ChangeLog: * config.host: Add shim declaration header to powerpc*-darwin builds. * config/rs6000/t-darwin-ehs: Remove dependency on the powerpc end file. * config/t-darwin-ehs: Add dependencies to the shared unwinder objects. * config/t-slibgcc-darwin: Add extra_parts to the dependencies for the shared EH lib. Add all-multi to the dependencies for the libgcc_s.1.dylib redirections.
2021-12-14Daily bump.GCC Administrator1-0/+33
2021-12-13Remove ppc*-vxworks7* inadequate libgcc Makefile fragmentsOlivier Hainque1-1/+1
t-linux assigns .so version numbers to a set of symbols, some of which aren't included the VxWorks libgcc on powerpc (from ibm-ldouble.c, in particular). t-slibgcc-libgcc yields a kind of .so file that the default loader can't handle. This sort of extension to tmake_file for shared libs will be better handled in a grouped fashion for all targets anyway. 2021-12-13 Olivier Hainque <hainque@adacore.com> * config.host (powerpc*-*-vxworks7*): Remove rs6000/t-linux and t-slibgcc-libgcc from tmake_file.
2021-12-13Remove special case for arm-vxworks on the use of vxcrtstuffOlivier Hainque1-4/+1
Not needed any more after the recent cleanups issued for the support of shared libraries. 2021-12-13 Olivier Hainque <hainque@adacore.com> libgcc/ * config.host (*vxworks*): Remove special case for arm on the use of vxcrtstuff.
2021-12-13Tigthen libc_internal and crtstuff for VxWorks shared objectsFrederic Konrad2-5/+81
This change tightens and documents the use of libc_internal, then strengthens the VxWorks crtstuff objects for the support of shared libraries. In particular: - Define __dso_handle, which libstdc++.so requires, - Provide _init and _fini functions to run through the init/fini arrays for shared libs in configurations which HAVE_INITFINI_ARRAY_SUPPORT. The init/fini functions are provided by libc_internal.a for static links but with slightly different names and we don't want to risk dragging other libc_internal contents in the closure accidentally so make sure we don't link with it. As for the !vxworks crtstuff, the new shared libs specific bits are conditioned by a CRTSTUFFS_O macro, for which we provide new Makefile fragment. The bits to actually use the fragment and the shared objects will be added by a forthcoming change, as part of a more general configury update for shared libs. The change also adds guards the eh table registration code in vxcrtstuff so the objects can be used for either init/fini or eh tables independently. 2021-12-07 Fred Konrad <konrad@adacore.com> Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (VXWORKS_BASE_LIBS_RTP): Guard -lc_internal on !shared+!non-static and document. (VXWORKS_LIB_SPEC): Remove the bits intended to drag the init/fini functions from libc_internal in the shared lib case. (VX_CRTBEGIN_SPEC/VX_CRTEND_SPEC): Use vxcrtstuff objects also in configurations with shared lib and INITFINI_ARRAY support. libgcc/ * config/t-vxcrtstuffS: New Makefile fragment. * config/vxcrtstuff.c: Provide __dso_handle. Provide _init/_fini functions for INITFINI_ARRAY support in shared libs and guard the definition of eh table registration functions on conditions indicating they are needed.
2021-12-13Preserve cpu specific CRTSTUFF_T_CFLAGS on powerpc-vxworks7Olivier Hainque2-2/+5
The unconditional assignment performed in t-vxworks to handle include flags currently overrides what specific cpu ports had for the regular (!vxworks) crtstuff objects. This was not done on purpose and the proposed change adjusts the configuration bits to apply the vxworks specific flags on top of the cpu ones instead. 2021-12-07 Olivier Hainque <hainque@adacore.com> * config.host (powerpc*-wrs-vxworks7*): Place t-crtstuff ahead of the other files in tmake_files. * config/t-vxworks: Add to CRTSTUFF_T_CFLAGS instead of overriding it.
2021-12-13Leverage sysroot for VxWorksOlivier Hainque3-29/+3
The build of a VxWorks toolchain relies a lot on system headers and VxWorks has a few very specific features that require special processing. For example, different sets of headers for the kernel vs the rtp modes, which the compiler knows about by way of -mrtp on the command line. If we manage to avoid the need for fixincludes on recent versions of VxWorks (>= 7), we still need to handle at least VxWorks 6.9 at this stage. We sort of get away with locating the correct headers at run-time thanks to environment variables and various tests for -mrtp in cpp specs, but getting fixincludes to work for old configurations has always been tricky and getting a toolchain to build with c++/libstdc++ support gets trickier with every move to a more recent release. sysroot_headers_suffix_spec is a pretty powerful device to help address such issues, and this patch introduces changes that let us get advantage of it. The general idea is to leverage the assumption that compilations occur with --sysroot=$VSB_DIR on vx7 or --sysroot=$WIND_BASE/target prior to that. For the toolchains we build, this is achieved with a few configure options like: --with-sysroot --with-build-sysroot=${WIND_BASE}/target --with-specs=%{!sysroot=*:--sysroot=%:getenv(WIND_BASE /target)} This also allows simplifying the libgcc compilation flags control and we take the opportunity to merge t-vxworks7 into t-vxworks as the two files were differing only on the libgcc2 flags part. 2021-12-09 Olivier Hainque <hainque@adacore.com> gcc/ * config/t-vxworks: Clear NATIVE_SYSTEM_HEADER_DIR. * config/vxworks.h (SYSROOT_HEADERS_SUFFIX_SPEC): Define, for VxWorks 7 and earlier. (VXWORKS_ADDITIONAL_CPP_SPEC): Simplify accordingly. (STARTFILE_PREFIX_SPEC): Adjust accordingly. * config/rs6000/vxworks.h (STARTFILE_PREFIX_SPEC): Adjust. libgcc/ * config/t-vxworks (LIBGCC2_INCLUDES): Simplify and handle both VxWorks7 and earlier. * config/t-vxworks7: Remove. * config.host: Remove special case for vxworks7.