summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHeinrich Schuchardt <[email protected]>2025-12-31 20:10:51 +0100
committerTom Rini <[email protected]>2026-01-02 10:27:18 -0600
commit56ae3c2a44fcd8e2f680c51620011273727ae9db (patch)
treeba57067a5191e45d4bc13040a91817ad92449d5e /Makefile
parent601733e7087286f211634204c60fe86856ddbd78 (diff)
Makefile: repair CONFIG_CC_OPTIMIZE_FOR_DEBUG support
Since commit 5f520875bdf0 ("kbuild: Bump the build system to 5.1") CONFIG_CC_OPTIMIZE_FOR_DEBUG has no effect on the non-host code. This patch reestablishes the prior logic to add -Og -Wno-maybe-uninitialized to KBUILD_CFLAGS. Fixes: 5f520875bdf0 ("kbuild: Bump the build system to 5.1") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6b5c5ee019e..696b502fa16 100644
--- a/Makefile
+++ b/Makefile
@@ -869,6 +869,11 @@ endif
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
+else ifdef CONFIG_CC_OPTIMIZE_FOR_DEBUG
+-KBUILD_CFLAGS += -Og
+# Avoid false positives -Wmaybe-uninitialized
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394
+KBUILD_CFLAGS += -Wno-maybe-uninitialized
else
KBUILD_CFLAGS += -O2
endif