Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gcov: add support for GCC 10.1

Using gcov to collect coverage data for kernels compiled with GCC 10.1
causes random malfunctions and kernel crashes. This is the result of a
changed GCOV_COUNTERS value in GCC 10.1 that causes a mismatch between
the layout of the gcov_info structure created by GCC profiling code and
the related structure used by the kernel.

Fix this by updating the in-kernel GCOV_COUNTERS value. Also re-enable
config GCOV_KERNEL for use with GCC 10.

Reported-by: Colin Ian King <colin.king@canonical.com>
Reported-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Tested-by: Leon Romanovsky <leonro@nvidia.com>
Tested-and-Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Oberparleiter and committed by
Linus Torvalds
40249c69 581cb3a2

+3 -2
-1
kernel/gcov/Kconfig
··· 4 4 config GCOV_KERNEL 5 5 bool "Enable gcov-based kernel profiling" 6 6 depends on DEBUG_FS 7 - depends on !CC_IS_GCC || GCC_VERSION < 100000 8 7 select CONSTRUCTORS if !UML 9 8 default n 10 9 help
+3 -1
kernel/gcov/gcc_4_7.c
··· 19 19 #include <linux/vmalloc.h> 20 20 #include "gcov.h" 21 21 22 - #if (__GNUC__ >= 7) 22 + #if (__GNUC__ >= 10) 23 + #define GCOV_COUNTERS 8 24 + #elif (__GNUC__ >= 7) 23 25 #define GCOV_COUNTERS 9 24 26 #elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) 25 27 #define GCOV_COUNTERS 10