]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/dash/0002-fix-parallel-build.patch
linux: bump default to version 4.13.4
[coffee/buildroot.git] / package / dash / 0002-fix-parallel-build.patch
1 tokens: fix parallel builds
2
3 Currently, tokens.h and token_vars.h are each generated by a call to
4 mktokens, which means mktokens is called twice.
5
6 But mktokens generates both in a single run.
7
8 This means that, with a fast-enough machine, the call to mktokens that
9 generates tokens.h may finish before the call that generates
10 token_vars.h. Then tokens.h is transiently incomplete (it can even be
11 empty). By the time it is fully generated in the second run, a compile
12 job that ends up using token.h may have already started, and the source
13 file would include an in complete token.h and would be missing some
14 token definitions.
15
16 We fix that by making token.h a dependency of token_vars.h, with a
17 dummy recipe (to force it not being PHONY). The actual recipe is for
18 token_vars.h
19
20 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
21
22 diff -durN dash-0.5.8.orig/src/Makefile.am dash-0.5.8/src/Makefile.am
23 --- dash-0.5.8.orig/src/Makefile.am     2014-09-28 10:19:32.000000000 +0200
24 +++ dash-0.5.8/src/Makefile.am  2017-03-07 09:53:28.579811603 +0100
25 @@ -45,7 +45,14 @@
26         mktokens mkbuiltins builtins.def.in mkinit.c \
27         mknodes.c nodetypes nodes.c.pat mksyntax.c mksignames.c
28  
29 -token.h token_vars.h: mktokens
30 +# Both token.h and token_vars.h are generated by a single call
31 +# to mktokens. However, token.h is the only file that is used
32 +# as a dependency, so we must ensure token_vars.h is generated
33 +# first.
34 +token.h: token_vars.h
35 +       @:
36 +
37 +token_vars.h: mktokens
38         sh $^
39  
40  builtins.def: builtins.def.in $(top_builddir)/config.h