DragonFly BSD
DragonFly commits List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/gnu/usr.bin/gdb/gdb


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Thu, 18 Nov 2004 12:42:00 +0900

Hi.

On Wed, Nov 17, 2004 at 04:32:13PM +0100, Simon 'corecode' Schubert wrote:
> On 17.11.2004, at 13:27, Joerg Sonnenberger wrote:
> >joerg       2004/11/17 04:27:59 PST
> >
> >DragonFly src repository
> >
> >  Modified files:
> >    gnu/usr.bin/gdb/gdb  Makefile
> >  Log:
> >  Use the YACC source for c-exp.y and f-exp.y, not the pre-built
> >  BISON parse. This solves the *very* strange build problem with
> >  -jX in buildworld, where make tries to build this files from
> >  source using the default rules. Those rules are not save for
> >  parallel builds.
> 
> Thanks. Although I'd really like to know why these *explicit* sources 
> (.c) get updated from the *implicit* (.y) sources...

When the tree is checked out, *.c files get updated earlier than *.y files,
making the latter slightly newer than the former.
The following sequence of commands demonstrate what's happening in the
`depend' target.

$ cd /usr/src/contrib/gdb-6.2.1/gdb
$ rm *
$ cvs up
$ cd /usr/src/gnu/usr.bin/gdb/gdb
$ export MAKEOBJDIRPREFIX=$HOME/obj
$ make obj
$ cvs up -r1.4 Makefile
$ make -j3 -n depend > ~/j3
$ cvs up -r1.5 Makefile
$ make -j3 -n depend > ~/j3_
$ diff -u ~/j3 ~/j3_ | less -S

See the difference? That is, when [cf]-exp.c but not [cf]-exp.y are
specified in SRCS, suffix rule .y.c from sys.mk is used, which is not
-j safe (already pointed out by Brad Harvell on bugs@), because multiple
instances of ${YACC} try to write to the same y.tab.c file(and probably
unlink it before writing to it). When [cf]-exp.y are specified in SRCS on the
other hand, the `.for _YSRC' rule in bsd.dep.mk produces explicit rules for
each *.y file using `${YACC} ${YFLAGS} -o'.

To summarize, if SRCS contains more than one *.c file having corresonding
newer *.y files in the same directory, `make -jN depend' may fail depending
on the mtime of *.c and *.y. As of gnu/usr.bin/gdb/Makefile rev 1.5, scm-exp.c
is the only *.c that has corresponding *.y in the same directory(which is
slightly newer because of the order of cvs checkout).
The question is, whether we can change .y.c rule in sys.mk to make it -jN
(as pointed out by Brad).



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]