From: Nathanael Nerode <neroden@twcny.rr.com>
To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com,
binutils@sources.redhat.com
Subject: Re: (toplevel patch) Fix multilib.out dependencies and related problems
Date: Thu, 19 Dec 2002 17:29:00 -0000 [thread overview]
Message-ID: <20021220011716.GA1569@doctormoo> (raw)
I said:
> Removed xgcc and ran 'make'; gcc rebuilt it, and target libs were
> reconfigured and built.
DJ quoth:
>That shouldn't happen. Use move-if-change to update one common
>multilib.out, so that if the list of multilibs doesn't change,
>*nothing* gets reconfigured or rebuilt. We want to trigger a *check*
>when gcc changes, but only actually *reconfigure* if needed.
Uh, yeah. Make isn't designed to realize that you can change a file and
not change the generated file depending on it; this is not an
unreasonable assumption in most cases. To put it another way, I don't
care very much.
>I'm wondering if the common multilib.out target should depend on the
>all-gcc phony target; we kinda want it to run every time we check the
Of course it should. But it can't, it actually can't, because then we
have a real target depending on a phony target, and every target subdir
gets reconfigured every single time. Sorry.
You could try to do this with a phony multilib.out target. Then you'd
need to make configure-target-foo depend on it instead of
(TARGET_SUBDIR)/foo/Makefile. And you'd find that target subdirs would
never get reconfigured. Sorry.
You could patch that problem up by putting the code for foo/Makefile
back into configure-target-foo, and hard-coding yet more things Make
should do, such as determining whether foo/Makefile is out of date.
Maybe this is the preferred method, but I will have nothing to do with
it, since I'm certain it's the wrong direction to go.
>gcc subdir, because we don't know if something else besides xgcc
>affects the specs (which affects multilib.out).
Eeech. We should actually know what affects the specs, you know. :-/
> We can get away with
>this if we use move-if-change.
Kinda, sorta.
Here's a scheme, which might do the trick.
(First note that a common multilib.out is a separate issue and
can and should be done however we fix these other things.)
Have the common multilib.out depend on nothing.
Have the build process for gcc (I hope there's nothing else which
can affect multilib.out...) do the testing and move-if-changing of
multilib.out. Effectively, this is a preinstall; building all-gcc
should build multilib.out directly into the location where the target
subdirs look for it, and the rules for regenerating it will live in the
gcc Makefile.
This should mean that a change in gcc, provided the build process is
used, will change multilib.out.
Happy with this?
If not, here are some other ideas, thrown out at least partly in
frustration:
* Whatever determines the contents of multilib.out should just get its
own damn rule at the top level, rather than messing around with building
the whole of gcc to determine that it's ".;".
* Force every target subdir which actually cares about this to produce
its own copy of multilib.out and to test whether it's out of date on its
own, so that it's out of the hair of the top level.
* Don't support toplevel Make at all.
* Convert the configuration and Makefiles for all subdirectories to
fragmentary Makefile fragments, which are plugged into the top level.
In other words, only support the top level.
* Make all-gcc a real target, similarly for all the others, and require
the subdirs to create the corresponding files name 'all'. This is
actually a pretty good idea, although it's quite non-standard; it
amounts to the total elimination of all phony targets.
* Use existing real targets: in place of all-gcc, use gcc/xgcc gcc/cc1
etc. This of course requires massive and ugly changes to the top level.
--
Incidentally, I now know the one feature I want added to all versions of
Make, and it's not one which exists in any version of make I've seen.
Plus, it's very very simple.
For any target, in addition to being able to specify a command and
dependencies, you should be able to specify an external program to run
in a shell, which gives exit status 0 if the target is up to date and
exit status 1 if the target needs to be rebuilt. (For total
generality, it might require a shell variable to be passed in indicating
whether the dependencies were up to date.) If it returned 1, the
dependencies would still have to be examined to see if they needed to be
rebuilt first, however.
This would deal with virtually all "problems" with Make in a generic
way. For instance, we simply annotate multilib.out with its test and a
dependency on all-gcc. All-gcc is still considered updated every
time, but this doesn't force multilib.out to be.
This actually solves every real issue I have ever seen anyone have with
Make ever, and I am surprised that it hasn't been implemented in any
version I've met. I'm not sure which make variants to push this idea
at...
--Nathanael
next reply other threads:[~2002-12-20 1:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-19 17:29 Nathanael Nerode [this message]
2002-12-19 18:00 ` DJ Delorie
-- strict thread matches above, loose matches on Subject: below --
2002-12-19 18:08 Nathanael Nerode
2002-12-19 18:23 ` DJ Delorie
2002-12-19 18:24 ` Zack Weinberg
2002-12-19 16:16 Nathanael Nerode
2002-12-19 17:18 ` DJ Delorie
2002-12-21 19:02 ` Alexandre Oliva
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=20021220011716.GA1569@doctormoo \
--to=neroden@twcny.rr.com \
--cc=binutils@sources.redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sources.redhat.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