MAPPER.O := server.o resolver.o
CODYLIB = ../libcody/libcody.a
-CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I.
+CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
- +$(CXX) $(LDFLAGS) $(PIEFLAG) -o $@ $^ $(VERSION.O) $(LIBIBERTY) $(NETLIBS)
+ +$(CXX) $(LDFLAGS) $(PIEFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
# copy to gcc dir so tests there can run
all::../gcc/g++-mapper-server$(exeext)
GIMPLE_H = gimple.h gimple.def gsstruct.def $(VEC_H) \
$(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H) is-a.h
-GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h gcov-counter.def
+GCOV_IO_H = gcov-io.h version.h auto-host.h gcov-counter.def
RECOG_H = recog.h
EMIT_RTL_H = emit-rtl.h
FLAGS_H = flags.h flag-types.h $(OPTIONS_H)
edit-context.o \
pretty-print.o intl.o \
sbitmap.o \
- vec.o input.o version.o hash-table.o ggc-none.o memory-block.o \
+ vec.o input.o hash-table.o ggc-none.o memory-block.o \
selftest.o selftest-diagnostic.o sort.o
# Objects in libcommon-target.a, used by drivers and by the core
$(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
gcc-ranlib$(exeext) \
- gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
+ genversion$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
gcov-tool$(exeect) \
gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \
libcommon-target.a libcommon.a libgcc.mk perf.data
# Build libgcc.a.
libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
- $(MACHMODE_H) gcov-iov.h
+ $(MACHMODE_H) version.h
libgcc.mvars: config.status Makefile specs xgcc$(exeext)
: > tmp-libgcc.mvars
dumpvers: dumpvers.c
-CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
- -DREVISION=$(REVISION_s) \
- -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
- -DBUGURL=$(BUGURL_s)
-version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
-
# lto-compress.o needs $(ZLIBINC) added to the include flags.
CFLAGS-lto-compress.o += $(ZLIBINC) $(ZSTD_INC)
$(simple_generated_h) specs.h \
tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \
tm-preds.h tm-constrs.h \
- $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \
+ $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h version.h \
options.h target-hooks-def.h insn-opinit.h \
common/common-target-hooks-def.h pass-instances.def \
c-family/c-target-hooks-def.h d/d-target-hooks-def.h \
$(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
-o $@ $<
-## build/version.o is compiled by the $(COMPILER_FOR_BUILD) but needs
-## several C macro definitions, just like version.o
-build/version.o: version.c version.h \
- $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
- $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
- -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
- -DREVISION=$(REVISION_s) \
- -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
- -DBUGURL=$(BUGURL_s) -o $@ $<
-
# Header dependencies for the programs that generate source code.
# These are library modules...
build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
# These programs are not linked with the MD reader.
build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
- build/gengtype-state.o build/version.o build/errors.o
+ build/gengtype-state.o version.h build/errors.o
gengtype$(exeext) : gengtype.o gengtype-lex.o gengtype-parse.o \
- gengtype-state.o version.o errors.o $(LIBDEPS)
+ gengtype-state.o version.h errors.o $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(filter-out ($LIBDEPS), $^) $(LIBS)
# Note for the stamp targets, we run the program `true' instead of
# having an empty command (nothing following the semicolon).
-# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
-build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) $(CORETYPES_H) $(GTM_H) \
- $(SYSTEM_H) $(CORETYPES_H) $(TM_H)
+# genversion.c is run on the build machine to generate version.h
+CFLAGS-build/genversion.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
+ -DREVISION=$(REVISION_s) \
+ -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
+ -DBUGURL=$(BUGURL_s)
-build/gcov-iov$(build_exeext): build/gcov-iov.o
- +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \
- build/gcov-iov.o -o $@
+build/genversion.o: genversion.c $(BCONFIG_H) $(SYSTEM_H)
-gcov-iov.h: s-iov; @true
-s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE)
- build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \
- > tmp-gcov-iov.h
- $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h
- $(STAMP) s-iov
+version.h: s-version; @true
+s-version: build/genversion$(build_exeext)
+ build/genversion$(build_exeext) > tmp-version.h
+ $(SHELL) $(srcdir)/../move-if-change tmp-version.h version.h
+ $(STAMP) s-version
# gcov.o needs $(ZLIBINC) added to the include flags.
CFLAGS-gcov.o += $(ZLIBINC)
#define GCOV_DATA_MAGIC ((gcov_unsigned_t)0x67636461) /* "gcda" */
#define GCOV_NOTE_MAGIC ((gcov_unsigned_t)0x67636e6f) /* "gcno" */
-/* gcov-iov.h is automatically generated by the makefile from
- version.c, it looks like
- #define GCOV_VERSION ((gcov_unsigned_t)0x89abcdef)
-*/
-#include "gcov-iov.h"
+#include "version.h"
/* Convert a magic or version number to a 4 character string. */
#define GCOV_UNSIGNED2STRING(ARRAY,VALUE) \
/* Read a version, and check against the version of the gengtype. */
static void
-read_state_version (const char *version_string)
+read_state_version (const char *ver_string)
{
struct state_token_st *t0 = peek_state_token (0);
struct state_token_st *t1 = peek_state_token (1);
{
/* Check that the read version string is the same as current
version. */
- if (strcmp (version_string, t0->stok_un.stok_string))
+ if (strcmp (ver_string, t0->stok_un.stok_string))
fatal_reading_state_printf (t0,
"version string mismatch; expecting %s but got %s",
- version_string,
+ ver_string,
t0->stok_un.stok_string);
next_state_tokens (2);
}
-/* Generate gcov version string from version.c. See gcov-io.h for
+/* Generate version strings. See gcov-io.h for
description of how the version string is generated.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com>
phase (the latter may be an empty string). */
int
-main (int argc, char **argv)
+main (void)
{
unsigned int version = 0;
unsigned char v[4];
unsigned long major;
unsigned long minor = 0;
char phase = 0;
- char *ptr;
+ char basever[] = BASEVER;
+ char *ptr = basever;
- if (argc != 3)
- {
- fprintf (stderr, "usage: %s 'version' 'phase'\n", argv[0]);
- return 1;
- }
-
- ptr = argv[1];
major = strtoul (ptr, &ptr, 10);
if (*ptr == '.')
Consider both equal as patch-level releases do not change
the GCOV version either.
On the trunk the development phase is "experimental". */
- phase = argv[2][0];
+ phase = DEVPHASE[0];
if (phase == '\0'
- || strcmp (argv[2], "prerelease") == 0)
+ || strcmp (DEVPHASE, "prerelease") == 0)
phase = '*';
v[0] = (major / 10) + 'A';
for (ix = 0; ix != 4; ix++)
version = (version << 8) | v[ix];
- printf ("/* Generated automatically by the program `%s'\n", argv[0]);
- printf (" from `%s (%lu %lu) and %s (%c)'. */\n",
- argv[1], major, minor, argv[2], phase);
+ printf ("#ifndef VERSION_H\n");
+ printf ("#define VERSION_H\n\n");
+ printf ("/* Generated automatically by genversion. */\n");
printf ("\n");
+ printf ("#define GCC_major_version %lu\n\n", major);
+
+ printf ("/* The complete version string, assembled from several pieces.\n"
+ "BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the\n"
+ "Makefile. */\n\n");
+
+ printf ("#define version_string \"" BASEVER DATESTAMP DEVPHASE REVISION "\"\n");
+ printf ("#define pkgversion_string \"" PKGVERSION "\"\n\n");
+
+ printf ("/* This is the location of the online document giving instructions for\n"
+ "reporting bugs. If you distribute a modified version of GCC,\n"
+ "please configure with --with-bugurl pointing to a document giving\n"
+ "instructions for reporting bugs to you, not us. (You are of course\n"
+ "welcome to forward us bugs reported to you, if you determine that\n"
+ "they are not bugs in your modifications.) */\n\n");
+ printf ("#define bug_report_url \"" BUGURL "\"\n\n");
+
printf ("#define GCOV_VERSION ((gcov_unsigned_t)0x%08x) /* %.4s */\n",
version, v);
+ printf ("\n#endif /* VERSION_H */\n");
return 0;
}
#include "plugin-api.h"
#include "gcov-io.h"
#include "diagnostic.h"
+#include "version.h"
/* The encoding for a function consists of the following sections:
String are represented in the table as pairs, a length in ULEB128
form followed by the data for the string. */
-#define LTO_major_version 9
+#define LTO_major_version GCC_major_version
#define LTO_minor_version 0
typedef unsigned char lto_decl_flags_t;
+++ /dev/null
-/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "version.h"
-
-/* This is the location of the online document giving instructions for
- reporting bugs. If you distribute a modified version of GCC,
- please configure with --with-bugurl pointing to a document giving
- instructions for reporting bugs to you, not us. (You are of course
- welcome to forward us bugs reported to you, if you determine that
- they are not bugs in your modifications.) */
-
-const char bug_report_url[] = BUGURL;
-
-/* The complete version string, assembled from several pieces.
- BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
- Makefile. */
-
-const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION;
-const char pkgversion_string[] = PKGVERSION;
+++ /dev/null
-#ifndef GCC_VERSION_H
-#define GCC_VERSION_H
-extern const char version_string[];
-extern const char pkgversion_string[];
-extern const char bug_report_url[];
-#endif /* ! GCC_VERSION_H */
if (version != GCOV_VERSION)
{
char v[4], e[4];
- char version_string[128], expected_string[128];
+ char ver_string[128], expected_string[128];
GCOV_UNSIGNED2STRING (v, version);
GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
"got %s (%.4s)\n",
filename? filename : ptr->filename,
gcov_version_string (expected_string, e), e,
- gcov_version_string (version_string, v), v);
+ gcov_version_string (ver_string, v), v);
return 0;
}
return 1;