aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-06-16 13:43:50 +0200
committerTom Rini <trini@konsulko.com>2022-07-08 09:06:57 -0400
commit9b78c9297b3c9277089c1130363ed6b1bb38f57d (patch)
tree0597afb2be7c9a4272823e2c768086088b4d9d10 /Makefile
parentd1a03e6bbc4e025797af17168b4909b3b14a2590 (diff)
downloadu-boot-9b78c9297b3c9277089c1130363ed6b1bb38f57d.zip
u-boot-9b78c9297b3c9277089c1130363ed6b1bb38f57d.tar.gz
u-boot-9b78c9297b3c9277089c1130363ed6b1bb38f57d.tar.bz2
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 <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 93571d3..7f7dd81 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.