diff mbox series

[5.8,108/177] gcov: Disable gcov build with GCC 10

Message ID 20200915140658.820608455@linuxfoundation.org
State New
Headers show
Series None | expand

Commit Message

Greg Kroah-Hartman Sept. 15, 2020, 2:12 p.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

[ Upstream commit cfc905f158eaa099d6258031614d11869e7ef71c ]

GCOV built with GCC 10 doesn't initialize n_function variable.  This
produces different kernel panics as was seen by Colin in Ubuntu and me
in FC 32.

As a workaround, let's disable GCOV build for broken GCC 10 version.

Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1891288
Link: https://lore.kernel.org/lkml/20200827133932.3338519-1-leon@kernel.org
Link: https://lore.kernel.org/lkml/CAHk-=whbijeSdSvx-Xcr0DPMj0BiwhJ+uiNnDSVZcr_h_kg7UA@mail.gmail.com/
Cc: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/gcov/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Torvalds Sept. 15, 2020, 5:24 p.m. UTC | #1
On Tue, Sep 15, 2020 at 7:28 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> GCOV built with GCC 10 doesn't initialize n_function variable.  This
> produces different kernel panics as was seen by Colin in Ubuntu and me
> in FC 32.
>
> As a workaround, let's disable GCOV build for broken GCC 10 version.

Oh, Peter Oberparleiter actually figured out what was wrong, and we
have commit 40249c696207 ("gcov: add support for GCC 10.1") upstream
that enables it again with the fix for the changed semantics in
gcc-10.

                          Linus
Sasha Levin Sept. 15, 2020, 5:35 p.m. UTC | #2
On Tue, Sep 15, 2020 at 10:24:25AM -0700, Linus Torvalds wrote:
>On Tue, Sep 15, 2020 at 7:28 AM Greg Kroah-Hartman

><gregkh@linuxfoundation.org> wrote:

>>

>> GCOV built with GCC 10 doesn't initialize n_function variable.  This

>> produces different kernel panics as was seen by Colin in Ubuntu and me

>> in FC 32.

>>

>> As a workaround, let's disable GCOV build for broken GCC 10 version.

>

>Oh, Peter Oberparleiter actually figured out what was wrong, and we

>have commit 40249c696207 ("gcov: add support for GCC 10.1") upstream

>that enables it again with the fix for the changed semantics in

>gcc-10.


AUTOSEL spotted it
(https://lore.kernel.org/stable/20200914130358.1804194-27-sashal@kernel.org/),
and I didn't want to rush it in given it doesn't have a fixes/stable
tag.

I'll queue it up for this cycle as you've pointed it out.

-- 
Thanks,
Sasha
diff mbox series

Patch

diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig
index 3110c77230c7f..bb4b680e8455a 100644
--- a/kernel/gcov/Kconfig
+++ b/kernel/gcov/Kconfig
@@ -4,6 +4,7 @@  menu "GCOV-based kernel profiling"
 config GCOV_KERNEL
 	bool "Enable gcov-based kernel profiling"
 	depends on DEBUG_FS
+	depends on !CC_IS_GCC || GCC_VERSION < 100000
 	select CONSTRUCTORS if !UML
 	default n
 	help