gcov: add support for GCC 14
authorPeter Oberparleiter <oberpar@linux.ibm.com>
Mon, 10 Jun 2024 09:27:43 +0000 (11:27 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 15 Jun 2024 17:43:06 +0000 (10:43 -0700)
Using gcov on kernels compiled with GCC 14 results in truncated 16-byte
long .gcda files with no usable data.  To fix this, update GCOV_COUNTERS
to match the value defined by GCC 14.

Tested with GCC versions 14.1.0 and 13.2.0.

Link: https://lkml.kernel.org/r/20240610092743.1609845-1-oberpar@linux.ibm.com
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reported-by: Allison Henderson <allison.henderson@oracle.com>
Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/gcov/gcc_4_7.c

index 74a4ef1da9ad77a985bb038f8da98cf32cf21df8..fd75b4a484d76ab15ce202402df61af48e7c8398 100644 (file)
@@ -18,7 +18,9 @@
 #include <linux/mm.h>
 #include "gcov.h"
 
-#if (__GNUC__ >= 10)
+#if (__GNUC__ >= 14)
+#define GCOV_COUNTERS                  9
+#elif (__GNUC__ >= 10)
 #define GCOV_COUNTERS                  8
 #elif (__GNUC__ >= 7)
 #define GCOV_COUNTERS                  9