1 |
vapier 11/11/01 03:38:01 |
2 |
|
3 |
Modified: bash-4.2-parallel-build.patch |
4 |
Log: |
5 |
Fix parallel build failures with mkbuiltin. |
6 |
|
7 |
(Portage version: 2.2.0_alpha71/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.2 app-shells/bash/files/bash-4.2-parallel-build.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bash-4.2-parallel-build.patch?rev=1.2&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bash-4.2-parallel-build.patch?rev=1.2&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bash-4.2-parallel-build.patch?r1=1.1&r2=1.2 |
15 |
|
16 |
Index: bash-4.2-parallel-build.patch |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/app-shells/bash/files/bash-4.2-parallel-build.patch,v |
19 |
retrieving revision 1.1 |
20 |
retrieving revision 1.2 |
21 |
diff -u -r1.1 -r1.2 |
22 |
--- bash-4.2-parallel-build.patch 7 Oct 2011 20:01:04 -0000 1.1 |
23 |
+++ bash-4.2-parallel-build.patch 1 Nov 2011 03:38:01 -0000 1.2 |
24 |
@@ -1,3 +1,5 @@ |
25 |
+https://lists.gnu.org/archive/html/bug-bash/2011-10/msg00036.html |
26 |
+ |
27 |
the current yacc rules allow multiple runs to generate the same files. usually |
28 |
this doesn't come up as the generated files are shipped in the tarball, but |
29 |
when you modify parse.y (applying a patch or developing or whatever), you can |
30 |
@@ -33,6 +35,8 @@ |
31 |
# experimental new rules - work with GNU make but not BSD (or OSF) make |
32 |
#y.tab.o: y.tab.c y.tab.h |
33 |
|
34 |
+https://lists.gnu.org/archive/html/bug-bash/2011-10/msg00037.html |
35 |
+ |
36 |
the current code generates a bunch of local libraries in subdirs and then |
37 |
links bash against that. those subdirs sometimes need version.h. so they |
38 |
have a rule to change back up to the parent dir and build version.h (which is |
39 |
@@ -66,3 +70,35 @@ |
40 |
$(READLINE_LIBRARY): config.h $(READLINE_SOURCE) |
41 |
@echo making $@ in ${RL_LIBDIR} |
42 |
@( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \ |
43 |
+ |
44 |
+the top level Makefile will recurse into the defdir for multiple targets |
45 |
+(libbuiltins.a, common.o, bashgetopt.o, builtext.h), and since these do |
46 |
+not have any declared interdependencies, parallel makes will recurse into |
47 |
+the subdir and build the respective targets. |
48 |
+ |
49 |
+nothing depends on common.o or bashgetopt.o, so those targets don't get |
50 |
+used normally. this leaves libbuiltins.a and builtext.h. at a glance, |
51 |
+this shouldn't be a big deal, but when we look closer, there's a subtle |
52 |
+failure lurking. |
53 |
+ |
54 |
+most of the objects in the defdir need to be generated which means they |
55 |
+need to build+link the local mkbuiltins helper. the builtext.h header |
56 |
+also needs to be generated by the mkbuiltins helper. so when the top |
57 |
+level launches a child for libbuiltins.a and a child for builtext.h, we |
58 |
+can hit a race condition where the two try to generate mkbuiltins, and |
59 |
+the build randomly fails. |
60 |
+ |
61 |
+so update libbuiltins.a to depend on builtext.h. this should be fairly |
62 |
+simple since it's only a single target. |
63 |
+ |
64 |
+--- a/Makefile.in |
65 |
++++ b/Makefile.in |
66 |
+@@ -674,7 +674,7 @@ |
67 |
+ $(RM) $@ |
68 |
+ ./mksyntax$(EXEEXT) -o $@ |
69 |
+ |
70 |
+-$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h version.h |
71 |
++$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h ${DEFDIR}/builtext.h version.h |
72 |
+ @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libbuiltins.a ) || exit 1 |
73 |
+ |
74 |
+ # these require special rules to circumvent make builtin rules |