From 96ccff93dddfb7c74e188629dd0b56175b3eabda Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 16 Jun 2022 13:43:50 +0200 Subject: [PATCH] Makefile: respect CONFIG_CC_OPTIMIZE_FOR_DEBUG for host tools 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 --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 93571d37d9..7f7dd81b02 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. -- 2.39.5