This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA]: simulator build failures with parallel make
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: [RFA]: simulator build failures with parallel make
- From: jtc at redback dot com (J.T. Conklin)
- Date: 15 Apr 2001 13:47:27 -0700
- Cc: Andrew Cagney <ac131313 at cygnus dot com>,gdb-patches at sourceware dot cygnus dot com
- References: <5m8zlrot5g.fsf@jtc.redback.com> <3ACE0606.1A63BF3D@cygnus.com><5m3dbac51h.fsf@jtc.redback.com> <20010415131343.A5550@lucon.org>
- Reply-To: jtc at redback dot com
>>>>> "HJ" == H J Lu <hjl@lucon.org> writes:
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> With that dependency added without -j does the generator get
Andrew> run twice? I've this memory of a strange querk with make
Andrew> dependencies and files being created as a sideeffect.
>>
>> No.
>>
>> But now that you've mentioned it, I recall that rules with multiple
>> targets will be executed once per target with -j (at least with GNU
>> make). This can be worked around by creating a psuedo-target to
HJ> Please don't add any workaround. Just provide complete
HJ> dependencies, [...]
And just what workaround do you think I'm adding?
HJ> [...] any make, including GNU make, will be happy.
Untrue. GNU make will invoke the commands for a rule with multiple
targets multiple times when used with -j. Bug or feature, this must
be accomidated.
For example:
$ cat Makefile
all: foo.tab.c foo.tab.h
foo.tab.c foo.tab.h: foo.y
$(YACC) -b foo -p foo -d $?
$ gmake -j
yacc -b foo -p foo -d foo.y
yacc -b foo -p foo -d foo.y
In many cases, this must be guarded against. A rule with two targets
occured only once in the four simulator makefiles I touched. And that
one already handled it by introducing a pseudo-target to serialize
the make. For the above makefile, the equivalent would be:
$ cat Makefile
all: foo.tab.c foo.tab.h
foo.tab.c foo.tab.h: foo-stamp
foo-stamp: foo.y
$(YACC) -b foo -p foo -d $?
touch $@
So what exactly is your complaint about my patch.
--jtc
--
J.T. Conklin
RedBack Networks