summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2017-03-07 17:37:16 (GMT)
committerPeter Korsgaard <peter@korsgaard.com>2017-03-07 18:29:46 (GMT)
commit0935781891e64c555664d20d6c3fabf83d27424c (patch)
tree84871dbd8f0c7795ced2d46c4d7faf04445c80ff
parent81f55e43094eed1000fa836db7a36151e89356cf (diff)
downloadbuildroot-0935781891e64c555664d20d6c3fabf83d27424c.tar.gz
buildroot-0935781891e64c555664d20d6c3fabf83d27424c.tar.bz2
package/dash: fix parallel build
Fixes: http://autobuild.buildroot.org/results/14e/14e35f399bb169d00a6e5d76fc981f87980e970d/ http://autobuild.buildroot.org/results/b04/b043f94c445eefd5781e3ddf699e39cf88fcaa08/ http://autobuild.buildroot.org/results/2f8/2f81182eb5733c9f4e23b380df5093978ea465ac/ ... Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/dash/0002-fix-parallel-build.patch40
-rw-r--r--package/dash/dash.mk3
2 files changed, 43 insertions, 0 deletions
diff --git a/package/dash/0002-fix-parallel-build.patch b/package/dash/0002-fix-parallel-build.patch
new file mode 100644
index 0000000..ac2be6a
--- /dev/null
+++ b/package/dash/0002-fix-parallel-build.patch
@@ -0,0 +1,40 @@
+tokens: fix parallel builds
+
+Currently, tokens.h and token_vars.h are each generated by a call to
+mktokens, which means mktokens is called twice.
+
+But mktokens generates both in a single run.
+
+This means that, with a fast-enough machine, the call to mktokens that
+generates tokens.h may finish before the call that generates
+token_vars.h. Then tokens.h is transiently incomplete (it can even be
+empty). By the time it is fully generated in the second run, a compile
+job that ends up using token.h may have already started, and the source
+file would include an in complete token.h and would be missing some
+token definitions.
+
+We fix that by making token.h a dependency of token_vars.h, with a
+dummy recipe (to force it not being PHONY). The actual recipe is for
+token_vars.h
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -durN dash-0.5.8.orig/src/Makefile.am dash-0.5.8/src/Makefile.am
+--- dash-0.5.8.orig/src/Makefile.am 2014-09-28 10:19:32.000000000 +0200
++++ dash-0.5.8/src/Makefile.am 2017-03-07 09:53:28.579811603 +0100
+@@ -45,7 +45,14 @@
+ mktokens mkbuiltins builtins.def.in mkinit.c \
+ mknodes.c nodetypes nodes.c.pat mksyntax.c mksignames.c
+
+-token.h token_vars.h: mktokens
++# Both token.h and token_vars.h are generated by a single call
++# to mktokens. However, token.h is the only file that is used
++# as a dependency, so we must ensure token_vars.h is generated
++# first.
++token.h: token_vars.h
++ @:
++
++token_vars.h: mktokens
+ sh $^
+
+ builtins.def: builtins.def.in $(top_builddir)/config.h
diff --git a/package/dash/dash.mk b/package/dash/dash.mk
index ed8525c..4f2b6ed 100644
--- a/package/dash/dash.mk
+++ b/package/dash/dash.mk
@@ -11,6 +11,9 @@ DASH_PATCH = dash_$(DASH_VERSION)-1.diff.gz
DASH_LICENSE = BSD-3c, GPLv2+ (mksignames.c)
DASH_LICENSE_FILES = COPYING
+# 0002-fix-parallel-build.patch
+DASH_AUTORECONF = YES
+
define DASH_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 $(@D)/src/dash $(TARGET_DIR)/bin/dash
endef