[xen master] gcov: support gcc 7.x

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] gcov: support gcc 7.x

patchbot
commit 8ba5f63d3afd59001c35b1494f0416131de439a4
Author:     Jan Beulich <[hidden email]>
AuthorDate: Fri Oct 20 09:31:54 2017 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Fri Oct 20 09:31:54 2017 +0200

    gcov: support gcc 7.x
   
    Taking Linux commit 0538421343 ("gcov: support GCC 7.1") as reference,
    enable gcc 7 support requiring __gcov_exit() and having 9 counters.
   
    Signed-off-by: Jan Beulich <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
    Acked-by: Wei Liu <[hidden email]>
    Release-acked-by: Julien Grall <[hidden email]>
---
 xen/Kconfig.debug           |  8 +++++++-
 xen/common/gcov/Makefile    |  4 +++-
 xen/common/gcov/gcc_5.c     |  4 ++--
 xen/common/gcov/gcc_7.c     | 30 ++++++++++++++++++++++++++++++
 xen/common/gcov/gcov_base.c |  5 +++++
 5 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 3329c75..8d70f63 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -51,11 +51,17 @@ config GCOV_FORMAT_AUTODETECT
  ---help---
   Automatically select gcov format based on gcc version.
 
+config GCOV_FORMAT_7
+ bool "GCC 7 format"
+ ---help---
+  Select this option to use the format specified in GCC 7.
+  Works in gcc version range [7, ...).
+
 config GCOV_FORMAT_5
  bool "GCC 5 format"
  ---help---
   Select this option to use the format specified in GCC 5.
-  Works in gcc version range [5, ...).
+  Works in gcc version range [5, 7).
 
 config GCOV_FORMAT_4_9
  bool "GCC 4.9 format"
diff --git a/xen/common/gcov/Makefile b/xen/common/gcov/Makefile
index 1b61357..f68d050 100644
--- a/xen/common/gcov/Makefile
+++ b/xen/common/gcov/Makefile
@@ -3,7 +3,9 @@ obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o
 obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o
 obj-$(CONFIG_GCOV_FORMAT_4_9) += gcc_4_9.o
 obj-$(CONFIG_GCOV_FORMAT_5)   += gcc_5.o
+obj-$(CONFIG_GCOV_FORMAT_7)   += gcc_7.o
 obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion,lt,0x040700, \
  gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
  gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
- gcc_4_9.o, gcc_5.o)))
+ gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
+ gcc_5.o, gcc_7.o))))
diff --git a/xen/common/gcov/gcc_5.c b/xen/common/gcov/gcc_5.c
index 7541310..6e0d276 100644
--- a/xen/common/gcov/gcc_5.c
+++ b/xen/common/gcov/gcc_5.c
@@ -1,6 +1,6 @@
 /*
  *  This code provides functions to handle gcc's profiling data format
- *  introduced with gcc 4.7.
+ *  introduced with gcc 5.
  *
  *  For a better understanding, refer to gcc source:
  *  gcc/gcov-io.h
@@ -14,7 +14,7 @@
 
 #include "gcov.h"
 
-#if GCC_VERSION < 50000
+#if GCC_VERSION < 50000 || GCC_VERSION >= 70000
 #error "Wrong version of GCC used to compile gcov"
 #endif
 
diff --git a/xen/common/gcov/gcc_7.c b/xen/common/gcov/gcc_7.c
new file mode 100644
index 0000000..3962eb4
--- /dev/null
+++ b/xen/common/gcov/gcc_7.c
@@ -0,0 +1,30 @@
+/*
+ *  This code provides functions to handle gcc's profiling data format
+ *  introduced with gcc 7.
+ *
+ *  For a better understanding, refer to gcc source:
+ *  gcc/gcov-io.h
+ *  libgcc/libgcov.c
+ *
+ *  Uses gcc-internal data definitions.
+ */
+
+#include "gcov.h"
+
+#if GCC_VERSION < 70000
+#error "Wrong version of GCC used to compile gcov"
+#endif
+
+#define GCOV_COUNTERS 9
+
+#include "gcc_4_7.c"
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/gcov/gcov_base.c b/xen/common/gcov/gcov_base.c
index 34a0183..d0c6d0a 100644
--- a/xen/common/gcov/gcov_base.c
+++ b/xen/common/gcov/gcov_base.c
@@ -31,6 +31,11 @@ void __init __gcov_init(struct gcov_info *info)
  * These functions may be referenced by gcc-generated profiling code but serve
  * no function for Xen.
  */
+void __gcov_exit(void)
+{
+    /* Unused. */
+}
+
 void __gcov_flush(void)
 {
     /* Unused. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog