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: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 18 Nov 2004 05:05:31 +0100

On 18.11.2004, at 04:42, YONETANI Tomokazu wrote:
 Modified files:
   gnu/usr.bin/gdb/gdb  Makefile
 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.

Ah. Now I think I know why this is happening. the .c files are never used as explicit sources, but only as implicit and thus get updated from the .y files (am I wrong here?)
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'.

For what amazing reason does bsd.dep.mk handle .y and .l files explicitly, and doesn't rely on the implicit rules?

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).

Sure, I'd say. Well, okay, it will break behaviour wrt y.tab.h, but I think this needs to be done. Maybe we can add the non-deterministic behaviour back by mv ${.IMPSRC:S/.y/.h} y.tab.h [hack alert!]


\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News

Attachment: PGP.sig
Description: This is a digitally signed message part

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