Patchwork ltp: fix makefile race

login
register
mail settings
Submitter Ross Burton
Date Jan. 15, 2014, 2:10 p.m.
Message ID <1389795054-16993-1-git-send-email-ross.burton@intel.com>
Download mbox | patch
Permalink /patch/64897/
State New
Headers show

Comments

Ross Burton - Jan. 15, 2014, 2:10 p.m.
There is a Makefile dependency race causing occasional build failures:

*** No rule to make target `.../work/core2-poky-linux/ltp/20130904-r0/git/testcases/kernel/include/linux_syscall_numbers.h.23161.sh', needed by `linux_syscall_numbers.h'.  Stop.

This is due to a bad dependency wildcard that is matching more than the one file
it should match, so replace it with a concrete filename.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-extended/ltp/ltp/regen-makefile.patch |   22 ++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20130904.bb          |    1 +
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-extended/ltp/ltp/regen-makefile.patch

Patch

diff --git a/meta/recipes-extended/ltp/ltp/regen-makefile.patch b/meta/recipes-extended/ltp/ltp/regen-makefile.patch
new file mode 100644
index 0000000..3e114a1
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/regen-makefile.patch
@@ -0,0 +1,22 @@ 
+Fix the dependencies for linux_syscall_numbers.h where in a parallel build it was
+finding the temporary file linux_syscall_numbers.h.[pid].sh (where sh is an
+architecture name).  Instead don't wildcard *.sh as the only .sh we care about
+here is regen.sh, so hard-code that.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/testcases/kernel/include/Makefile b/testcases/kernel/include/Makefile
+index db21a2a..585eb5e 100644
+--- a/testcases/kernel/include/Makefile
++++ b/testcases/kernel/include/Makefile
+@@ -28,7 +28,7 @@ INSTALL_DIR		:= $(includedir)
+ 
+ MAKE_TARGETS		:= linux_syscall_numbers.h
+ 
+-linux_syscall_numbers.h: $(wildcard $(abs_srcdir)/*.sh $(abs_srcdir)/*.in)
+-	$(SHELL) "$(abs_srcdir)/regen.sh"
++linux_syscall_numbers.h: $(abs_srcdir)/regen.sh $(wildcard $(abs_srcdir)/*.in)
++	$(SHELL) "$<"
+ 
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/meta/recipes-extended/ltp/ltp_20130904.bb b/meta/recipes-extended/ltp/ltp_20130904.bb
index 4722a38..c346c5c 100644
--- a/meta/recipes-extended/ltp/ltp_20130904.bb
+++ b/meta/recipes-extended/ltp/ltp_20130904.bb
@@ -23,6 +23,7 @@  DEPENDS = "attr libaio libcap acl openssl"
 
 SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch \
+           file://regen-makefile.patch \
 "
 
 SRCREV = "a8c42db5f9314211811c36275a21f83902830dc5"