[6/7] gdb: remove the explicit ada-exp.o rule

Message ID 20260831185300.572297-7-simon.marchi@efficios.com
State New
Headers
Series Some Makefile cleanups |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Simon Marchi Aug. 31, 2026, 6:51 p.m. UTC
  gdb/Makefile.in has an explicit rule to build ada-exp.o, along with an
ADA_EXP_C variable used to spell out which ada-exp.c to compile:

    # ada-exp.c can appear in srcdir, for releases; or in ., for
    # development builds.
    ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`

    ada-exp.o: ada-exp.c
            $(COMPILE) $(ADA_EXP_C)
            $(POSTCOMPILE)

I don't think that's needed today.

Both were added by commit 94e36acc3c80 (2013-07-10), the point was
to compile ada-exp.c with -Wno-old-style-definition.

Commit 8dc9fd87b096 ("Simplify ada-exp.o rule", 2018-09-01) dropped
-Wold-style-definition, since it has no meaning in C++.  That removed
the reason for the rule to exist, but the rule was kept, on the grounds
that "according to the comment, ada-exp.c may appear in the srcdir".

But this is already by make: srcdir is in VPATH, so the pattern
rule finds ada-exp.c in the build directory if it is there, and in srcdir
otherwise.  It works for all other *-exp.c files.

Remove the rule and ADA_EXP_C, and let the generic pattern rule handle
ada-exp.o.  Remove the comment introducing the section as well, as this
was the last rule in it.

Tested in a development build only, we'll need to test this when
building from a tarball, but that will be done at release time.

Change-Id: Icec556845abe405cd51c8ba2999d7af9ee64db20
---
 gdb/Makefile.in | 11 -----------
 1 file changed, 11 deletions(-)
  

Comments

Tom Tromey Sept. 1, 2026, 4:38 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Remove the rule and ADA_EXP_C, and let the generic pattern rule handle
Simon> ada-exp.o.  Remove the comment introducing the section as well, as this
Simon> was the last rule in it.

Simon> Tested in a development build only, we'll need to test this when
Simon> building from a tarball, but that will be done at release time.

Ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 74361808bf5a..cf10bc17320b 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2609,17 +2609,6 @@  force_update:
 # will remove them.
 MAKEOVERRIDES =
 
-# Some files need explicit build rules (due to -Werror problems) or due
-# to sub-directory fun 'n' games.
-
-# ada-exp.c can appear in srcdir, for releases; or in ., for
-# development builds.
-ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
-
-ada-exp.o: ada-exp.c
-	$(COMPILE) $(ADA_EXP_C)
-	$(POSTCOMPILE)
-
 # Message files.  Based on code in gcc/Makefile.in.
 
 # Rules for generating translated message descriptions.  Disabled by