diff mbox series

[1/1] Makefile: respect CONFIG_CC_OPTIMIZE_FOR_DEBUG for host tools

Message ID 20220616114350.119491-1-heinrich.schuchardt@canonical.com
State Accepted
Commit 9b78c9297b3c9277089c1130363ed6b1bb38f57d
Delegated to: Tom Rini
Headers show
Series [1/1] Makefile: respect CONFIG_CC_OPTIMIZE_FOR_DEBUG for host tools | expand

Commit Message

Heinrich Schuchardt June 16, 2022, 11:43 a.m. UTC
If CONFIG_CC_OPTIMIZE_FOR_DEBUG=y, the host tools should be built with
debug symbols and with reduced optimization.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Tom Rini July 8, 2022, 4:38 p.m. UTC | #1
On Thu, Jun 16, 2022 at 01:43:50PM +0200, Heinrich Schuchardt wrote:

> If CONFIG_CC_OPTIMIZE_FOR_DEBUG=y, the host tools should be built with
> debug symbols and with reduced optimization.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 2fa3a3b488..faa01eadd7 100644
--- a/Makefile
+++ b/Makefile
@@ -673,6 +673,12 @@  else
 include/config/auto.conf: ;
 endif # $(dot-config)
 
+ifdef CONFIG_CC_OPTIMIZE_FOR_DEBUG
+KBUILD_HOSTCFLAGS   := -Wall -Wstrict-prototypes -Og -g -fomit-frame-pointer \
+		$(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
+KBUILD_HOSTCXXFLAGS := -Og -g $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
+endif
+
 #
 # Xtensa linker script cannot be preprocessed with -ansi because of
 # preprocessor operations on strings that don't make C identifiers.