From ed469aebb943a91250925e7a46c41c6fb577afba Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 15 Sep 2021 13:00:50 +0200 Subject: [PATCH] 5.14-stable patches added patches: makefile-use-wno-main-in-the-full-kernel-tree.patch --- queue-5.13/series | 0 ...use-wno-main-in-the-full-kernel-tree.patch | 49 +++++++++++++++++++ queue-5.14/series | 1 + 3 files changed, 50 insertions(+) create mode 100644 queue-5.13/series create mode 100644 queue-5.14/makefile-use-wno-main-in-the-full-kernel-tree.patch create mode 100644 queue-5.14/series diff --git a/queue-5.13/series b/queue-5.13/series new file mode 100644 index 00000000000..e69de29bb2d diff --git a/queue-5.14/makefile-use-wno-main-in-the-full-kernel-tree.patch b/queue-5.14/makefile-use-wno-main-in-the-full-kernel-tree.patch new file mode 100644 index 00000000000..51e0b2e7a27 --- /dev/null +++ b/queue-5.14/makefile-use-wno-main-in-the-full-kernel-tree.patch @@ -0,0 +1,49 @@ +From 49832c819ab85b33b7a2a1429c8d067e82be2977 Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Tue, 7 Sep 2021 15:42:02 -0700 +Subject: Makefile: use -Wno-main in the full kernel tree + +From: Randy Dunlap + +commit 49832c819ab85b33b7a2a1429c8d067e82be2977 upstream. + +When using gcc (SUSE Linux) 7.5.0 (on openSUSE 15.3), I see a build +warning: + + kernel/trace/trace_osnoise.c: In function 'start_kthread': + kernel/trace/trace_osnoise.c:1461:8: warning: 'main' is usually a function [-Wmain] + void *main = osnoise_main; + ^~~~ + +Quieten that warning by using "-Wno-main". It's OK to use "main" as a +declaration name in the kernel. + +Build-tested on most ARCHes. + +[ v2: only do it for gcc, since clang doesn't have that particular warning ] + +Signed-off-by: Randy Dunlap +Link: https://lore.kernel.org/lkml/20210813224131.25803-1-rdunlap@infradead.org/ +Suggested-by: Steven Rostedt +Suggested-by: Linus Torvalds +Cc: Daniel Bristot de Oliveira +Cc: Masahiro Yamada +Cc: Michal Marek +Cc: linux-kbuild@vger.kernel.org +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/Makefile ++++ b/Makefile +@@ -803,6 +803,8 @@ else + # Disabled for clang while comment to attribute conversion happens and + # https://github.com/ClangBuiltLinux/linux/issues/636 is discussed. + KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=5,) ++# gcc inanely warns about local variables called 'main' ++KBUILD_CFLAGS += -Wno-main + endif + + # These warnings generated too much noise in a regular build. diff --git a/queue-5.14/series b/queue-5.14/series new file mode 100644 index 00000000000..4569f6de718 --- /dev/null +++ b/queue-5.14/series @@ -0,0 +1 @@ +makefile-use-wno-main-in-the-full-kernel-tree.patch -- 2.47.3