public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Simon Marchi <simark@simark.ca>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gnulib: Ensure all libraries are used when building gdb/gdbserver
Date: Mon, 12 Oct 2020 16:30:14 +0100	[thread overview]
Message-ID: <20201012153014.GV605036@embecosm.com> (raw)
In-Reply-To: <b0ab1bdf-33a6-8df6-a702-c4d75254d382@simark.ca>

* Simon Marchi <simark@simark.ca> [2020-10-12 10:16:08 -0400]:

> On 2020-10-12 7:41 a.m., Joel Brobecker wrote:
> > I got reports of the nightly source packaging failing soon after
> > you pushed this patch, and I was able to reproduce it by configuring
> > (out of tree), followed by a "make distclean". I did a "make -C gdb install"
> > as well, but I don't think it should have any influence on the outcome.
> >
> > The error I get is the following:
> >
> >      | Makefile:246: ../gnulib/Makefile.gnulib.inc: No such file or directory
> >      | make[2]: *** No rule to make target '../gnulib/Makefile.gnulib.inc'.  Stop.
> >      | make[2]: Leaving directory '/[...]/gdb'
> >
> > Do you think you could look into it?
> 
> Ah, that's a case I didn't think of.  When make distclean runs, it runs
> first in gnulib, so erases gnulib/Makefile.gnulib.inc.  When it then
> runs in gdb, the Makefile can't run.
> 
> So I guess we'll need to make the inclusion condition/non-fatal for this
> reason, unless you see another way?

How about this?

I've added a module dependency to ensure that gdb/gdbserver are both
cleaned before gnulib.  My hope is that this should ensure
Makefile.gnulib.inc still exists when needed...

Thanks,
Andrew

---

commit 75b86a705adbb127962beb5ef8d9d7181afe3789
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Mon Oct 12 16:04:32 2020 +0100

    gdb/gdbserver: use '-include' to pull in Makefile.gnulib.inc
    
    After commit:
    
      commit 361cb219351d8b7e39e1962fe77f40aa80657b27
      Date:   Tue Oct 6 10:09:06 2020 +0100
    
          gnulib: Ensure all libraries are used when building gdb/gdbserver
    
    We now get an error when, at the top level of the build tree, we do
    'make distclean'.
    
    The reason for this is that the gnulib directory is cleaned before the
    gdb directory, cleaning gnulib deletes Makefile.gnulib.inc from the
    gnulib build directory, which is currently pulled in by the gdb
    Makefile.in using 'include'.
    
    This commit adds a dependency between distclean-gnulib and both
    distclean-gdb and distclean-gdbserver.  This means that gdb and
    gdbserver will be cleaned before gnulib, as a result the
    Makefile.gnulib.inc file should exist when needed.
    
    ChangeLog:
    
            * Makefile.in: Rebuild.
            * Makefile.def: Make distclean-gnulib depend on distclean-gdb and
            distclean-gdbserver.

diff --git a/Makefile.def b/Makefile.def
index 76d062bb671..089e70ae3ed 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -548,6 +548,12 @@ dependencies = { module=configure-libctf; on=all-intl; };
 dependencies = { module=configure-libctf; on=all-zlib; };
 dependencies = { module=configure-libctf; on=all-libiconv; };
 
+// The Makefiles in gdb and gdbserver pull in a file that configure
+// generates in the gnulib directory, so distclean gnulib only after
+// gdb and gdbserver.
+dependencies = { module=distclean-gnulib; on=distclean-gdb; };
+dependencies = { module=distclean-gnulib; on=distclean-gdbserver; };
+
 // Warning, these are not well tested.
 dependencies = { module=all-bison; on=all-intl; };
 dependencies = { module=all-bison; on=all-build-texinfo; };
diff --git a/Makefile.in b/Makefile.in
index 9dfd39fae13..fe34132f9e5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52366,6 +52366,8 @@ configure-stage3-libctf: maybe-all-stage3-libiconv
 configure-stage4-libctf: maybe-all-stage4-libiconv
 configure-stageprofile-libctf: maybe-all-stageprofile-libiconv
 configure-stagefeedback-libctf: maybe-all-stagefeedback-libiconv
+distclean-gnulib: maybe-distclean-gdb
+distclean-gnulib: maybe-distclean-gdbserver
 all-bison: maybe-all-build-texinfo
 all-flex: maybe-all-build-bison
 all-flex: maybe-all-m4

  reply	other threads:[~2020-10-12 15:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 16:51 Andrew Burgess
2020-10-05 18:34 ` Simon Marchi
2020-10-06 12:17   ` Andrew Burgess
2020-10-06 14:10     ` Simon Marchi
2020-10-07 15:33       ` Andrew Burgess
2020-10-07 15:34         ` Simon Marchi
2020-10-09  8:34         ` Andrew Burgess
2020-10-12 11:41           ` Joel Brobecker
2020-10-12 14:16             ` Simon Marchi
2020-10-12 15:30               ` Andrew Burgess [this message]
2020-10-13 14:26                 ` Simon Marchi
2020-10-14 14:09                   ` Andrew Burgess
2020-10-15  8:35                     ` Joel Brobecker

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=20201012153014.GV605036@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).