Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 6/7] gdb: remove the explicit ada-exp.o rule
Date: Mon, 31 Aug 2026 14:51:45 -0400	[thread overview]
Message-ID: <20260831185300.572297-7-simon.marchi@efficios.com> (raw)
In-Reply-To: <20260831185300.572297-1-simon.marchi@efficios.com>

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(-)

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
-- 
2.55.0


  parent reply	other threads:[~2026-08-31 18:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
2026-08-31 18:51 ` [PATCH 1/7] gdb: update README about the GNU make requirement Simon Marchi
2026-09-01 12:26   ` Eli Zaretskii
2026-09-01 13:36     ` Simon Marchi
2026-08-31 18:51 ` [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback Simon Marchi
2026-09-01 16:32   ` Tom Tromey
2026-09-01 20:16     ` Simon Marchi
2026-09-02  7:37       ` Rainer Orth
2026-09-02 12:26         ` Simon Marchi
2026-08-31 18:51 ` [PATCH 3/7] gdbserver: fix missing dependency tracking for gdbreplay.o Simon Marchi
2026-09-01 16:33   ` Tom Tromey
2026-08-31 18:51 ` [PATCH 4/7] gdb, gdbserver: always use order-only prerequisites for generated files Simon Marchi
2026-09-01 16:34   ` Tom Tromey
2026-08-31 18:51 ` [PATCH 5/7] gdb, gdbserver: remove the .NOEXPORT target Simon Marchi
2026-09-01 16:37   ` Tom Tromey
2026-08-31 18:51 ` Simon Marchi [this message]
2026-09-01 16:38   ` [PATCH 6/7] gdb: remove the explicit ada-exp.o rule Tom Tromey
2026-08-31 18:51 ` [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles Simon Marchi
2026-09-01 16:47   ` Tom Tromey
2026-09-01 20:18     ` Simon Marchi
2026-09-01 20:37       ` Simon Marchi
2026-09-02 18:36         ` Tom Tromey
2026-09-03 13:45           ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260831185300.572297-7-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox