bug-bash
[Top][All Lists]
Advanced

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

[patch] builtins: fix parallel build between top level targets


From: Mike Frysinger
Subject: [patch] builtins: fix parallel build between top level targets
Date: Mon, 31 Oct 2011 23:07:14 -0400
User-agent: KMail/1.13.7 (Linux/3.1.0-rc4; KDE/4.6.5; x86_64; ; )

the top level Makefile will recurse into the defdir for multiple targets
(libbuiltins.a, common.o, bashgetopt.o, builtext.h), and since these do not
have any declared interdependencies, parallel makes will recurse into the
subdir and build the respective targets.

nothing depends on common.o or bashgetopt.o, so those targets don't get used
normally.  this leaves libbuiltins.a and builtext.h.  at a glance, this
shouldn't be a big deal, but when we look closer, there's a subtle failure
lurking.

most of the objects in the defdir need to be generated which means they need
to build+link the local mkbuiltins helper.  the builtext.h header also needs
to be generated by the mkbuiltins helper.  so when the top level launches a
child for libbuiltins.a and a child for builtext.h, we can hit a race
condition where the two try to generate mkbuiltins, and the build randomly
fails.

so update libbuiltins.a to depend on builtext.h.  this should be fairly simple
since it's only a single target.

--- a/Makefile.in
+++ b/Makefile.in
@@ -674,7 +674,7 @@
        $(RM) $@
        ./mksyntax$(EXEEXT) -o $@
 
-$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h 
${BASHINCDIR}/memalloc.h version.h
+$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h 
${BASHINCDIR}/memalloc.h ${DEFDIR}/builtext.h version.h
        @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libbuiltins.a ) || 
exit 1
 
 # these require special rules to circumvent make builtin rules

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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