Kernel debugging only needs DWARF type information, so the CTF debug info
library is not useful for crash. libbacktrace is only used by gdb to
print a backtrace after a fatal signal, which is not needed for the
embedded gdb.
Pass --disable-libctf and --disable-libbacktrace to drop both libraries
(19 and 33 sources respectively) and the gdb code which links them.
Note that gdb, bfd and opcodes already default to building only the
selected target's support, so --enable-targets is deliberately not used.
Assisted-by: LLM
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2c7573d1c8a9..71d4be4459b1 100644
--- a/Makefile
+++ b/Makefile
@@ -318,6 +318,11 @@ all: make_configure
@$(MAKE) gdb_merge
# @$(MAKE) extensions
+#
+# The embedded gdb is built for the selected target only -- gdb, bfd and
+# opcodes already default to that -- without the full-screen TUI and
+# without the libctf and libbacktrace libraries, none of which crash uses.
+#
gdb_merge: force
@if [ ! -f ${GDB}/README ]; then \
$(MAKE) gdb_unzip; fi
@@ -327,7 +332,7 @@ gdb_merge: force
@if [ ! -f ${GDB}/config.status ]; then \
(cd ${GDB}; ./configure ${GDB_CONF_FLAGS} --with-separate-debug-dir=/usr/lib/debug \
--with-bugurl="" --with-expat=no --with-python=no --disable-sim \
- --disable-tui; \
+ --disable-tui --disable-libctf --disable-libbacktrace; \
$(MAKE) CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
else $(MAKE) rebuild; fi
@if [ ! -f ${PROGRAM} ]; then \
--
2.51.1