gcov: update to version 12.2.0

Issue #4827
This commit is contained in:
Christian Prochaska 2023-04-23 20:10:52 +02:00 committed by Christian Helmuth
parent b8c80c9570
commit 106e322f82
11 changed files with 168 additions and 141 deletions

View File

@ -14,12 +14,11 @@ SRC_CC = diagnostic.cc \
memory-block.cc \ memory-block.cc \
pretty-print.cc \ pretty-print.cc \
sort.cc \ sort.cc \
vec.cc \ vec.cc
version.cc
CC_OPT += -DIN_GCC CC_OPT += -DIN_GCC
CC_OPT_version += -DBASEVER="\"10.3.0\"" \ CC_OPT_version += -DBASEVER="\"12.2.0\"" \
-DDATESTAMP="\"\"" \ -DDATESTAMP="\"\"" \
-DREVISION="\"\"" \ -DREVISION="\"\"" \
-DDEVPHASE="\"\"" \ -DDEVPHASE="\"\"" \

View File

@ -4,6 +4,7 @@ GCOV_DIR := $(GCOV_PORT_DIR)/src/gcov
SRC_CC = charset.cc \ SRC_CC = charset.cc \
errors.cc \ errors.cc \
files.cc \
line-map.cc line-map.cc
LIBS += libc stdcxx LIBS += libc stdcxx

View File

@ -1 +1 @@
3da457023a91c4f0f272ab61fffdaf6e69eb173f 3bff79f2db28091aac97c3b9a8388193efc568c7

View File

@ -1,58 +1,59 @@
LICENSE := GPLv2 LICENSE := GPLv2
VERSION := 10.3.0 VERSION := 12.2.0
DOWNLOADS := gcov.archive generated.git DOWNLOADS := gcov.archive generated.git
URL(gcov) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.xz URL(gcov) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.xz
SHA(gcov) := 64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344 SHA(gcov) := e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
DIR(gcov) := src/gcov DIR(gcov) := src/gcov
SIG(gcov) := ${URL(gcov)} SIG(gcov) := ${URL(gcov)}
KEY(gcov) := GNU KEY(gcov) := GNU
URL(generated) := https://github.com/cproc/genode-generated.git URL(generated) := https://github.com/cproc/genode-generated.git
REV(generated) := de10bc1a61aed36a0c8ed923bbeb2777d1e3b844 REV(generated) := fed75b0ff503c1860df423c22a6980c65e1be01c
DIR(generated) := include DIR(generated) := include
TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
gcc-$(VERSION)/gcc/color-macros.h \ gcc-$(VERSION)/gcc/color-macros.h \
gcc-$(VERSION)/gcc/coretypes.h \ gcc-$(VERSION)/gcc/coretypes.h \
gcc-$(VERSION)/gcc/defaults.h \ gcc-$(VERSION)/gcc/defaults.h \
gcc-$(VERSION)/gcc/diagnostic.c \ gcc-$(VERSION)/gcc/diagnostic.cc \
gcc-$(VERSION)/gcc/diagnostic-color.c \ gcc-$(VERSION)/gcc/diagnostic-color.cc \
gcc-$(VERSION)/gcc/diagnostic-color.h \ gcc-$(VERSION)/gcc/diagnostic-color.h \
gcc-$(VERSION)/gcc/diagnostic-core.h \ gcc-$(VERSION)/gcc/diagnostic-core.h \
gcc-$(VERSION)/gcc/diagnostic-event-id.h \ gcc-$(VERSION)/gcc/diagnostic-event-id.h \
gcc-$(VERSION)/gcc/diagnostic-metadata.h \ gcc-$(VERSION)/gcc/diagnostic-metadata.h \
gcc-$(VERSION)/gcc/diagnostic-path.h \ gcc-$(VERSION)/gcc/diagnostic-path.h \
gcc-$(VERSION)/gcc/diagnostic-show-locus.c \ gcc-$(VERSION)/gcc/diagnostic-show-locus.cc \
gcc-$(VERSION)/gcc/diagnostic-url.h \ gcc-$(VERSION)/gcc/diagnostic-url.h \
gcc-$(VERSION)/gcc/diagnostic.def \ gcc-$(VERSION)/gcc/diagnostic.def \
gcc-$(VERSION)/gcc/diagnostic.h \ gcc-$(VERSION)/gcc/diagnostic.h \
gcc-$(VERSION)/gcc/double-int.h \ gcc-$(VERSION)/gcc/double-int.h \
gcc-$(VERSION)/gcc/dumpfile.h \ gcc-$(VERSION)/gcc/dumpfile.h \
gcc-$(VERSION)/gcc/edit-context.h \ gcc-$(VERSION)/gcc/edit-context.h \
gcc-$(VERSION)/gcc/edit-context.c \ gcc-$(VERSION)/gcc/edit-context.cc \
gcc-$(VERSION)/gcc/fixed-value.h \ gcc-$(VERSION)/gcc/fixed-value.h \
gcc-$(VERSION)/gcc/flag-types.h \ gcc-$(VERSION)/gcc/flag-types.h \
gcc-$(VERSION)/gcc/gcc-rich-location.h \ gcc-$(VERSION)/gcc/gcc-rich-location.h \
gcc-$(VERSION)/gcc/gcov.c \ gcc-$(VERSION)/gcc/gcov.cc \
gcc-$(VERSION)/gcc/gcov-counter.def \ gcc-$(VERSION)/gcc/gcov-counter.def \
gcc-$(VERSION)/gcc/gcov-io.c \ gcc-$(VERSION)/gcc/gcov-io.cc \
gcc-$(VERSION)/gcc/gcov-io.h \ gcc-$(VERSION)/gcc/gcov-io.h \
gcc-$(VERSION)/gcc/ggc.h \ gcc-$(VERSION)/gcc/ggc.h \
gcc-$(VERSION)/gcc/ggc-none.c \ gcc-$(VERSION)/gcc/ggc-none.cc \
gcc-$(VERSION)/gcc/hash-map.h \ gcc-$(VERSION)/gcc/hash-map.h \
gcc-$(VERSION)/gcc/hash-map-traits.h \ gcc-$(VERSION)/gcc/hash-map-traits.h \
gcc-$(VERSION)/gcc/hash-set.h \ gcc-$(VERSION)/gcc/hash-set.h \
gcc-$(VERSION)/gcc/hash-table.c \ gcc-$(VERSION)/gcc/hash-table.cc \
gcc-$(VERSION)/gcc/hash-table.h \ gcc-$(VERSION)/gcc/hash-table.h \
gcc-$(VERSION)/gcc/hash-traits.h \ gcc-$(VERSION)/gcc/hash-traits.h \
gcc-$(VERSION)/gcc/hwint.h \ gcc-$(VERSION)/gcc/hwint.h \
gcc-$(VERSION)/gcc/inchash.h \ gcc-$(VERSION)/gcc/inchash.h \
gcc-$(VERSION)/gcc/input.c \ gcc-$(VERSION)/gcc/input.cc \
gcc-$(VERSION)/gcc/input.h \ gcc-$(VERSION)/gcc/input.h \
gcc-$(VERSION)/gcc/intl.c \ gcc-$(VERSION)/gcc/intl.cc \
gcc-$(VERSION)/gcc/intl.h \ gcc-$(VERSION)/gcc/intl.h \
gcc-$(VERSION)/gcc/is-a.h \ gcc-$(VERSION)/gcc/is-a.h \
gcc-$(VERSION)/gcc/iterator-utils.h \
gcc-$(VERSION)/gcc/json.cc \ gcc-$(VERSION)/gcc/json.cc \
gcc-$(VERSION)/gcc/json.h \ gcc-$(VERSION)/gcc/json.h \
gcc-$(VERSION)/gcc/machmode.h \ gcc-$(VERSION)/gcc/machmode.h \
@ -64,7 +65,7 @@ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
gcc-$(VERSION)/gcc/opts.h \ gcc-$(VERSION)/gcc/opts.h \
gcc-$(VERSION)/gcc/poly-int.h \ gcc-$(VERSION)/gcc/poly-int.h \
gcc-$(VERSION)/gcc/poly-int-types.h \ gcc-$(VERSION)/gcc/poly-int-types.h \
gcc-$(VERSION)/gcc/pretty-print.c \ gcc-$(VERSION)/gcc/pretty-print.cc \
gcc-$(VERSION)/gcc/pretty-print.h \ gcc-$(VERSION)/gcc/pretty-print.h \
gcc-$(VERSION)/gcc/profile-count.h \ gcc-$(VERSION)/gcc/profile-count.h \
gcc-$(VERSION)/gcc/real.h \ gcc-$(VERSION)/gcc/real.h \
@ -76,10 +77,8 @@ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
gcc-$(VERSION)/gcc/system.h \ gcc-$(VERSION)/gcc/system.h \
gcc-$(VERSION)/gcc/tsystem.h \ gcc-$(VERSION)/gcc/tsystem.h \
gcc-$(VERSION)/gcc/typed-splay-tree.h \ gcc-$(VERSION)/gcc/typed-splay-tree.h \
gcc-$(VERSION)/gcc/vec.c \ gcc-$(VERSION)/gcc/vec.cc \
gcc-$(VERSION)/gcc/vec.h \ gcc-$(VERSION)/gcc/vec.h \
gcc-$(VERSION)/gcc/version.c \
gcc-$(VERSION)/gcc/version.h \
gcc-$(VERSION)/gcc/wide-int.h \ gcc-$(VERSION)/gcc/wide-int.h \
gcc-$(VERSION)/gcc/wide-int-bitmask.h \ gcc-$(VERSION)/gcc/wide-int-bitmask.h \
gcc-$(VERSION)/gcc/wide-int-print.h \ gcc-$(VERSION)/gcc/wide-int-print.h \
@ -88,6 +87,14 @@ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
gcc-$(VERSION)/gcc/config/initfini-array.h \ gcc-$(VERSION)/gcc/config/initfini-array.h \
gcc-$(VERSION)/gcc/config/newlib-stdint.h \ gcc-$(VERSION)/gcc/config/newlib-stdint.h \
gcc-$(VERSION)/gcc/config/vxworks-dummy.h \ gcc-$(VERSION)/gcc/config/vxworks-dummy.h \
gcc-$(VERSION)/gcc/config/aarch64/aarch64-arches.def \
gcc-$(VERSION)/gcc/config/aarch64/aarch64-cores.def \
gcc-$(VERSION)/gcc/config/aarch64/aarch64-elf-raw.h \
gcc-$(VERSION)/gcc/config/aarch64/aarch64-elf.h \
gcc-$(VERSION)/gcc/config/aarch64/aarch64-errata.h \
gcc-$(VERSION)/gcc/config/aarch64/aarch64-opts.h \
gcc-$(VERSION)/gcc/config/aarch64/aarch64.h \
gcc-$(VERSION)/gcc/config/aarch64/biarchlp64.h \
gcc-$(VERSION)/gcc/config/arm/aout.h \ gcc-$(VERSION)/gcc/config/arm/aout.h \
gcc-$(VERSION)/gcc/config/arm/arm.h \ gcc-$(VERSION)/gcc/config/arm/arm.h \
gcc-$(VERSION)/gcc/config/arm/arm-flags.h \ gcc-$(VERSION)/gcc/config/arm/arm-flags.h \
@ -99,6 +106,7 @@ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
gcc-$(VERSION)/gcc/config/i386/biarch64.h \ gcc-$(VERSION)/gcc/config/i386/biarch64.h \
gcc-$(VERSION)/gcc/config/i386/i386elf.h \ gcc-$(VERSION)/gcc/config/i386/i386elf.h \
gcc-$(VERSION)/gcc/config/i386/i386.h \ gcc-$(VERSION)/gcc/config/i386/i386.h \
gcc-$(VERSION)/gcc/config/i386/i386-isa.def \
gcc-$(VERSION)/gcc/config/i386/i386-opts.h \ gcc-$(VERSION)/gcc/config/i386/i386-opts.h \
gcc-$(VERSION)/gcc/config/i386/stringop.def \ gcc-$(VERSION)/gcc/config/i386/stringop.def \
gcc-$(VERSION)/gcc/config/i386/unix.h \ gcc-$(VERSION)/gcc/config/i386/unix.h \
@ -114,14 +122,16 @@ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
gcc-$(VERSION)/include/obstack.h \ gcc-$(VERSION)/include/obstack.h \
gcc-$(VERSION)/include/safe-ctype.h \ gcc-$(VERSION)/include/safe-ctype.h \
gcc-$(VERSION)/include/splay-tree.h \ gcc-$(VERSION)/include/splay-tree.h \
gcc-$(VERSION)/libcpp/charset.c \ gcc-$(VERSION)/libcpp/charset.cc \
gcc-$(VERSION)/libcpp/errors.c \ gcc-$(VERSION)/libcpp/errors.cc \
gcc-$(VERSION)/libcpp/files.cc \
gcc-$(VERSION)/libcpp/internal.h \ gcc-$(VERSION)/libcpp/internal.h \
gcc-$(VERSION)/libcpp/line-map.c \ gcc-$(VERSION)/libcpp/line-map.cc \
gcc-$(VERSION)/libcpp/system.h \ gcc-$(VERSION)/libcpp/system.h \
gcc-$(VERSION)/libcpp/ucnid.h \ gcc-$(VERSION)/libcpp/ucnid.h \
gcc-$(VERSION)/libcpp/include/cpplib.h \ gcc-$(VERSION)/libcpp/include/cpplib.h \
gcc-$(VERSION)/libcpp/include/line-map.h \ gcc-$(VERSION)/libcpp/include/line-map.h \
gcc-$(VERSION)/libcpp/include/mkdeps.h \
gcc-$(VERSION)/libcpp/include/symtab.h \ gcc-$(VERSION)/libcpp/include/symtab.h \
gcc-$(VERSION)/libgcc/gthr.h \ gcc-$(VERSION)/libgcc/gthr.h \
gcc-$(VERSION)/libgcc/libgcov-driver.c \ gcc-$(VERSION)/libgcc/libgcov-driver.c \
@ -162,25 +172,3 @@ TAR_OPT(gcov) := gcc-$(VERSION)/gcc/align.h \
PATCHES := src/app/gcov/patches/*.patch \ PATCHES := src/app/gcov/patches/*.patch \
src/lib/gcov/patches/*.patch src/lib/gcov/patches/*.patch
PATCH_OPT := -p1 -d src/gcov PATCH_OPT := -p1 -d src/gcov
default: symlinks
#
# These .c files need to be compiled with g++
#
symlinks: $(DOWNLOADS)
$(VERBOSE)ln -s diagnostic-color.c ${DIR(gcov)}/gcc/diagnostic-color.cc
$(VERBOSE)ln -s diagnostic-show-locus.c ${DIR(gcov)}/gcc/diagnostic-show-locus.cc
$(VERBOSE)ln -s diagnostic.c ${DIR(gcov)}/gcc/diagnostic.cc
$(VERBOSE)ln -s edit-context.c ${DIR(gcov)}/gcc/edit-context.cc
$(VERBOSE)ln -s gcov.c ${DIR(gcov)}/gcc/gcov.cc
$(VERBOSE)ln -s ggc-none.c ${DIR(gcov)}/gcc/ggc-none.cc
$(VERBOSE)ln -s hash-table.c ${DIR(gcov)}/gcc/hash-table.cc
$(VERBOSE)ln -s input.c ${DIR(gcov)}/gcc/input.cc
$(VERBOSE)ln -s intl.c ${DIR(gcov)}/gcc/intl.cc
$(VERBOSE)ln -s pretty-print.c ${DIR(gcov)}/gcc/pretty-print.cc
$(VERBOSE)ln -s vec.c ${DIR(gcov)}/gcc/vec.cc
$(VERBOSE)ln -s version.c ${DIR(gcov)}/gcc/version.cc
$(VERBOSE)ln -s charset.c ${DIR(gcov)}/libcpp/charset.cc
$(VERBOSE)ln -s errors.c ${DIR(gcov)}/libcpp/errors.cc
$(VERBOSE)ln -s line-map.c ${DIR(gcov)}/libcpp/line-map.cc

View File

@ -4,14 +4,14 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
--- ---
gcc/diagnostic-show-locus.c | 2 ++ gcc/diagnostic-show-locus.cc | 2 ++
gcc/diagnostic.c | 11 ++++++++--- gcc/diagnostic.cc | 15 ++++++++++-----
2 files changed, 10 insertions(+), 3 deletions(-) 2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c diff --git a/gcc/diagnostic-show-locus.cc b/gcc/diagnostic-show-locus.cc
index 4618b4edb..6b15b0740 100644 index 6eafe19..7490241 100644
--- a/gcc/diagnostic-show-locus.c --- a/gcc/diagnostic-show-locus.cc
+++ b/gcc/diagnostic-show-locus.c +++ b/gcc/diagnostic-show-locus.cc
@@ -24,7 +24,9 @@ along with GCC; see the file COPYING3. If not see @@ -24,7 +24,9 @@ along with GCC; see the file COPYING3. If not see
#include "version.h" #include "version.h"
#include "demangle.h" #include "demangle.h"
@ -22,10 +22,10 @@ index 4618b4edb..6b15b0740 100644
#include "diagnostic.h" #include "diagnostic.h"
#include "diagnostic-color.h" #include "diagnostic-color.h"
#include "gcc-rich-location.h" #include "gcc-rich-location.h"
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index ed52bc03d..a5d949d14 100644 index 73324a7..ce14cac 100644
--- a/gcc/diagnostic.c --- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.c +++ b/gcc/diagnostic.cc
@@ -28,7 +28,9 @@ along with GCC; see the file COPYING3. If not see @@ -28,7 +28,9 @@ along with GCC; see the file COPYING3. If not see
#include "version.h" #include "version.h"
#include "demangle.h" #include "demangle.h"
@ -36,7 +36,7 @@ index ed52bc03d..a5d949d14 100644
#include "diagnostic.h" #include "diagnostic.h"
#include "diagnostic-color.h" #include "diagnostic-color.h"
#include "diagnostic-url.h" #include "diagnostic-url.h"
@@ -438,7 +440,7 @@ static const char * const bt_stop[] = @@ -521,7 +523,7 @@ static const char * const bt_stop[] =
}; };
/* A callback function passed to the backtrace_full function. */ /* A callback function passed to the backtrace_full function. */
@ -45,7 +45,7 @@ index ed52bc03d..a5d949d14 100644
static int static int
bt_callback (void *data, uintptr_t pc, const char *filename, int lineno, bt_callback (void *data, uintptr_t pc, const char *filename, int lineno,
const char *function) const char *function)
@@ -518,7 +520,7 @@ bt_err_callback (void *data ATTRIBUTE_UNUSED, const char *msg, int errnum) @@ -601,7 +603,7 @@ bt_err_callback (void *data ATTRIBUTE_UNUSED, const char *msg, int errnum)
fprintf (stderr, "%s%s%s\n", msg, errnum == 0 ? "" : ": ", fprintf (stderr, "%s%s%s\n", msg, errnum == 0 ? "" : ": ",
errnum == 0 ? "" : xstrerror (errnum)); errnum == 0 ? "" : xstrerror (errnum));
} }
@ -54,7 +54,7 @@ index ed52bc03d..a5d949d14 100644
/* Check if we've met the maximum error limit, and if so fatally exit /* Check if we've met the maximum error limit, and if so fatally exit
with a message. CONTEXT is the context to check, and FLUSH with a message. CONTEXT is the context to check, and FLUSH
indicates whether a diagnostic_finish call is needed. */ indicates whether a diagnostic_finish call is needed. */
@@ -573,14 +575,17 @@ diagnostic_action_after_output (diagnostic_context *context, @@ -656,14 +658,17 @@ diagnostic_action_after_output (diagnostic_context *context,
case DK_ICE: case DK_ICE:
case DK_ICE_NOBT: case DK_ICE_NOBT:
{ {
@ -73,3 +73,21 @@ index ed52bc03d..a5d949d14 100644
if (context->abort_on_error) if (context->abort_on_error)
real_abort (); real_abort ();
@@ -2027,7 +2032,7 @@ fancy_abort (const char *file, int line, const char *function)
fnotice (stderr, diagnostic_kind_text[DK_ICE]);
fnotice (stderr, "in %s, at %s:%d", function, trim_filename (file), line);
fputc ('\n', stderr);
-
+#if 0
/* Attempt to print a backtrace. */
struct backtrace_state *state
= backtrace_create_state (NULL, 0, bt_err_callback, NULL);
@@ -2035,7 +2040,7 @@ fancy_abort (const char *file, int line, const char *function)
if (state != NULL)
backtrace_full (state, 2, bt_callback, bt_err_callback,
(void *) &count);
-
+#endif
/* We can't call warn_if_plugins or emergency_dump_function as these
rely on GCC state that might not be initialized, or might be in
use by another thread. */

View File

@ -4,14 +4,14 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
--- ---
libcpp/charset.c | 4 +++- libcpp/charset.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-) 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libcpp/charset.c b/libcpp/charset.c diff --git a/libcpp/charset.cc b/libcpp/charset.cc
index d9281c5fb..e10cbc218 100644 index ca8b7cf..b76d0fa 100644
--- a/libcpp/charset.c --- a/libcpp/charset.cc
+++ b/libcpp/charset.c +++ b/libcpp/charset.cc
@@ -2350,9 +2350,10 @@ cpp_display_column_to_byte_column (const char *data, int data_length, @@ -2480,9 +2480,10 @@ cpp_display_column_to_byte_column (const char *data, int data_length,
are not highly optimized, but for the present purpose of outputting are not highly optimized, but for the present purpose of outputting
diagnostics, they are sufficient. */ diagnostics, they are sufficient. */
@ -23,7 +23,7 @@ index d9281c5fb..e10cbc218 100644
if (__builtin_expect (c <= wcwidth_range_ends[0], true)) if (__builtin_expect (c <= wcwidth_range_ends[0], true))
return wcwidth_widths[0]; return wcwidth_widths[0];
@@ -2376,5 +2377,6 @@ int cpp_wcwidth (cppchar_t c) @@ -2506,5 +2507,6 @@ int cpp_wcwidth (cppchar_t c)
if (__builtin_expect (begin != end, true)) if (__builtin_expect (begin != end, true))
return wcwidth_widths[begin]; return wcwidth_widths[begin];

View File

@ -4,13 +4,13 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
--- ---
gcc/gcov.c | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- gcc/gcov.cc | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 136 insertions(+), 9 deletions(-) 1 file changed, 137 insertions(+), 9 deletions(-)
diff --git a/gcc/gcov.c b/gcc/gcov.c diff --git a/gcc/gcov.cc b/gcc/gcov.cc
index a291bac3e..813c7e19b 100644 index 27be5ff..d97be16 100644
--- a/gcc/gcov.c --- a/gcc/gcov.cc
+++ b/gcc/gcov.c +++ b/gcc/gcov.cc
@@ -50,6 +50,8 @@ along with Gcov; see the file COPYING3. If not see @@ -50,6 +50,8 @@ along with Gcov; see the file COPYING3. If not see
#include <zlib.h> #include <zlib.h>
#include <getopt.h> #include <getopt.h>
@ -22,13 +22,13 @@ index a291bac3e..813c7e19b 100644
using namespace std; using namespace std;
@@ -58,6 +60,7 @@ using namespace std; @@ -58,6 +60,7 @@ using namespace std;
#include "gcov-io.h" #include "gcov-io.h"
#include "gcov-io.c" #include "gcov-io.cc"
+ +
/* The gcno file is generated by -ftest-coverage option. The gcda file is /* The gcno file is generated by -ftest-coverage option. The gcda file is
generated by a program compiled with -fprofile-arcs. Their formats generated by a program compiled with -fprofile-arcs. Their formats
are documented in gcov-io.h. */ are documented in gcov-io.h. */
@@ -507,6 +510,11 @@ static const char *bbg_cwd; @@ -535,6 +538,11 @@ static const char *bbg_cwd;
static char *da_file_name; static char *da_file_name;
@ -40,9 +40,9 @@ index a291bac3e..813c7e19b 100644
/* Data file is missing. */ /* Data file is missing. */
static int no_data_file; static int no_data_file;
@@ -579,6 +587,16 @@ static int flag_human_readable_numbers = 0; @@ -611,6 +619,16 @@ static int flag_function_summary = 0;
static int flag_function_summary = 0; static int flag_debug = 0;
+/* +/*
+ * Genode autopilot mode + * Genode autopilot mode
@ -57,7 +57,7 @@ index a291bac3e..813c7e19b 100644
/* Object directory file prefix. This is the directory/file where the /* Object directory file prefix. This is the directory/file where the
graph and data files are looked for, if nonzero. */ graph and data files are looked for, if nonzero. */
@@ -826,6 +844,43 @@ get_cycles_count (line_info &linfo) @@ -859,6 +877,43 @@ get_cycles_count (line_info &linfo)
return count; return count;
} }
@ -101,7 +101,7 @@ index a291bac3e..813c7e19b 100644
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
@@ -851,13 +906,25 @@ main (int argc, char **argv) @@ -884,13 +939,25 @@ main (int argc, char **argv)
expandargv (&argc, &argv); expandargv (&argc, &argv);
argno = process_args (argc, argv); argno = process_args (argc, argv);
@ -128,34 +128,32 @@ index a291bac3e..813c7e19b 100644
for (; argno != argc; argno++) for (; argno != argc; argno++)
{ {
@@ -911,7 +978,8 @@ print_usage (int error_p) @@ -950,6 +1017,7 @@ print_usage (int error_p)
fnotice (file, " -u, --unconditional-branches Show unconditional branch counts too\n");
fnotice (file, " -v, --version Print version number, then exit\n"); fnotice (file, " -v, --version Print version number, then exit\n");
fnotice (file, " -w, --verbose Print verbose informations\n"); fnotice (file, " -w, --verbose Print verbose informations\n");
- fnotice (file, " -x, --hash-filenames Hash long pathnames\n"); fnotice (file, " -x, --hash-filenames Hash long pathnames\n");
+ fnotice (file, " -x, --hash-filenames Hash long pathnames\n\n");
+ fnotice (file, " -g, --genode-autopilot Genode autopilot mode\n"); + fnotice (file, " -g, --genode-autopilot Genode autopilot mode\n");
fnotice (file, "\nFor bug reporting instructions, please see:\n%s.\n", fnotice (file, "\nObsolete options:\n");
bug_report_url); fnotice (file, " -i, --json-format Replaced with -j, --json-format\n");
exit (status); fnotice (file, " -j, --human-readable Replaced with -H, --human-readable\n");
@@ -957,6 +1025,7 @@ static const struct option options[] = @@ -998,6 +1066,7 @@ static const struct option options[] =
{ "hash-filenames", no_argument, NULL, 'x' },
{ "use-colors", no_argument, NULL, 'k' }, { "use-colors", no_argument, NULL, 'k' },
{ "use-hotness-colors", no_argument, NULL, 'q' }, { "use-hotness-colors", no_argument, NULL, 'q' },
{ "debug", no_argument, NULL, 'D' },
+ { "genode-autopilot", no_argument, NULL, 'g' }, + { "genode-autopilot", no_argument, NULL, 'g' },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
@@ -967,7 +1036,7 @@ process_args (int argc, char **argv) @@ -1008,7 +1077,7 @@ process_args (int argc, char **argv)
{ {
int opt; int opt;
- const char *opts = "abcdfhijklmno:pqrs:tuvwx"; - const char *opts = "abcdDfhHijklmno:pqrs:tuvwx";
+ const char *opts = "abcdfghijklmno:pqrs:tuvwx"; + const char *opts = "abcdDfghHijklmno:pqrs:tuvwx";
while ((opt = getopt_long (argc, argv, opts, options, NULL)) != -1) while ((opt = getopt_long (argc, argv, opts, options, NULL)) != -1)
{ {
switch (opt) switch (opt)
@@ -984,6 +1053,9 @@ process_args (int argc, char **argv) @@ -1025,6 +1094,9 @@ process_args (int argc, char **argv)
case 'f': case 'f':
flag_function_summary = 1; flag_function_summary = 1;
break; break;
@ -165,7 +163,7 @@ index a291bac3e..813c7e19b 100644
case 'h': case 'h':
print_usage (false); print_usage (false);
/* print_usage will exit. */ /* print_usage will exit. */
@@ -1363,11 +1435,43 @@ process_all_functions (void) @@ -1458,13 +1530,45 @@ process_all_functions (void)
static void static void
output_gcov_file (const char *file_name, source_info *src) output_gcov_file (const char *file_name, source_info *src)
{ {
@ -199,7 +197,9 @@ index a291bac3e..813c7e19b 100644
+ return; + return;
+ } + }
+ +
char *gcov_file_name = make_gcov_file_name (file_name, src->coverage.name); string gcov_file_name_str
= make_gcov_file_name (file_name, src->coverage.name);
const char *gcov_file_name = gcov_file_name_str.c_str ();
if (src->coverage.lines) if (src->coverage.lines)
{ {
@ -210,27 +210,37 @@ index a291bac3e..813c7e19b 100644
if (gcov_file) if (gcov_file)
{ {
fnotice (stdout, "Creating '%s'\n", gcov_file_name); fnotice (stdout, "Creating '%s'\n", gcov_file_name);
@@ -1375,7 +1479,8 @@ output_gcov_file (const char *file_name, source_info *src) @@ -1475,7 +1579,8 @@ output_gcov_file (const char *file_name, source_info *src)
if (ferror (gcov_file)) gcov_file_name);
fnotice (stderr, "Error writing output file '%s'\n", return_code = 6;
gcov_file_name); }
- fclose (gcov_file); - fclose (gcov_file);
+ if (!flag_genode_autopilot) + if (!flag_genode_autopilot)
+ fclose (gcov_file); + fclose (gcov_file);
} }
else else
fnotice (stderr, "Could not open output file '%s'\n", gcov_file_name); {
@@ -1422,7 +1527,8 @@ generate_results (const char *file_name) @@ -1511,6 +1616,7 @@ generate_results (const char *file_name)
file_name = canonicalize_name (file_name); }
} }
+if (file_name) {
name_map needle;
needle.name = file_name;
vector<name_map>::iterator it
@@ -1519,8 +1625,9 @@ generate_results (const char *file_name)
file_name = sources[it->src].coverage.name;
else
file_name = canonicalize_name (file_name);
-
- gcov_intermediate_filename = get_gcov_intermediate_filename (file_name); - gcov_intermediate_filename = get_gcov_intermediate_filename (file_name);
+}
+ if (file_name) + if (file_name)
+ gcov_intermediate_filename = get_gcov_intermediate_filename (file_name); + gcov_intermediate_filename = get_gcov_intermediate_filename (file_name);
json::object *root = new json::object (); json::object *root = new json::object ();
root->set ("format_version", new json::string ("1")); root->set ("format_version", new json::string ("1"));
@@ -1430,7 +1536,8 @@ generate_results (const char *file_name) @@ -1528,7 +1635,8 @@ generate_results (const char *file_name)
if (bbg_cwd != NULL) if (bbg_cwd != NULL)
root->set ("current_working_directory", new json::string (bbg_cwd)); root->set ("current_working_directory", new json::string (bbg_cwd));
@ -240,7 +250,7 @@ index a291bac3e..813c7e19b 100644
json::array *json_files = new json::array (); json::array *json_files = new json::array ();
root->set ("files", json_files); root->set ("files", json_files);
@@ -1459,7 +1566,10 @@ generate_results (const char *file_name) @@ -1559,7 +1667,10 @@ generate_results (const char *file_name)
file_summary (&src->coverage); file_summary (&src->coverage);
total_lines += src->coverage.lines; total_lines += src->coverage.lines;
total_executed += src->coverage.lines_executed; total_executed += src->coverage.lines_executed;
@ -251,8 +261,8 @@ index a291bac3e..813c7e19b 100644
+ (src->coverage.lines_executed == src->coverage.lines))) + (src->coverage.lines_executed == src->coverage.lines)))
{ {
if (flag_json_format) if (flag_json_format)
output_json_intermediate_file (json_files, src); {
@@ -1547,7 +1657,8 @@ create_file_names (const char *file_name) @@ -1652,7 +1763,8 @@ create_file_names (const char *file_name)
/* Free previous file names. */ /* Free previous file names. */
free (bbg_file_name); free (bbg_file_name);
free (da_file_name); free (da_file_name);
@ -262,7 +272,7 @@ index a291bac3e..813c7e19b 100644
bbg_file_time = 0; bbg_file_time = 0;
bbg_stamp = 0; bbg_stamp = 0;
@@ -1593,6 +1704,10 @@ create_file_names (const char *file_name) @@ -1698,6 +1810,10 @@ create_file_names (const char *file_name)
strcpy (da_file_name, name); strcpy (da_file_name, name);
strcpy (da_file_name + length, GCOV_DATA_SUFFIX); strcpy (da_file_name + length, GCOV_DATA_SUFFIX);
@ -273,7 +283,7 @@ index a291bac3e..813c7e19b 100644
free (name); free (name);
return; return;
} }
@@ -1649,6 +1764,18 @@ find_source (const char *file_name) @@ -1754,6 +1870,18 @@ find_source (const char *file_name)
#endif #endif
&& IS_DIR_SEPARATOR (src->coverage.name[source_length])) && IS_DIR_SEPARATOR (src->coverage.name[source_length]))
src->coverage.name += source_length + 1; src->coverage.name += source_length + 1;

View File

@ -8,26 +8,26 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
1 file changed, 4 insertions(+) 1 file changed, 4 insertions(+)
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 4ff8b5e65..96409d759 100644 index 363082b..dc3e19d 100644
--- a/gcc/config/i386/i386.h --- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h
@@ -2482,6 +2482,7 @@ const wide_int_bitmask PTA_TREMONT = PTA_GOLDMONT_PLUS | PTA_CLWB @@ -2351,6 +2351,7 @@ constexpr wide_int_bitmask PTA_ALDERLAKE = PTA_TREMONT | PTA_ADX | PTA_AVX
const wide_int_bitmask PTA_KNM = PTA_KNL | PTA_AVX5124VNNIW constexpr wide_int_bitmask PTA_KNM = PTA_KNL | PTA_AVX5124VNNIW
| PTA_AVX5124FMAPS | PTA_AVX512VPOPCNTDQ; | PTA_AVX5124FMAPS | PTA_AVX512VPOPCNTDQ;
+#if 0 +#if 0
#ifndef GENERATOR_FILE #ifndef GENERATOR_FILE
#include "insn-attr-common.h" #include "insn-attr-common.h"
@@ -2499,6 +2500,7 @@ extern const pta processor_alias_table[]; @@ -2373,6 +2374,7 @@ extern unsigned int const pta_size;
extern int const pta_size; extern unsigned int const num_arch_names;
#endif #endif
+#endif +#endif
#endif #endif
extern enum processor_type ix86_tune; extern enum processor_type ix86_tune;
@@ -2955,11 +2957,13 @@ extern void debug_dispatch_window (int); @@ -2847,11 +2849,13 @@ extern void debug_dispatch_window (int);
#define TARGET_SUPPORTS_WIDE_INT 1 #define TARGET_SUPPORTS_WIDE_INT 1
@ -39,5 +39,5 @@ index 4ff8b5e65..96409d759 100644
#endif #endif
+#endif +#endif
/* /* __builtin_eh_return can't handle stack realignment, so disable MMX/SSE
Local variables: in 32-bit libgcc functions that call it. */

View File

@ -0,0 +1,20 @@
/*
* \brief Minimal C library for libgcov
* \author Christian Prochaska
* \date 2022-04-18
*
*/
/*
* Copyright (C) 2022 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef STDINT_H
#define STDINT_H
typedef long intptr_t;
#endif

View File

@ -4,11 +4,12 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
--- ---
gcc/tsystem.h | 6 ++++++ gcc/tsystem.h | 6 ++++++
1 file changed, 6 insertions(+) libgcc/libgcov.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/gcc/tsystem.h b/gcc/tsystem.h diff --git a/gcc/tsystem.h b/gcc/tsystem.h
index 7be251313..dd85a677e 100644 index dfaf9e8..d7cac00 100644
--- a/gcc/tsystem.h --- a/gcc/tsystem.h
+++ b/gcc/tsystem.h +++ b/gcc/tsystem.h
@@ -90,7 +90,9 @@ extern void *memset (void *, int, size_t); @@ -90,7 +90,9 @@ extern void *memset (void *, int, size_t);
@ -36,3 +37,16 @@ index 7be251313..dd85a677e 100644
#endif /* inhibit_libc */ #endif /* inhibit_libc */
diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index c77a74a..f3ba7ce 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -49,6 +49,8 @@
#include <sys/mman.h>
#endif
+#include <stdint.h>
+
#if __CHAR_BIT__ == 8
typedef unsigned gcov_unsigned_t __attribute__ ((mode (SI)));
typedef unsigned gcov_position_t __attribute__ ((mode (SI)));

View File

@ -1,23 +0,0 @@
open files in buffered mode
From: Christian Prochaska <christian.prochaska@genode-labs.com>
---
gcc/gcov-io.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index ac60f9baf..f35fcca1f 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -192,7 +192,9 @@ gcov_open (const char *name, int mode)
gcov_var.mode = mode ? mode : 1;
+#if 0
setbuf (gcov_var.file, (char *)0);
+#endif
return 1;
}