public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@gnu.org>
To: Olivier Hainque <hainque@adacore.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Nicolas Roche <roche@adacore.com>
Subject: Re: fix libcc1 dependencies in toplevel Makefile
Date: Tue, 12 Jun 2018 02:50:00 -0000	[thread overview]
Message-ID: <ory3fku3a1.fsf@lxoliva.fsfla.org> (raw)
In-Reply-To: <ortvqj1y63.fsf@lxoliva.fsfla.org> (Alexandre Oliva's message of	"Sun, 03 Jun 2018 16:13:08 -0300")

On Jun  3, 2018, Alexandre Oliva <oliva@gnu.org> wrote:

> On Jun 27, 2017, Alexandre Oliva <aoliva@redhat.com> wrote:

>> configuration, because the current Makefile would only do that with
>> all-host, after bootstrap is complete.

> I have extensively studied the dependencies, and I still don't see how
> all-libcc1, that is only activated as a target during the post-bootstrap
> all-host build, might have been activated concurrently with
> staging/unstaging.  By the time we get to all-host, we've sequentially
> completed bootstrap, compare, and unstage.

> The only possibilities I see of something going wrong as described is a
> parallel build that has bootstrap and postbootstrap targets in the
> command line, or some patch that changes the dependencies so that such
> targets are considered in parallel.

> I could definitely use the build logs from back then, if still
> available, to try to make sense of the problem.

I was missing one possibility: that the problem occurred during the
post-bootstrap all-host all-target build.  As far as I can tell from
Nicolas' analysis, this was indeed the case.  I still don't see how any
staging or unstaging might have taken place, but I can now see that we
do reenter the gcc dir before building all-libcc1.  If that reentering
rebuilds anything, particularly headers, that may be enough to explain
the reported symptoms.

Now, I do vaguely recall build output within the gcc subdir that
possibly recreated the gcc/include subtree, which might explain the
observed errors.

The good news is that the patch I posted the other day actually
addresses this problem: the dep on stage_last is not enough to trigger a
rebuild of gcc, so a post-bootstrap all-host all-target build will not
reenter the bootstrapped dirs, but that dep does trigger an initial
build of gcc if one has not gone through bootstrapping yet.


So I see two possible ways to go from now:

1. address the previously-mentioned fragility in the patch I posted, to
catch all cases of postbootstrap targets and their deps on
non-postbootstrap targets.


2. revamp the bootstrap/non-bootstrap dependencies, using GNU make
conditionals rather than configure-time enable/disable-bootstrap, so
that we can have a different set of dependencies while running the
bootstrap proper, having non-stage dependencies activated by default
when any of the all-* targets are named in the command line, and also
when building post-bootstrap all-host all-target.  This might seem to
bring the problem back, but rather by having the full dependency set,
we'd avoid the race not by refraining from reentering dirs, but rather
by having them entered or reentered according to the full dependencies,
without mixing stage and non-stage dependencies.  I'm not yet sure this
is actually doable, but it seems to me that if it is, it would be more
robust than what we have now.

-- 
Alexandre Oliva, freedom fighter   https://FSFLA.org/blogs/lxo
Be the change, be Free!         FSF Latin America board member
GNU Toolchain Engineer                Free Software Evangelist

  reply	other threads:[~2018-06-12  2:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 12:58 Olivier Hainque
2017-06-14 11:39 ` Nathan Sidwell
2017-06-14 21:11   ` Olivier Hainque
2017-06-15 12:03     ` Nathan Sidwell
2017-06-15 12:29       ` Olivier Hainque
2017-06-22 12:13 ` Alexandre Oliva
2017-06-26  7:41   ` Olivier Hainque
2017-06-27 16:32     ` Olivier Hainque
2017-06-27 19:53     ` Alexandre Oliva
2017-07-03 21:05       ` Olivier Hainque
2018-06-03 19:13       ` Alexandre Oliva
2018-06-12  2:50         ` Alexandre Oliva [this message]
2018-06-12  8:57           ` Olivier Hainque
2018-06-12 15:31           ` Jeff Law
2018-06-26  5:39           ` Alexandre Oliva
2018-06-27 19:53             ` Olivier Hainque

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=ory3fku3a1.fsf@lxoliva.fsfla.org \
    --to=oliva@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hainque@adacore.com \
    --cc=roche@adacore.com \
    /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).