]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Makefile: repair CONFIG_CC_OPTIMIZE_FOR_DEBUG support
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 31 Dec 2025 19:10:51 +0000 (20:10 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 2 Jan 2026 16:27:18 +0000 (10:27 -0600)
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 <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Makefile

index 6b5c5ee019ea775e6928fd3510ee34fb352994b1..696b502fa163262a0581cc82e1393ecae7b4c7f2 100644 (file)
--- 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