From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 1BFC73858D1E for ; Tue, 14 Feb 2023 16:08:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BFC73858D1E Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com Received: from smarchi-efficios.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5B0D41E0D3; Tue, 14 Feb 2023 11:08:36 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: remove --disable-gdbmi configure option Date: Tue, 14 Feb 2023 11:08:34 -0500 Message-Id: <20230214160834.130626-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3497.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I noticed that the --disable-gdbmi option was broken for almost a year (since 740b42ceb7c "gdb/python/mi: create MI commands using python"). The problem today is the python/py-cmd.c file. It is included in the build if Python support is enabled, and it calls into some MI functions (e.g. insert_mi_cmd_entry). If MI support is disabled, we get some undefined symbols like: mold: error: undefined symbol: insert_mi_cmd_entry(std::unique_ptr >) >>> referenced by py-micmd.c >>> python/py-micmd.o:(micmdpy_install_command(micmdpy_object*)) The python/py-cmd.c file should be included in the build if both Python and MI support are enabled. It is not a case we support today, but it could be done with a bit more configure code. However, I think we should just remove the --disable-gdbmi option, and just include MI support unconditionally. Tom Tromey proposed a while ago to remove this option, but it ended staying: https://inbox.sourceware.org/gdb-patches/20180628172132.28843-1-tom@tromey.com/ However, there was no strong opposition to remove it. The argument was just "bah, it doesn't hurt anybody". But given today's case, I would rather remove complexity rather than add some. I couldn't find anybody caring deeply for that option, and it's not like MI adds any external dependency. It's just a bit more code. Removing the option will not break anybody using --disable-gdbmi (it can be found in many build scripts [1]), since we don't flag invalid configure flags. So, remove the option from configure.ac, and adjust Makefile.in accordingly to always include the MI objects in the build. [1] https://github.com/search?q=%22--disable-gdbmi%22&type=code Change-Id: Ifcaa8c9fc4abc6fa686ed5fd984598644f745240 --- gdb/Makefile.in | 8 +++----- gdb/configure.ac | 14 -------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index dac5a66e9ada..b9fa0470fda2 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -293,6 +293,7 @@ SUBDIR_MI_SRCS = \ mi/mi-cmd-target.c \ mi/mi-cmd-var.c \ mi/mi-cmds.c \ + mi/mi-common.c \ mi/mi-console.c \ mi/mi-getopt.c \ mi/mi-interp.c \ @@ -303,10 +304,6 @@ SUBDIR_MI_SRCS = \ SUBDIR_MI_OBS = $(patsubst %.c,%.o,$(SUBDIR_MI_SRCS)) -SUBDIR_MI_DEPS = -SUBDIR_MI_LDFLAGS = -SUBDIR_MI_CFLAGS = - # # TUI sub directory definitions # @@ -1249,8 +1246,8 @@ SFILES = \ stub-termcap.c \ symfile-mem.c \ ui-file.h \ - mi/mi-common.c \ $(SUBDIR_CLI_SRCS) \ + $(SUBDIR_MI_SRCS) \ $(SUBDIR_TARGET_SRCS) \ $(COMMON_SFILES) \ $(SUBDIR_GCC_COMPILE_SRCS) @@ -1860,6 +1857,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ xml-builtin.o \ $(patsubst %.c,%.o,$(COMMON_SFILES)) \ $(SUBDIR_CLI_OBS) \ + $(SUBDIR_MI_OBS) \ $(SUBDIR_TARGET_OBS) \ $(SUBDIR_GCC_COMPILE_OBS) diff --git a/gdb/configure.ac b/gdb/configure.ac index 47e35f467f8e..6874767ea095 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -318,20 +318,6 @@ if test "x$targ_defvec" != x; then [Define to BFD's default target vector. ]) fi -# Enable MI. -AC_ARG_ENABLE([gdbmi], - [AS_HELP_STRING([--disable-gdbmi], [disable machine-interface (MI)])], - [GDB_CHECK_YES_NO_VAL([$enableval], [--enable-gdbmi])], - [enable_gdbmi=yes]) -if test x"$enable_gdbmi" = xyes; then - if test -d "$srcdir/mi"; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)" - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)" - fi -fi - # Enable TUI. AC_ARG_ENABLE(tui, AS_HELP_STRING([--enable-tui], -- 2.39.1