Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/7] Some Makefile cleanups
@ 2026-08-31 18:51 Simon Marchi
  2026-08-31 18:51 ` [PATCH 1/7] gdb: update README about the GNU make requirement Simon Marchi
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

This series fixes a few problems about the Makefile and removes some
things that are not needed anymore.

Simon Marchi (7):
  gdb: update README about the GNU make requirement
  gdb, gdbserver: require gcc-style dependency generation, drop the
    depcomp fallback
  gdbserver: fix missing dependency tracking for gdbreplay.o
  gdb, gdbserver: always use order-only prerequisites for generated
    files
  gdb, gdbserver: remove the .NOEXPORT target
  gdb: remove the explicit ada-exp.o rule
  gdb, gdbserver: create the dependency directories from the Makefiles

 gdb/Makefile.in        |  86 ++++++++---------------------
 gdb/README             |  15 +++---
 gdb/configure          | 107 +-----------------------------------
 gdb/configure.ac       |   3 +-
 gdbserver/Makefile.in  |  68 ++++++++---------------
 gdbserver/configure    | 119 -----------------------------------------
 gdbserver/configure.ac |  15 +-----
 7 files changed, 55 insertions(+), 358 deletions(-)


base-commit: 2ebc80f3895c683db0a2fd9dc2cdd76ba830ccc8
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 1/7] gdb: update README about the GNU make requirement
  2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
@ 2026-08-31 18:51 ` Simon Marchi
  2026-09-01 12:26   ` Eli Zaretskii
  2026-08-31 18:51 ` [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback Simon Marchi
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

The README still suggests that GDB can be built with a make other than GNU
make, which is not the case since 2016 (f2ff9acd32b4 "Document new hard
requirement on GNU make").

The manual already lists GNU make in the requirements:

    GNU make
        GDB's build system relies on features only found in the GNU make
        program.  Other variants of make will not work.

and the minimum version is documented in gdb/NEWS:

    * Building GDB and GDBserver now requires GNU make >= 3.82.

Bring the README in line with that.

 - Mention the GNU make requirement, including the minimum version, near
   where we also state the C++17 compiler requirement.

 - Drop the "if your make program handles the VPATH feature correctly"
   part from the "Compiling GDB in another directory" section.

 - Drop the warning about --srcdir requiring GNU make.

 - Drop the "If you use GNU make" conditional from the paragraph about
   running the testsuite in parallel.

Change-Id: I5c0387d977ab87069c01c0249c51b2f30318a0c7
---
 gdb/README | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/gdb/README b/gdb/README
index 492b0891668d..791bbd23b6c2 100644
--- a/gdb/README
+++ b/gdb/README
@@ -82,6 +82,9 @@ list of options, invoke the subdirectory `configure', like:
    (Take note of how this differs from the invocation used to actually
 configure the build tree.)
 
+   Building GDB requires GNU make version 3.82 or later; other `make'
+programs will not work.
+
    GDB requires a C++17 compiler.  If you do not have a
 C++17 compiler for your system, you may be able to download and install
 the GNU CC compiler.  It is available via anonymous FTP from the
@@ -254,10 +257,8 @@ Compiling GDB in another directory
 you need a different `gdb' compiled for each combination of host and
 target.  `configure' is designed to make this easy by allowing you to
 generate each configuration in a separate subdirectory, rather than in
-the source directory.  If your `make' program handles the `VPATH'
-feature correctly (GNU `make' and SunOS 'make' are two that should),
-running `make' in each of these directories builds the `gdb' program
-specified there.
+the source directory.  Running `make' in each of these directories
+builds the `gdb' program specified there.
 
    To build `gdb' in a separate directory, run `configure' with the
 `--srcdir' option to specify where to find the source. (You also need
@@ -367,8 +368,6 @@ more obscure GDB `configure' options are not listed here.
      `DIR'.
 
 `--srcdir=PATH'
-     *Warning: using this option requires GNU `make', or another `make'
-     that compatibly implements the `VPATH' feature.*
      Use this option to make configurations in directories separate
      from the GDB source directories.  Among other things, you can use
      this to build (or maintain) several configurations simultaneously,
@@ -778,8 +777,8 @@ When using a `make'-based method, you can use the Makefile variable
 
 	make RUNTESTFLAGS=--directory=gdb.cp check
 
-If you use GNU make, you can use its `-j' option to run the testsuite
-in parallel.  This can greatly reduce the amount of time it takes for
+You can use the `-j' option of `make' to run the testsuite in
+parallel.  This can greatly reduce the amount of time it takes for
 the testsuite to run.  In this case, if you set `RUNTESTFLAGS' then,
 by default, the tests will be run serially even under `-j'.  You can
 override this and force a parallel run by setting the `make' variable
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback
  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-08-31 18:51 ` Simon Marchi
  2026-09-01 16:32   ` Tom Tromey
  2026-08-31 18:51 ` [PATCH 3/7] gdbserver: fix missing dependency tracking for gdbreplay.o Simon Marchi
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

gdb/Makefile.in and gdbserver/Makefile.in have similar code to do manual
gcc3-style dependency tracking, or fallback to the depcomp tool for
other dependency tracking modes.  I believe that in this day and age, we
can assume that all compilers we support know about gcc3-style
dependency tracking.

Obviously, gcc and clang both know about it.  The other compilers I am
aware of (I don't even know if they can build GDB) are Intel icc and IBM
XL, and they both appear to have known about it for a while.

I therefore propose to get rid of the fallback, which results in simpler
Makefiles.

In both directories, remove the depcomp fallback branch and merge the gcc3
definitions into the base COMPILE.post and POSTCOMPILE definitions.

The DEPMODE and depcomp variables are not needed anymore.

Remove the ZW_PROG_COMPILER_DEPENDENCIES calls in the configure.ac
files, which were used to probe for the supported dependency mechanisme
and substitute @CCDEPMODE@.

ZW_CREATE_DEPDIR is still needed: it is what creates the top-level
dependency directory from config.status.  It also sets the DEPDIR
variable indirectly, via AM_SET_DEPDIR.

Change-Id: I2e0a42156af571e7147c83852fc9536b50af7c2e
---
 gdb/Makefile.in        |  30 +++---------
 gdb/configure          | 101 +----------------------------------------
 gdb/configure.ac       |   1 -
 gdbserver/Makefile.in  |  30 +++---------
 gdbserver/configure    |  98 ---------------------------------------
 gdbserver/configure.ac |   2 -
 6 files changed, 16 insertions(+), 246 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index c6bfc2949fcc..5741ee5e2e92 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -103,9 +103,7 @@ CXX = @CXX@
 CXX_DIALECT = @CXX_DIALECT@
 
 # Dependency tracking information.
-DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
-depcomp = $(SHELL) $(srcdir)/../depcomp
 
 # Directory containing source files.
 srcdir = @srcdir@
@@ -114,11 +112,14 @@ top_srcdir = @top_srcdir@
 
 include $(srcdir)/silent-rules.mk
 
-# Note that these are overridden by GNU make-specific code below if
-# GNU make is used.  The overrides implement dependency tracking.
+# Note that we put the dependencies into a .Tpo file, then move them into
+# place if the compile succeeds.  We need this because gcc does not
+# atomically write the dependency output file.
 COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
-COMPILE.post = -c -o $@
-POSTCOMPILE = @true
+COMPILE.post = -c -o $@ \
+	-MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
+POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
+	$(@D)/$(DEPDIR)/$(basename $(@F)).Po
 
 # CXXFLAGS is at the very end on purpose, so that user-supplied flags can
 # override internal flags.
@@ -2828,23 +2829,6 @@ all_gdbtk_cflags = $(IDE_CFLAGS) $(ITCL_CFLAGS) \
 # Dependency tracking.
 #
 
-ifeq ($(DEPMODE),depmode=gcc3)
-# Note that we put the dependencies into a .Tpo file, then move them
-# into place if the compile succeeds.  We need this because gcc does
-# not atomically write the dependency output file.
-override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-	-MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
-override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
-	$(@D)/$(DEPDIR)/$(basename $(@F)).Po
-else
-override COMPILE.pre = source='$<' object='$@' libtool=no \
-	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
-	$(CXX) -x c++ $(CXX_DIALECT)
-# depcomp handles atomicity for us, so we don't need a postcompile
-# step.
-override POSTCOMPILE =
-endif
-
 # A list of all the objects we might care about in this build, for
 # dependency tracking.
 all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
diff --git a/gdb/configure b/gdb/configure
index 7dc7781cb09f..94cc893a8715 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -795,7 +795,6 @@ SET_MAKE
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
-CCDEPMODE
 DEPDIR
 am__leading_dot
 LTLIBXXHASH
@@ -11878,7 +11877,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11881 "configure"
+#line 11880 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11984,7 +11983,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11987 "configure"
+#line 11986 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -22700,102 +22699,6 @@ DEPDIR="${am__leading_dot}deps"
 ac_config_commands="$ac_config_commands depdir"
 
 
-depcc="$CC"   am_compiler_list=
-
-am_depcomp=$ac_aux_dir/depcomp
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    if test $depmode = none; then break; fi
-
-    $as_echo "$as_me:$LINENO: trying $depmode" >&5
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "include sub/conftest.Po" > confmf
-
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    depcmd="depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c"
-    echo "| $depcmd" | sed -e 's/  */ /g' >&5
-    if env $depcmd > conftest.err 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 &&
-       ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-	$as_echo "$as_me:$LINENO: success" >&5
-        break
-      fi
-    fi
-    $as_echo "$as_me:$LINENO: failure, diagnostics are:" >&5
-    sed -e 's/^/| /' < conftest.err >&5
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-if test x${am_cv_CC_dependencies_compiler_type-none} = xnone
-then as_fn_error $? "no usable dependency style found" "$LINENO" 5
-else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-fi
-
 
 # Since the first call to PKG_CHECK_MODULES may not happen (is guarded by
 # a condition), we must call PKG_PROG_PKG_CONFIG explicitly to probe for
diff --git a/gdb/configure.ac b/gdb/configure.ac
index c70aa30fc96a..d8b2498f415b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -61,7 +61,6 @@ GDB_AC_COMMON
 
 # Dependency checking.
 ZW_CREATE_DEPDIR
-ZW_PROG_COMPILER_DEPENDENCIES([CC])
 
 # Since the first call to PKG_CHECK_MODULES may not happen (is guarded by
 # a condition), we must call PKG_PROG_PKG_CONFIG explicitly to probe for
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index e45c89dc321d..b06e0b86e45b 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -48,9 +48,7 @@ AR_FLAGS = rc
 STRIP = @STRIP@
 
 # Dependency tracking information.
-DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
-depcomp = $(SHELL) $(srcdir)/../depcomp
 
 # Directory containing source files.  Don't clean up the spacing,
 # this exact string is matched for by the "configure" script.
@@ -63,11 +61,14 @@ top_builddir = .
 
 include $(srcdir)/../gdb/silent-rules.mk
 
-# Note that these are overridden by GNU make-specific code below if
-# GNU make is used.  The overrides implement dependency tracking.
+# Note that we put the dependencies into a .Tpo file, then move them into
+# place if the compile succeeds.  We need this because gcc does not
+# atomically write the dependency output file.
 COMPILE.pre = $(CXX) $(CXX_DIALECT)
-COMPILE.post = -c -o $@
-POSTCOMPILE = @true
+COMPILE.post = -c -o $@ \
+	-MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
+POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
+	$(@D)/$(DEPDIR)/$(basename $(@F)).Po
 
 INCLUDE_SERVER_H = -include $(srcdir)/server.h
 
@@ -596,23 +597,6 @@ gdbreplay.o: gdbreplay.cc
 # Dependency tracking.
 #
 
-ifeq ($(DEPMODE),depmode=gcc3)
-# Note that we put the dependencies into a .Tpo file, then move them
-# into place if the compile succeeds.  We need this because gcc does
-# not atomically write the dependency output file.
-override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-	-MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
-override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
-	$(@D)/$(DEPDIR)/$(basename $(@F)).Po
-else
-override COMPILE.pre = source='$<' object='$@' libtool=no \
-	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
-	$(CXX) $(CXX_DIALECT)
-# depcomp handles atomicity for us, so we don't need a postcompile
-# step.
-override POSTCOMPILE =
-endif
-
 # A list of all the objects we might care about in this build, for
 # dependency tracking.
 all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
diff --git a/gdbserver/configure b/gdbserver/configure
index 46faecc3a207..3cf8df2c3ae1 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -637,7 +637,6 @@ REPORT_BUGS_TO
 PKGVERSION
 WERROR_CFLAGS
 WARN_CFLAGS
-CCDEPMODE
 CONFIG_SRC_SUBDIR
 CATOBJEXT
 GENCAT
@@ -12821,103 +12820,6 @@ CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
 ac_config_commands="$ac_config_commands gdbdepdir"
 
 
-depcc="$CC"   am_compiler_list=
-
-am_depcomp=$ac_aux_dir/depcomp
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    if test $depmode = none; then break; fi
-
-    $as_echo "$as_me:$LINENO: trying $depmode" >&5
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "include sub/conftest.Po" > confmf
-
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    depcmd="depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c"
-    echo "| $depcmd" | sed -e 's/  */ /g' >&5
-    if env $depcmd > conftest.err 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 &&
-       ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-	$as_echo "$as_me:$LINENO: success" >&5
-        break
-      fi
-    fi
-    $as_echo "$as_me:$LINENO: failure, diagnostics are:" >&5
-    sed -e 's/^/| /' < conftest.err >&5
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-if test x${am_cv_CC_dependencies_compiler_type-none} = xnone
-then as_fn_error $? "no usable dependency style found" "$LINENO" 5
-else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-fi
-
-
 for ac_header in  \
   arpa/inet.h \
   fcntl.h \
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 9979afe7ece9..a549a8712fc1 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -76,8 +76,6 @@ AC_CONFIG_COMMANDS([gdbdepdir],[
   done],
   [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"])
 
-ZW_PROG_COMPILER_DEPENDENCIES([CC])
-
 AC_CHECK_HEADERS([ \
   arpa/inet.h \
   fcntl.h \
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 3/7] gdbserver: fix missing dependency tracking for gdbreplay.o
  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-08-31 18:51 ` [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback Simon Marchi
@ 2026-08-31 18:51 ` 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
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

The rule for gdbreplay.o uses $(COMPILE.post), which makes the
compiler write the dependencies to $(DEPDIR)/gdbreplay.Tpo, but it does
not run $(POSTCOMPILE), which is what renames the .Tpo file to .Po.

After building gdbreplay, we are left with:

    $ make gdbreplay
      CXX    gdbreplay.o
      CXX    utils.o
      GEN    version-generated.cc
      CXX    version.o
      CXXLD  gdbreplay                                                                                  /0.1s
    $ ls -1 .deps
    gdbreplay.Tpo
    utils.Po
    version.Po

This means that a change in a header file included by gdbreplay.cc will
not cause a rebuild.

Add the missing $(POSTCOMPILE) invocation.

Change-Id: Iea5ca939cf30a0fe892ed3d2c224d22f227f0272
---
 gdbserver/Makefile.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index b06e0b86e45b..3a3c8e62d14f 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -592,6 +592,7 @@ target/%.o: ../gdb/target/%.c
 gdbreplay.o: gdbreplay.cc
 	$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) \
 		-include gdbsupport/common-defs.h $(COMPILE.post) $<
+	$(POSTCOMPILE)
 
 #
 # Dependency tracking.
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 4/7] gdb, gdbserver: always use order-only prerequisites for generated files
  2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
                   ` (2 preceding siblings ...)
  2026-08-31 18:51 ` [PATCH 3/7] gdbserver: fix missing dependency tracking for gdbreplay.o Simon Marchi
@ 2026-08-31 18:51 ` 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
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Both gdb/Makefile.in and gdbserver/Makefile.in guard their use of
order-only prerequisites behind a check for the .VARIABLES variable,
falling back to a normal prerequisite when it is not defined:

    # Ensure that generated files are created early.  Use order-only
    # dependencies if available.  They require GNU make 3.80 or newer,
    # and the .VARIABLES variable was introduced at the same time.
    ifdef .VARIABLES
    $(all_object_files): | $(generated_files)
    else
    $(all_object_files) : $(generated_files)
    endif

Building GDB requires GNU make >= 3.82, as documented in gdb/NEWS and
(as of the previous patch) in gdb/README.  On top of that,
gdb/Makefile.in already uses an order-only prerequisite unconditionally,
in the rule for compiling .c files in the top-level gdb directory:

    %.o: %.c | $(CONFIG_DEP_SUBDIR)

Remove the conditional and trim the comment accordingly.

Change-Id: Ic5cca15f21dc1a4908f978c788f416780ea1b5cd
---
 gdb/Makefile.in       | 8 +-------
 gdbserver/Makefile.in | 8 +-------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5741ee5e2e92..cdf73ec708e0 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2837,14 +2837,8 @@ all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
     $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
 
-# Ensure that generated files are created early.  Use order-only
-# dependencies if available.  They require GNU make 3.80 or newer,
-# and the .VARIABLES variable was introduced at the same time.
-ifdef .VARIABLES
+# Ensure that generated files are created early.
 $(all_object_files): | $(generated_files)
-else
-$(all_object_files) : $(generated_files)
-endif
 
 # Dependencies.
 -include $(all_deps_files)
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 3a3c8e62d14f..7c6ab64196e2 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -602,14 +602,8 @@ gdbreplay.o: gdbreplay.cc
 # dependency tracking.
 all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
 
-# Ensure that generated files are created early.  Use order-only
-# dependencies if available.  They require GNU make 3.80 or newer,
-# and the .VARIABLES variable was introduced at the same time.
-ifdef .VARIABLES
+# Ensure that generated files are created early.
 $(all_object_files): | $(generated_files)
-else
-$(all_object_files) : $(generated_files)
-endif
 
 # All the .deps files to include.
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 5/7] gdb, gdbserver: remove the .NOEXPORT target
  2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
                   ` (3 preceding siblings ...)
  2026-08-31 18:51 ` [PATCH 4/7] gdb, gdbserver: always use order-only prerequisites for generated files Simon Marchi
@ 2026-08-31 18:51 ` Simon Marchi
  2026-09-01 16:37   ` Tom Tromey
  2026-08-31 18:51 ` [PATCH 6/7] gdb: remove the explicit ada-exp.o rule Simon Marchi
  2026-08-31 18:51 ` [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles Simon Marchi
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

gdb/Makefile.in and gdbserver/Makefile.in both contain:

    # GNU Make has an annoying habit of putting *all* the Makefile variables
    # into the environment, unless you include this target as a circumvention.
    # Rumor is that this will be fixed (and this target can be removed)
    # in GNU Make 4.0.
    .NOEXPORT:

This was introduced in gdb in commit 625453dcfda0 ("Merge in irix
support", 1991-08-31), and copied to gdbserver's Makefile.in when it was
created, in commit c033ec179a2a (1993-08-27).

It was a legitimate workaround at the time, but only for a few months.
GNU make commit b8d48ad379dc, from 1992-05-03, removed the handling of
.NOEXPORT:

    -  int noexport = enter_file (".NOEXPORT")->is_target;
    ...
    -	      /* If `.NOEXPORT' was specified, only export command-line and
    -		 environment variables.  This is a temporary (very ugly) hack
    -		 until I fix this problem the right way in version 4.  Ick.  */

So .NOEXPORT has done nothing for any GNU make for a very long time,
remove it.

Change-Id: I173807df18447d3ae2f6728ccb711d43d1f9d307
---
 gdb/Makefile.in       | 6 ------
 gdbserver/Makefile.in | 6 ------
 2 files changed, 12 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index cdf73ec708e0..74361808bf5a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2604,12 +2604,6 @@ gdb.cxref: $(SFILES)
 
 force_update:
 
-# GNU Make has an annoying habit of putting *all* the Makefile variables
-# into the environment, unless you include this target as a circumvention.
-# Rumor is that this will be fixed (and this target can be removed)
-# in GNU Make 4.0.
-.NOEXPORT:
-
 # GNU Make 3.63 has a different problem: it keeps tacking command line
 # overrides onto the definition of $(MAKE).  This variable setting
 # will remove them.
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 7c6ab64196e2..5054597bf6ef 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -473,12 +473,6 @@ stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
 
 .PRECIOUS: xml-builtin.cc
 
-# GNU Make has an annoying habit of putting *all* the Makefile variables
-# into the environment, unless you include this target as a circumvention.
-# Rumor is that this will be fixed (and this target can be removed)
-# in GNU Make 4.0.
-.NOEXPORT:
-
 # GNU Make 3.63 has a different problem: it keeps tacking command line
 # overrides onto the definition of $(MAKE).  This variable setting
 # will remove them.
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 6/7] gdb: remove the explicit ada-exp.o rule
  2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
                   ` (4 preceding siblings ...)
  2026-08-31 18:51 ` [PATCH 5/7] gdb, gdbserver: remove the .NOEXPORT target Simon Marchi
@ 2026-08-31 18:51 ` Simon Marchi
  2026-09-01 16:38   ` Tom Tromey
  2026-08-31 18:51 ` [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles Simon Marchi
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles
  2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
                   ` (5 preceding siblings ...)
  2026-08-31 18:51 ` [PATCH 6/7] gdb: remove the explicit ada-exp.o rule Simon Marchi
@ 2026-08-31 18:51 ` Simon Marchi
  2026-09-01 16:47   ` Tom Tromey
  6 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-08-31 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Some .deps directories are created at configure time:

 - gdb/configure.ac and gdbserver/configure.ac call ZW_CREATE_DEPDIR,
   which creates the top-level one from config.status.

 - gdbserver/configure.ac has an additional AC_CONFIG_COMMANDS to create
   the .deps dirs for its subdirectories listed in CONFIG_SRC_SUBDIR
   (arch, gdbsupport, nat and target).

Meanwhile, gdb creates the sub-directory ones from the Makefile, through an
order-only prerequisite on the rule for compiling .c files.

If the user deletes a .deps directory created by configure
(config.status, really), then the build breaks:

    $ rm -rf gdb/.deps
    $ make
      CXX    gdb.o
    gdb.c:39:1: fatal error: opening dependency file ./.deps/gdb.Tpo: No such file or directory

On the other hand, it works for those .deps created by a Makefile (they
are re-created as needed).

This patch changes how we create .deps directories to make it simpler,
more robust and consistent.

In both gdb and gdbserver:

 - Add an ALL_DEPDIRS variable, listing the .deps directories, and a
   rule to create them.

 - Make ALL_DEPDIRS an order-only prerequisite of $(all_object_files),
   such that the .deps directories will be created before compiling any
   .o file.

 - Since we now have a variable (ALL_DEPDIRS) listing all .deps
   directories, use it where convenient in the clean and distclean
   targets.

Note that this changes the command to create directories from "$(SHELL)
$(srcdir)/../install-sh -d" to "mkdir -p".  If there is a reason to use
install-sh to create directories in the build directory, I think it
should be documented, otherwise it just looks strange.

The configure-time creation is not needed anymore.  Replace the
ZW_CREATE_DEPDIR calls with AM_SET_DEPDIR, which is what actually
provides DEPDIR, and drop gdbserver's gdbdepdir AC_CONFIG_COMMANDS.

That leaves gdbserver's CONFIG_SRC_SUBDIR with no user in configure, so
define it directly in gdbserver/Makefile.in, like gdb already does.

Change-Id: I71e76a9a37a525f58c9c66e5556e8da965cc2ca3
---
 gdb/Makefile.in        | 33 +++++++++++++++------------------
 gdb/configure          |  6 ------
 gdb/configure.ac       |  2 +-
 gdbserver/Makefile.in  | 25 ++++++++++++++-----------
 gdbserver/configure    | 21 ---------------------
 gdbserver/configure.ac | 13 +------------
 6 files changed, 31 insertions(+), 69 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index cf10bc17320b..3585f2015ff0 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -590,7 +590,6 @@ HAVE_GSTACK = @HAVE_GSTACK@
 
 CONFIG_SRC_SUBDIR = arch cli dwarf2 mi compile tui unittests guile python \
 	target nat gdbtk/generic
-CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 
 # -I. for config files.
 # -I$(srcdir) for gdb internal headers.
@@ -2092,15 +2091,11 @@ PYTHON_CFLAGS = @PYTHON_CFLAGS@
 all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.gdb gcore gstack gdb-add-index
 	@$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=$(SUBDIRS)" subdir_do
 
-# Rule for compiling .c files in the top-level gdb directory.
-# The order-only dependencies ensure that we create the build subdirectories.
-%.o: %.c | $(CONFIG_DEP_SUBDIR)
+# Rule for compiling .c files.
+%.o: %.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-$(CONFIG_DEP_SUBDIR):
-	$(ECHO_GEN) $(SHELL) $(srcdir)/../install-sh -d $@
-
 # Python files need special flags.
 python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
 
@@ -2413,11 +2408,8 @@ clean mostlyclean: $(CONFIG_CLEAN)
 	rm -f gdb$(EXEEXT) core make.log
 	rm -f gdb[0-9]$(EXEEXT)
 	rm -f xml-builtin.c stamp-xml
-	rm -f $(DEPDIR)/*
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		rm -f $$i/*.o;	\
-		rm -f $$i/$(DEPDIR)/*; \
-	done
+	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
+	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
 
 # This used to depend on c-exp.c m2-exp.c TAGS
 # I believe this is wrong; the makefile standards for distclean just
@@ -2431,10 +2423,7 @@ distclean: clean
 	rm -f config.log config.cache
 	rm -f config.lt libtool
 	rm -f Makefile
-	rm -rf $(DEPDIR)
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \
-	done
+	rm -rf $(ALL_DEPDIRS)
 
 maintainer-clean: local-maintainer-clean do-maintainer-clean distclean
 realclean: maintainer-clean
@@ -2816,12 +2805,20 @@ all_gdbtk_cflags = $(IDE_CFLAGS) $(ITCL_CFLAGS) \
 # dependency tracking.
 all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
 
+# All the directories in which we put dependency files.
+ALL_DEPDIRS = $(DEPDIR) $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+
+$(ALL_DEPDIRS):
+	$(ECHO_GEN) mkdir -p $@
+
 # All the .deps files to include.
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
     $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
 
-# Ensure that generated files are created early.
-$(all_object_files): | $(generated_files)
+# Ensure that the generated files and the dependency directories are created
+# early.  Creating a dependency directory also creates the directory the
+# objects go in.
+$(all_object_files): | $(generated_files) $(ALL_DEPDIRS)
 
 # Dependencies.
 -include $(all_deps_files)
diff --git a/gdb/configure b/gdb/configure
index 94cc893a8715..4078a8af9f4a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -22696,9 +22696,6 @@ rmdir .tst 2>/dev/null
 
 DEPDIR="${am__leading_dot}deps"
 
-ac_config_commands="$ac_config_commands depdir"
-
-
 
 # Since the first call to PKG_CHECK_MODULES may not happen (is guarded by
 # a condition), we must call PKG_PROG_PKG_CONFIG explicitly to probe for
@@ -34692,7 +34689,6 @@ fi
 ac_aux_dir='$ac_aux_dir'
 
 
-ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
     # from automake.
@@ -34712,7 +34708,6 @@ do
   case $ac_config_target in
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
     "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
     "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
@@ -36161,7 +36156,6 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
 _LT_EOF
 
  ;;
-    "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "default-1":C)
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index d8b2498f415b..f15a2e16947c 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -60,7 +60,7 @@ AX_CXX_COMPILE_STDCXX(17, , mandatory)
 GDB_AC_COMMON
 
 # Dependency checking.
-ZW_CREATE_DEPDIR
+AM_SET_DEPDIR
 
 # Since the first call to PKG_CHECK_MODULES may not happen (is guarded by
 # a condition), we must call PKG_PROG_PKG_CONFIG explicitly to probe for
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 5054597bf6ef..9417a93268cd 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -27,7 +27,7 @@ program_transform_name = @program_transform_name@
 bindir = @bindir@
 libdir = @libdir@
 
-CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
+CONFIG_SRC_SUBDIR = arch gdbsupport nat target
 
 install_sh = @install_sh@
 
@@ -428,17 +428,12 @@ mostlyclean clean:
 	rm -f $(IPA_LIB)
 	rm -f *-generated.cc
 	rm -f stamp-xml
-	rm -f $(DEPDIR)/*.Po
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		rm -f $$i/*.o;	\
-		rm -f $$i/$(DEPDIR)/*; \
-	done
+	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
+	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
 
 maintainer-clean realclean distclean: clean
 	rm -f Makefile config.status config.h stamp-h config.log config.cache
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		rmdir $$i/$(DEPDIR); \
-	done
+	rm -rf $(ALL_DEPDIRS)
 
 config.h: stamp-h ; @true
 stamp-h: config.in config.status
@@ -596,8 +591,16 @@ gdbreplay.o: gdbreplay.cc
 # dependency tracking.
 all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
 
-# Ensure that generated files are created early.
-$(all_object_files): | $(generated_files)
+# All the directories in which we put dependency files.
+ALL_DEPDIRS = $(DEPDIR) $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+
+$(ALL_DEPDIRS):
+	$(ECHO_GEN) mkdir -p $@
+
+# Ensure that the generated files and the dependency directories are created
+# early.  Creating a dependency directory also creates the directory the
+# objects go in.
+$(all_object_files): | $(generated_files) $(ALL_DEPDIRS)
 
 # All the .deps files to include.
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
diff --git a/gdbserver/configure b/gdbserver/configure
index 3cf8df2c3ae1..dd749fcb55bc 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -637,7 +637,6 @@ REPORT_BUGS_TO
 PKGVERSION
 WERROR_CFLAGS
 WARN_CFLAGS
-CONFIG_SRC_SUBDIR
 CATOBJEXT
 GENCAT
 INSTOBJEXT
@@ -10956,9 +10955,6 @@ rmdir .tst 2>/dev/null
 
 DEPDIR="${am__leading_dot}deps"
 
-ac_config_commands="$ac_config_commands depdir"
-
-
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
@@ -12813,13 +12809,6 @@ $as_echo "$LINGUAS" >&6; }
 
 fi
 
-# Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
-
-
-ac_config_commands="$ac_config_commands gdbdepdir"
-
-
 for ac_header in  \
   arpa/inet.h \
   fcntl.h \
@@ -15459,7 +15448,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
     # from automake.
@@ -15467,7 +15455,6 @@ ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
     # Capture the value of LINGUAS because we need it to compute CATALOGS.
     LINGUAS="${LINGUAS-%UNSET%}"
 
-ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"
 
 _ACEOF
 
@@ -15478,9 +15465,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
-    "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
-    "gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -16038,7 +16023,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "config.h":H) echo > stamp-h ;;
-    "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "default-1":C)
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
@@ -16140,11 +16124,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
         ;;
       esac
     done ;;
-    "gdbdepdir":C)
-  for subdir in ${CONFIG_SRC_SUBDIR}
-  do
-      $SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR
-  done ;;
 
   esac
 done # for ac_tag
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index a549a8712fc1..f1466e8568d4 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -60,22 +60,11 @@ ACX_NONCANONICAL_TARGET
 ACX_NONCANONICAL_HOST
 
 # Dependency checking.
-ZW_CREATE_DEPDIR
+AM_SET_DEPDIR
 
 dnl Set up for gettext.
 ZW_GNU_GETTEXT_SISTER_DIR
 
-# Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
-AC_SUBST(CONFIG_SRC_SUBDIR)
-
-AC_CONFIG_COMMANDS([gdbdepdir],[
-  for subdir in ${CONFIG_SRC_SUBDIR}
-  do
-      $SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR
-  done],
-  [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"])
-
 AC_CHECK_HEADERS([ \
   arpa/inet.h \
   fcntl.h \
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/7] gdb: update README about the GNU make requirement
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2026-09-01 12:26 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

> From: Simon Marchi <simon.marchi@efficios.com>
> Cc: Simon Marchi <simon.marchi@efficios.com>
> Date: Mon, 31 Aug 2026 14:51:40 -0400
> 
> The README still suggests that GDB can be built with a make other than GNU
> make, which is not the case since 2016 (f2ff9acd32b4 "Document new hard
> requirement on GNU make").
> 
> The manual already lists GNU make in the requirements:
> 
>     GNU make
>         GDB's build system relies on features only found in the GNU make
>         program.  Other variants of make will not work.
> 
> and the minimum version is documented in gdb/NEWS:
> 
>     * Building GDB and GDBserver now requires GNU make >= 3.82.
> 
> Bring the README in line with that.
> 
>  - Mention the GNU make requirement, including the minimum version, near
>    where we also state the C++17 compiler requirement.
> 
>  - Drop the "if your make program handles the VPATH feature correctly"
>    part from the "Compiling GDB in another directory" section.
> 
>  - Drop the warning about --srcdir requiring GNU make.
> 
>  - Drop the "If you use GNU make" conditional from the paragraph about
>    running the testsuite in parallel.
> 
> Change-Id: I5c0387d977ab87069c01c0249c51b2f30318a0c7
> ---
>  gdb/README | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)

Thanks, this is okay.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/7] gdb: update README about the GNU make requirement
  2026-09-01 12:26   ` Eli Zaretskii
@ 2026-09-01 13:36     ` Simon Marchi
  0 siblings, 0 replies; 23+ messages in thread
From: Simon Marchi @ 2026-09-01 13:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches



On 2026-09-01 08:26, Eli Zaretskii wrote:
>> From: Simon Marchi <simon.marchi@efficios.com>
>> Cc: Simon Marchi <simon.marchi@efficios.com>
>> Date: Mon, 31 Aug 2026 14:51:40 -0400
>>
>> The README still suggests that GDB can be built with a make other than GNU
>> make, which is not the case since 2016 (f2ff9acd32b4 "Document new hard
>> requirement on GNU make").
>>
>> The manual already lists GNU make in the requirements:
>>
>>     GNU make
>>         GDB's build system relies on features only found in the GNU make
>>         program.  Other variants of make will not work.
>>
>> and the minimum version is documented in gdb/NEWS:
>>
>>     * Building GDB and GDBserver now requires GNU make >= 3.82.
>>
>> Bring the README in line with that.
>>
>>  - Mention the GNU make requirement, including the minimum version, near
>>    where we also state the C++17 compiler requirement.
>>
>>  - Drop the "if your make program handles the VPATH feature correctly"
>>    part from the "Compiling GDB in another directory" section.
>>
>>  - Drop the warning about --srcdir requiring GNU make.
>>
>>  - Drop the "If you use GNU make" conditional from the paragraph about
>>    running the testsuite in parallel.
>>
>> Change-Id: I5c0387d977ab87069c01c0249c51b2f30318a0c7
>> ---
>>  gdb/README | 15 +++++++--------
>>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> Thanks, this is okay.
> 
> Reviewed-By: Eli Zaretskii <eliz@gnu.org>

Thanks, I have pushed this single patch.

Simon

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Tom Tromey @ 2026-09-01 16:32 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> gdb/Makefile.in and gdbserver/Makefile.in have similar code to do manual
Simon> gcc3-style dependency tracking, or fallback to the depcomp tool for
Simon> other dependency tracking modes.  I believe that in this day and age, we
Simon> can assume that all compilers we support know about gcc3-style
Simon> dependency tracking.

Simon> Obviously, gcc and clang both know about it.  The other compilers I am
Simon> aware of (I don't even know if they can build GDB) are Intel icc and IBM
Simon> XL, and they both appear to have known about it for a while.

I wonder if the Windows or Solaris compilers work.

Anyway, I'm fine with this.  I tend to doubt anybody uses anything else,
on the theory that if they did, we'd probably have seen patches to work
around problems.  I suppose we can revert this or just ask people to
write wrapper scripts for any compiler not supporting this feature.

The depcomp stuff was more important for C and the olden times when
other compilers were in use.

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

Tom

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 3/7] gdbserver: fix missing dependency tracking for gdbreplay.o
  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
  0 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2026-09-01 16:33 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> The rule for gdbreplay.o uses $(COMPILE.post), which makes the
Simon> compiler write the dependencies to $(DEPDIR)/gdbreplay.Tpo, but it does
Simon> not run $(POSTCOMPILE), which is what renames the .Tpo file to .Po.

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

Tom

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 4/7] gdb, gdbserver: always use order-only prerequisites for generated files
  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
  0 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2026-09-01 16:34 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Both gdb/Makefile.in and gdbserver/Makefile.in guard their use of
Simon> order-only prerequisites behind a check for the .VARIABLES variable,
Simon> falling back to a normal prerequisite when it is not defined:
...
Simon> Remove the conditional and trim the comment accordingly.

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

Tom

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 5/7] gdb, gdbserver: remove the .NOEXPORT target
  2026-08-31 18:51 ` [PATCH 5/7] gdb, gdbserver: remove the .NOEXPORT target Simon Marchi
@ 2026-09-01 16:37   ` Tom Tromey
  0 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2026-09-01 16:37 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> It was a legitimate workaround at the time, but only for a few months.
Simon> GNU make commit b8d48ad379dc, from 1992-05-03, removed the handling of
Simon> .NOEXPORT:

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

Tom

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 6/7] gdb: remove the explicit ada-exp.o rule
  2026-08-31 18:51 ` [PATCH 6/7] gdb: remove the explicit ada-exp.o rule Simon Marchi
@ 2026-09-01 16:38   ` Tom Tromey
  0 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2026-09-01 16:38 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Tom Tromey @ 2026-09-01 16:47 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Note that this changes the command to create directories from "$(SHELL)
Simon> $(srcdir)/../install-sh -d" to "mkdir -p".  If there is a reason to use
Simon> install-sh to create directories in the build directory, I think it
Simon> should be documented, otherwise it just looks strange.

In the old days, 'mkdir -p' wasn't portable.  That's why mkinstalldirs
existed.  Not sure why this code used install-sh.

I don't know if 'mkdir -p' can be used today, though I tend to assume it
can; and anyway it's easy to switch to mkinstalldirs if need be.

Simon> @@ -2413,11 +2408,8 @@ clean mostlyclean: $(CONFIG_CLEAN)
Simon>  	rm -f gdb$(EXEEXT) core make.log
Simon>  	rm -f gdb[0-9]$(EXEEXT)
Simon>  	rm -f xml-builtin.c stamp-xml
Simon> -	rm -f $(DEPDIR)/*
Simon> -	for i in $(CONFIG_SRC_SUBDIR); do \
Simon> -		rm -f $$i/*.o;	\
Simon> -		rm -f $$i/$(DEPDIR)/*; \
Simon> -	done
Simon> +	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
Simon> +	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
 
Simon>  # This used to depend on c-exp.c m2-exp.c TAGS
Simon>  # I believe this is wrong; the makefile standards for distclean just
Simon> @@ -2431,10 +2423,7 @@ distclean: clean
Simon>  	rm -f config.log config.cache
Simon>  	rm -f config.lt libtool
Simon>  	rm -f Makefile
Simon> -	rm -rf $(DEPDIR)
Simon> -	for i in $(CONFIG_SRC_SUBDIR); do \
Simon> -		if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \
Simon> -	done
Simon> +	rm -rf $(ALL_DEPDIRS)

I don't think it should be necessary to update both 'clean' and
'distclean'.  The latter should depend on the former.

The old rule was "if configure made it, distclean removes it; if make
made it, clean removes it".  So I think the distclean change should be
dropped.

I'm unsure if this rule was ever really was discussed outside the
Automake list back in ancient times, I think François Pinard came up
with it.

Tom

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback
  2026-09-01 16:32   ` Tom Tromey
@ 2026-09-01 20:16     ` Simon Marchi
  2026-09-02  7:37       ` Rainer Orth
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-09-01 20:16 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi, Rainer Orth; +Cc: gdb-patches



On 2026-09-01 12:32, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> gdb/Makefile.in and gdbserver/Makefile.in have similar code to do manual
> Simon> gcc3-style dependency tracking, or fallback to the depcomp tool for
> Simon> other dependency tracking modes.  I believe that in this day and age, we
> Simon> can assume that all compilers we support know about gcc3-style
> Simon> dependency tracking.
> 
> Simon> Obviously, gcc and clang both know about it.  The other compilers I am
> Simon> aware of (I don't even know if they can build GDB) are Intel icc and IBM
> Simon> XL, and they both appear to have known about it for a while.
> 
> I wonder if the Windows or Solaris compilers work.

If by Windows you mean MSVC, I would be really surprised.

I did not know about the Sun Studio compiler, but I would assume that
people juste use gcc to build gdb on Solaris.  Rainer, is that true?

> Anyway, I'm fine with this.  I tend to doubt anybody uses anything else,
> on the theory that if they did, we'd probably have seen patches to work
> around problems.  I suppose we can revert this or just ask people to
> write wrapper scripts for any compiler not supporting this feature.
> 
> The depcomp stuff was more important for C and the olden times when
> other compilers were in use.
> 
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks,

Simon

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles
  2026-09-01 16:47   ` Tom Tromey
@ 2026-09-01 20:18     ` Simon Marchi
  2026-09-01 20:37       ` Simon Marchi
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-09-01 20:18 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches



On 2026-09-01 12:47, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> Note that this changes the command to create directories from "$(SHELL)
> Simon> $(srcdir)/../install-sh -d" to "mkdir -p".  If there is a reason to use
> Simon> install-sh to create directories in the build directory, I think it
> Simon> should be documented, otherwise it just looks strange.
> 
> In the old days, 'mkdir -p' wasn't portable.  That's why mkinstalldirs
> existed.  Not sure why this code used install-sh.
> 
> I don't know if 'mkdir -p' can be used today, though I tend to assume it
> can; and anyway it's easy to switch to mkinstalldirs if need be.
> 
> Simon> @@ -2413,11 +2408,8 @@ clean mostlyclean: $(CONFIG_CLEAN)
> Simon>  	rm -f gdb$(EXEEXT) core make.log
> Simon>  	rm -f gdb[0-9]$(EXEEXT)
> Simon>  	rm -f xml-builtin.c stamp-xml
> Simon> -	rm -f $(DEPDIR)/*
> Simon> -	for i in $(CONFIG_SRC_SUBDIR); do \
> Simon> -		rm -f $$i/*.o;	\
> Simon> -		rm -f $$i/$(DEPDIR)/*; \
> Simon> -	done
> Simon> +	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
> Simon> +	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
>  
> Simon>  # This used to depend on c-exp.c m2-exp.c TAGS
> Simon>  # I believe this is wrong; the makefile standards for distclean just
> Simon> @@ -2431,10 +2423,7 @@ distclean: clean
> Simon>  	rm -f config.log config.cache
> Simon>  	rm -f config.lt libtool
> Simon>  	rm -f Makefile
> Simon> -	rm -rf $(DEPDIR)
> Simon> -	for i in $(CONFIG_SRC_SUBDIR); do \
> Simon> -		if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \
> Simon> -	done
> Simon> +	rm -rf $(ALL_DEPDIRS)
> 
> I don't think it should be necessary to update both 'clean' and
> 'distclean'.  The latter should depend on the former.
> 
> The old rule was "if configure made it, distclean removes it; if make
> made it, clean removes it".  So I think the distclean change should be
> dropped.
> 
> I'm unsure if this rule was ever really was discussed outside the
> Automake list back in ancient times, I think François Pinard came up
> with it.

It makes sense for distclean to be a superset of clean, in which case it
doesn't need to repeat the same commands.  I'll send an updated version
of just this patch.

Simon

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles
  2026-09-01 20:18     ` Simon Marchi
@ 2026-09-01 20:37       ` Simon Marchi
  2026-09-02 18:36         ` Tom Tromey
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Marchi @ 2026-09-01 20:37 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches



On 2026-09-01 16:18, Simon Marchi wrote:
> 
> 
> On 2026-09-01 12:47, Tom Tromey wrote:
>>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>>
>> Simon> Note that this changes the command to create directories from "$(SHELL)
>> Simon> $(srcdir)/../install-sh -d" to "mkdir -p".  If there is a reason to use
>> Simon> install-sh to create directories in the build directory, I think it
>> Simon> should be documented, otherwise it just looks strange.
>>
>> In the old days, 'mkdir -p' wasn't portable.  That's why mkinstalldirs
>> existed.  Not sure why this code used install-sh.
>>
>> I don't know if 'mkdir -p' can be used today, though I tend to assume it
>> can; and anyway it's easy to switch to mkinstalldirs if need be.
>>
>> Simon> @@ -2413,11 +2408,8 @@ clean mostlyclean: $(CONFIG_CLEAN)
>> Simon>  	rm -f gdb$(EXEEXT) core make.log
>> Simon>  	rm -f gdb[0-9]$(EXEEXT)
>> Simon>  	rm -f xml-builtin.c stamp-xml
>> Simon> -	rm -f $(DEPDIR)/*
>> Simon> -	for i in $(CONFIG_SRC_SUBDIR); do \
>> Simon> -		rm -f $$i/*.o;	\
>> Simon> -		rm -f $$i/$(DEPDIR)/*; \
>> Simon> -	done
>> Simon> +	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
>> Simon> +	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
>>  
>> Simon>  # This used to depend on c-exp.c m2-exp.c TAGS
>> Simon>  # I believe this is wrong; the makefile standards for distclean just
>> Simon> @@ -2431,10 +2423,7 @@ distclean: clean
>> Simon>  	rm -f config.log config.cache
>> Simon>  	rm -f config.lt libtool
>> Simon>  	rm -f Makefile
>> Simon> -	rm -rf $(DEPDIR)
>> Simon> -	for i in $(CONFIG_SRC_SUBDIR); do \
>> Simon> -		if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \
>> Simon> -	done
>> Simon> +	rm -rf $(ALL_DEPDIRS)
>>
>> I don't think it should be necessary to update both 'clean' and
>> 'distclean'.  The latter should depend on the former.
>>
>> The old rule was "if configure made it, distclean removes it; if make
>> made it, clean removes it".  So I think the distclean change should be
>> dropped.
>>
>> I'm unsure if this rule was ever really was discussed outside the
>> Automake list back in ancient times, I think François Pinard came up
>> with it.
> 
> It makes sense for distclean to be a superset of clean, in which case it
> doesn't need to repeat the same commands.  I'll send an updated version
> of just this patch.

Here is a new version of the patch that removes the dep dirs in the
clean target.


From e5749ada86787578d3b0badd5412c56cfb07a9a7 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@efficios.com>
Date: Mon, 31 Aug 2026 14:51:46 -0400
Subject: [PATCH] gdb, gdbserver: create the dependency directories from the
 Makefiles
To: gdb-patches@sourceware.org

Some .deps directories are created at configure time:

 - gdb/configure.ac and gdbserver/configure.ac call ZW_CREATE_DEPDIR,
   which creates the top-level one from config.status.

 - gdbserver/configure.ac has an additional AC_CONFIG_COMMANDS to create
   the .deps dirs for its subdirectories listed in CONFIG_SRC_SUBDIR
   (arch, gdbsupport, nat and target).

Meanwhile, gdb creates the sub-directory ones from the Makefile, through an
order-only prerequisite on the rule for compiling .c files.

If the user deletes a .deps directory created by configure
(config.status, really), then the build breaks:

    $ rm -rf gdb/.deps
    $ make
      CXX    gdb.o
    gdb.c:39:1: fatal error: opening dependency file ./.deps/gdb.Tpo: No such file or directory

On the other hand, it works for those .deps created by a Makefile (they
are re-created as needed).

This patch changes how we create .deps directories to make it simpler,
more robust and consistent.

In both gdb and gdbserver:

 - Add an ALL_DEPDIRS variable, listing the .deps directories, and a
   rule to create them.

 - Make ALL_DEPDIRS an order-only prerequisite of $(all_object_files),
   such that the .deps directories will be created before compiling any
   .o file.

 - Following the rule "things created by make are removed by the clean
   target" and "things created by configure are removed by the distclean
   target", make the clean targets remove the dependency directories.  I
   opted for an `rm -f` followed by a loop of `rmdir` instead of just
   one `rm -rf $(ALL_DEPDIRS)`.  If someone or something messes up
   $ALL_DEPDIRS in the future, there is less chances of things going
   catastrophically wrong.

Note that this changes the command to create directories from "$(SHELL)
$(srcdir)/../install-sh -d" to "mkdir -p".  If there is a reason to use
install-sh to create directories in the build directory, I think it
should be documented, otherwise it just looks strange.

The configure-time creation is not needed anymore.  Replace the
ZW_CREATE_DEPDIR calls with AM_SET_DEPDIR, which is what actually
provides DEPDIR, and drop gdbserver's gdbdepdir AC_CONFIG_COMMANDS.

That leaves gdbserver's CONFIG_SRC_SUBDIR with no user in configure, so
define it directly in gdbserver/Makefile.in, like gdb already does.

Change-Id: I71e76a9a37a525f58c9c66e5556e8da965cc2ca3
---
 gdb/Makefile.in        | 33 ++++++++++++++++-----------------
 gdb/configure          |  6 ------
 gdb/configure.ac       |  2 +-
 gdbserver/Makefile.in  | 25 +++++++++++++++----------
 gdbserver/configure    | 21 ---------------------
 gdbserver/configure.ac | 13 +------------
 6 files changed, 33 insertions(+), 67 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index cf10bc17320b..8b7d9f47f594 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -590,7 +590,6 @@ HAVE_GSTACK = @HAVE_GSTACK@
 
 CONFIG_SRC_SUBDIR = arch cli dwarf2 mi compile tui unittests guile python \
 	target nat gdbtk/generic
-CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 
 # -I. for config files.
 # -I$(srcdir) for gdb internal headers.
@@ -2092,15 +2091,11 @@ PYTHON_CFLAGS = @PYTHON_CFLAGS@
 all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.gdb gcore gstack gdb-add-index
 	@$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=$(SUBDIRS)" subdir_do
 
-# Rule for compiling .c files in the top-level gdb directory.
-# The order-only dependencies ensure that we create the build subdirectories.
-%.o: %.c | $(CONFIG_DEP_SUBDIR)
+# Rule for compiling .c files.
+%.o: %.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-$(CONFIG_DEP_SUBDIR):
-	$(ECHO_GEN) $(SHELL) $(srcdir)/../install-sh -d $@
-
 # Python files need special flags.
 python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
 
@@ -2413,10 +2408,10 @@ clean mostlyclean: $(CONFIG_CLEAN)
 	rm -f gdb$(EXEEXT) core make.log
 	rm -f gdb[0-9]$(EXEEXT)
 	rm -f xml-builtin.c stamp-xml
-	rm -f $(DEPDIR)/*
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		rm -f $$i/*.o;	\
-		rm -f $$i/$(DEPDIR)/*; \
+	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
+	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
+	for d in $(ALL_DEPDIRS); do \
+		if test -d "$$d"; then rmdir "$$d" || exit 1; fi; \
 	done
 
 # This used to depend on c-exp.c m2-exp.c TAGS
@@ -2431,10 +2426,6 @@ distclean: clean
 	rm -f config.log config.cache
 	rm -f config.lt libtool
 	rm -f Makefile
-	rm -rf $(DEPDIR)
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \
-	done
 
 maintainer-clean: local-maintainer-clean do-maintainer-clean distclean
 realclean: maintainer-clean
@@ -2816,12 +2807,20 @@ all_gdbtk_cflags = $(IDE_CFLAGS) $(ITCL_CFLAGS) \
 # dependency tracking.
 all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
 
+# All the directories in which we put dependency files.
+ALL_DEPDIRS = $(DEPDIR) $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+
+$(ALL_DEPDIRS):
+	$(ECHO_GEN) mkdir -p $@
+
 # All the .deps files to include.
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
     $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
 
-# Ensure that generated files are created early.
-$(all_object_files): | $(generated_files)
+# Ensure that the generated files and the dependency directories are created
+# early.  Creating a dependency directory also creates the directory the
+# objects go in.
+$(all_object_files): | $(generated_files) $(ALL_DEPDIRS)
 
 # Dependencies.
 -include $(all_deps_files)
diff --git a/gdb/configure b/gdb/configure
index 94cc893a8715..4078a8af9f4a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -22696,9 +22696,6 @@ rmdir .tst 2>/dev/null
 
 DEPDIR="${am__leading_dot}deps"
 
-ac_config_commands="$ac_config_commands depdir"
-
-
 
 # Since the first call to PKG_CHECK_MODULES may not happen (is guarded by
 # a condition), we must call PKG_PROG_PKG_CONFIG explicitly to probe for
@@ -34692,7 +34689,6 @@ fi
 ac_aux_dir='$ac_aux_dir'
 
 
-ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
     # from automake.
@@ -34712,7 +34708,6 @@ do
   case $ac_config_target in
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
     "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
     "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
@@ -36161,7 +36156,6 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
 _LT_EOF
 
  ;;
-    "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "default-1":C)
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index d8b2498f415b..f15a2e16947c 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -60,7 +60,7 @@ AX_CXX_COMPILE_STDCXX(17, , mandatory)
 GDB_AC_COMMON
 
 # Dependency checking.
-ZW_CREATE_DEPDIR
+AM_SET_DEPDIR
 
 # Since the first call to PKG_CHECK_MODULES may not happen (is guarded by
 # a condition), we must call PKG_PROG_PKG_CONFIG explicitly to probe for
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 5054597bf6ef..5c3252d64454 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -27,7 +27,7 @@ program_transform_name = @program_transform_name@
 bindir = @bindir@
 libdir = @libdir@
 
-CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
+CONFIG_SRC_SUBDIR = arch gdbsupport nat target
 
 install_sh = @install_sh@
 
@@ -428,17 +428,14 @@ mostlyclean clean:
 	rm -f $(IPA_LIB)
 	rm -f *-generated.cc
 	rm -f stamp-xml
-	rm -f $(DEPDIR)/*.Po
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		rm -f $$i/*.o;	\
-		rm -f $$i/$(DEPDIR)/*; \
+	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
+	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
+	for d in $(ALL_DEPDIRS); do \
+		if test -d "$$d"; then rmdir "$$d" || exit 1; fi; \
 	done
 
 maintainer-clean realclean distclean: clean
 	rm -f Makefile config.status config.h stamp-h config.log config.cache
-	for i in $(CONFIG_SRC_SUBDIR); do \
-		rmdir $$i/$(DEPDIR); \
-	done
 
 config.h: stamp-h ; @true
 stamp-h: config.in config.status
@@ -596,8 +593,16 @@ gdbreplay.o: gdbreplay.cc
 # dependency tracking.
 all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
 
-# Ensure that generated files are created early.
-$(all_object_files): | $(generated_files)
+# All the directories in which we put dependency files.
+ALL_DEPDIRS = $(DEPDIR) $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+
+$(ALL_DEPDIRS):
+	$(ECHO_GEN) mkdir -p $@
+
+# Ensure that the generated files and the dependency directories are created
+# early.  Creating a dependency directory also creates the directory the
+# objects go in.
+$(all_object_files): | $(generated_files) $(ALL_DEPDIRS)
 
 # All the .deps files to include.
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
diff --git a/gdbserver/configure b/gdbserver/configure
index 3cf8df2c3ae1..dd749fcb55bc 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -637,7 +637,6 @@ REPORT_BUGS_TO
 PKGVERSION
 WERROR_CFLAGS
 WARN_CFLAGS
-CONFIG_SRC_SUBDIR
 CATOBJEXT
 GENCAT
 INSTOBJEXT
@@ -10956,9 +10955,6 @@ rmdir .tst 2>/dev/null
 
 DEPDIR="${am__leading_dot}deps"
 
-ac_config_commands="$ac_config_commands depdir"
-
-
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
@@ -12813,13 +12809,6 @@ $as_echo "$LINGUAS" >&6; }
 
 fi
 
-# Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
-
-
-ac_config_commands="$ac_config_commands gdbdepdir"
-
-
 for ac_header in  \
   arpa/inet.h \
   fcntl.h \
@@ -15459,7 +15448,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
     # from automake.
@@ -15467,7 +15455,6 @@ ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
     # Capture the value of LINGUAS because we need it to compute CATALOGS.
     LINGUAS="${LINGUAS-%UNSET%}"
 
-ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"
 
 _ACEOF
 
@@ -15478,9 +15465,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
-    "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
-    "gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -16038,7 +16023,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "config.h":H) echo > stamp-h ;;
-    "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "default-1":C)
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
@@ -16140,11 +16124,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
         ;;
       esac
     done ;;
-    "gdbdepdir":C)
-  for subdir in ${CONFIG_SRC_SUBDIR}
-  do
-      $SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR
-  done ;;
 
   esac
 done # for ac_tag
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index a549a8712fc1..f1466e8568d4 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -60,22 +60,11 @@ ACX_NONCANONICAL_TARGET
 ACX_NONCANONICAL_HOST
 
 # Dependency checking.
-ZW_CREATE_DEPDIR
+AM_SET_DEPDIR
 
 dnl Set up for gettext.
 ZW_GNU_GETTEXT_SISTER_DIR
 
-# Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
-AC_SUBST(CONFIG_SRC_SUBDIR)
-
-AC_CONFIG_COMMANDS([gdbdepdir],[
-  for subdir in ${CONFIG_SRC_SUBDIR}
-  do
-      $SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR
-  done],
-  [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"])
-
 AC_CHECK_HEADERS([ \
   arpa/inet.h \
   fcntl.h \

base-commit: 6f24afa4391bd33f1263378280b99385d2c13055
prerequisite-patch-id: 4f4b30b2ac5cedd183ab34dc0a5e1995ab17c343
prerequisite-patch-id: ea27f63da8112eedd7bcb94b112158765f636d9f
prerequisite-patch-id: 16938c0ecc58221f58f9b6990586df156aa87efe
prerequisite-patch-id: 7d6a54a68713775ca87608cac8707973068e5cca
prerequisite-patch-id: 8c9c3cb5533f832ca7060dbc5ac26b5160817c79
-- 
2.55.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback
  2026-09-01 20:16     ` Simon Marchi
@ 2026-09-02  7:37       ` Rainer Orth
  2026-09-02 12:26         ` Simon Marchi
  0 siblings, 1 reply; 23+ messages in thread
From: Rainer Orth @ 2026-09-02  7:37 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches

Hi Simon,

> I did not know about the Sun Studio compiler, but I would assume that
> people juste use gcc to build gdb on Solaris.  Rainer, is that true?

I guess so, at least I've done that for a very long time.  Just in case,
I tried building gdb trunk with Studio CC 12.6.  It failed since it only
supports C++14 while gdb requires C++17.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback
  2026-09-02  7:37       ` Rainer Orth
@ 2026-09-02 12:26         ` Simon Marchi
  0 siblings, 0 replies; 23+ messages in thread
From: Simon Marchi @ 2026-09-02 12:26 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tom Tromey, Simon Marchi, gdb-patches



On 2026-09-02 03:37, Rainer Orth wrote:
> Hi Simon,
> 
>> I did not know about the Sun Studio compiler, but I would assume that
>> people juste use gcc to build gdb on Solaris.  Rainer, is that true?
> 
> I guess so, at least I've done that for a very long time.  Just in case,
> I tried building gdb trunk with Studio CC 12.6.  It failed since it only
> supports C++14 while gdb requires C++17.

Thanks, that settles it :)

Simon

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles
  2026-09-01 20:37       ` Simon Marchi
@ 2026-09-02 18:36         ` Tom Tromey
  2026-09-03 13:45           ` Simon Marchi
  0 siblings, 1 reply; 23+ messages in thread
From: Tom Tromey @ 2026-09-02 18:36 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> Here is a new version of the patch that removes the dep dirs in the
Simon> clean target.

Thanks, this is ok.
Approved-By: Tom Tromey <tom@tromey.com>

FWIW I believe the only reason these directories were ever made at
configure time is that Automake tried hard to work with POSIX make (and
also work around bugs in vendor makes); and IIRC doing this kind of
thing efficiently in that setup was a pain.

Tom

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles
  2026-09-02 18:36         ` Tom Tromey
@ 2026-09-03 13:45           ` Simon Marchi
  0 siblings, 0 replies; 23+ messages in thread
From: Simon Marchi @ 2026-09-03 13:45 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches

On 9/2/26 2:36 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
> 
> Simon> Here is a new version of the patch that removes the dep dirs in the
> Simon> clean target.
> 
> Thanks, this is ok.
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, pushed.  I forgot that the Approved-By for that last patch
because I applied it by hand rather than with b4 :(.

> FWIW I believe the only reason these directories were ever made at
> configure time is that Automake tried hard to work with POSIX make (and
> also work around bugs in vendor makes); and IIRC doing this kind of
> thing efficiently in that setup was a pain.

Ok, thanks for the explanation.

Simon

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2026-09-03 13:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 6/7] gdb: remove the explicit ada-exp.o rule Simon Marchi
2026-09-01 16:38   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox