bug-bash
[Top][All Lists]
Advanced

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

[patch] fix parallel build issues with syntax.c


From: Mike Frysinger
Subject: [patch] fix parallel build issues with syntax.c
Date: Fri, 7 Oct 2011 15:59:54 -0400
User-agent: KMail/1.13.7 (Linux/3.1.0-rc4; KDE/4.6.5; x86_64; ; )

the current code generates a bunch of local libraries in subdirs and then
links bash against that.  those subdirs sometimes need version.h.  so they
have a rule to change back up to the parent dir and build version.h (which is
fine).  the trouble is that the top level objects and the subdirs are allowed
to build in parallel, so it's possible for multiple children to see that
version.h is not available and that it needs to be created, so they all do.

there is even more trouble is that version.h depends on all the top level
sources, some of which are compiled (like syntax.c).  so these parallel
children all kick off a job to generate syntax.c which in turn requires the
mksyntax helper executable.  obviously multiple processes rm-ing, compiling,
and linking the same files quickly falls apart.

so tweak the subdirs to all depend on the .build target which in turn depends
on all of these top level files being generated.  now the subdirs won't try and
recursively enter the top level.

(noticed by David James)
-mike

--- a/Makefile.in
+++ b/Makefile.in
@@ -597,6 +598,11 @@
 #      $(YACC) -d $(srcdir)/parse.y
 #      -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
 
+# Subdirs will often times want version.h, so they'll change back up to
+# the top level and try to create it.  This causes parallel build issues
+# so just force top level sanity before we descend.
+$(LIBDEP): .build
+
 $(READLINE_LIBRARY): config.h $(READLINE_SOURCE)
        @echo making $@ in ${RL_LIBDIR}
        @( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]