xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gcov: support gcc 7.x
@ 2017-10-18 13:45 Jan Beulich
  2017-10-18 13:48 ` Andrew Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Beulich @ 2017-10-18 13:45 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, Ian Jackson, Tim Deegan, Julien Grall

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 <jbeulich@suse.com>
---
Considering that gcc 7 has been out for a while, I think we shouldn't
ship 4.10 with not even building gcov when using that compiler.

--- 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"
--- a/xen/common/gcov/Makefile
+++ b/xen/common/gcov/Makefile
@@ -3,7 +3,9 @@ obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4
 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))))
--- 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
 
--- /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:
+ */
--- 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
  * 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. */




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcov: support gcc 7.x
  2017-10-18 13:45 [PATCH] gcov: support gcc 7.x Jan Beulich
@ 2017-10-18 13:48 ` Andrew Cooper
  2017-10-18 13:50 ` Wei Liu
  2017-10-19 11:13 ` Julien Grall
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2017-10-18 13:48 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Tim Deegan, Ian Jackson, Julien Grall

On 18/10/17 14:45, Jan Beulich wrote:
> 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 <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Like the UBSAN stuff, I think this is reasonable for inclusion into 4.10
at this point.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcov: support gcc 7.x
  2017-10-18 13:45 [PATCH] gcov: support gcc 7.x Jan Beulich
  2017-10-18 13:48 ` Andrew Cooper
@ 2017-10-18 13:50 ` Wei Liu
  2017-10-19 11:13 ` Julien Grall
  2 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2017-10-18 13:50 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, Ian Jackson, Tim Deegan, Julien Grall, xen-devel

On Wed, Oct 18, 2017 at 07:45:53AM -0600, Jan Beulich wrote:
> 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 <jbeulich@suse.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
> Considering that gcc 7 has been out for a while, I think we shouldn't
> ship 4.10 with not even building gcov when using that compiler.
> 

+1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcov: support gcc 7.x
  2017-10-18 13:45 [PATCH] gcov: support gcc 7.x Jan Beulich
  2017-10-18 13:48 ` Andrew Cooper
  2017-10-18 13:50 ` Wei Liu
@ 2017-10-19 11:13 ` Julien Grall
  2 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2017-10-19 11:13 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, Ian Jackson, Tim Deegan, Julien Grall

Hi Jan,

On 18/10/17 14:45, Jan Beulich wrote:
> 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 <jbeulich@suse.com>
> ---
> Considering that gcc 7 has been out for a while, I think we shouldn't
> ship 4.10 with not even building gcov when using that compiler.

I agree.

Release-acked-by: Julien Grall <julien.grall@linaro.org>

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-19 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 13:45 [PATCH] gcov: support gcc 7.x Jan Beulich
2017-10-18 13:48 ` Andrew Cooper
2017-10-18 13:50 ` Wei Liu
2017-10-19 11:13 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).