<div dir="ltr">In retrospect this patch is not appropriate at the OE project level and should be handled in a local layer. Consequently I wish to withdraw it from further consideration here. Thank you all for your responses.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 5:20 PM, Gary S. Robertson <span dir="ltr"><<a href="mailto:gary.robertson@linaro.org" target="_blank">gary.robertson@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: "Gary S. Robertson" <<a href="mailto:gary.robertson@linaro.org">gary.robertson@linaro.org</a>><br>
<br>
In the OE build environment the features on the build host<br>
may not match those of the runtime host -so- the conditional<br>
compilation clauses were deleted which required the presence<br>
of priority inheriting mutexes in order to compile initialization<br>
of a mutex with priority inheritance. This allows this code to<br>
execute and fail if the runtime host lacks priority inheritance,<br>
while eliminating any dependence on PI mutexes in the build host.<br>
<br>
Signed-off-by: Gary S. Robertson <<a href="mailto:gary.robertson@linaro.org">gary.robertson@linaro.org</a>><br>
---<br>
...utex-initialization-without-PI-configured.patch | 66 ++++++++++++++++++++<br>
meta/recipes-extended/ltp/<a href="http://ltp_20140422.bb" target="_blank">ltp_20140422.bb</a> | 1 +<br>
2 files changed, 67 insertions(+)<br>
create mode 100644 meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch<br>
<br>
diff --git a/meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch b/meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch<br>
new file mode 100644<br>
index 0000000..2de6e22<br>
--- /dev/null<br>
+++ b/meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch<br>
@@ -0,0 +1,66 @@<br>
+From 62dfb25fa3b6e71650bc3fff9a4a0eaec0f5ac8e Mon Sep 17 00:00:00 2001<br>
+From: "Gary S. Robertson" <<a href="mailto:gary.robertson@linaro.org">gary.robertson@linaro.org</a>><br>
+Date: Fri, 25 Jul 2014 09:25:13 -0500<br>
+Subject: [PATCH] Allow mutex initialization without PI configured<br>
+<br>
+LTP is primarily intended to be built and run on the same machine,<br>
+and uses autotools / autoconf to determine the features of the host<br>
+machine's environment prior to compilation. However in the OE<br>
+environment, LTP may get built into a generic filesystem image<br>
+which will be used with a variety of different kernels later...<br>
+so for the OE environment it is better not to disable features<br>
+based on the compile-time environment. This patch removes<br>
+compile-time dependencies on priority-inheriting mutexes and<br>
+allows the code to attempt initialization of PI mutexes even<br>
+if the runtime environment lacks that feature... in which case<br>
+the associated test should fail.<br>
+<br>
+Signed-off-by: Gary S. Robertson <<a href="mailto:gary.robertson@linaro.org">gary.robertson@linaro.org</a>><br>
+---<br>
+ testcases/realtime/lib/librttest.c | 2 --<br>
+ testcases/realtime/stress/pi-tests/testpi-3.c | 2 --<br>
+ 2 files changed, 4 deletions(-)<br>
+<br>
+diff --git a/testcases/realtime/lib/librttest.c b/testcases/realtime/lib/librttest.c<br>
+index 0dd6019..9f37d08 100644<br>
+--- a/testcases/realtime/lib/librttest.c<br>
++++ b/testcases/realtime/lib/librttest.c<br>
+@@ -586,7 +586,6 @@ void *busy_work_us(int us)<br>
+<br>
+ void init_pi_mutex(pthread_mutex_t * m)<br>
+ {<br>
+-#if HAVE_DECL_PTHREAD_PRIO_INHERIT<br>
+ pthread_mutexattr_t attr;<br>
+ int ret;<br>
+ int protocol;<br>
+@@ -609,7 +608,6 @@ void init_pi_mutex(pthread_mutex_t * m)<br>
+ if ((ret = pthread_mutex_init(m, &attr)) != 0) {<br>
+ printf("Failed to init mutex: %d (%s)\n", ret, strerror(ret));<br>
+ }<br>
+-#endif<br>
+<br>
+ /* FIXME: does any of this need to be destroyed ? */<br>
+ }<br>
+diff --git a/testcases/realtime/stress/pi-tests/testpi-3.c b/testcases/realtime/stress/pi-tests/testpi-3.c<br>
+index 30f38f6..807c9cc 100644<br>
+--- a/testcases/realtime/stress/pi-tests/testpi-3.c<br>
++++ b/testcases/realtime/stress/pi-tests/testpi-3.c<br>
+@@ -365,7 +365,6 @@ int main(int argc, char *argv[])<br>
+<br>
+ printf("Start %s\n", argv[0]);<br>
+<br>
+-#if HAVE_DECL_PTHREAD_PRIO_INHERIT<br>
+ if (!nopi) {<br>
+ pthread_mutexattr_t mutexattr;<br>
+ int protocol;<br>
+@@ -386,7 +385,6 @@ int main(int argc, char *argv[])<br>
+ printf("Failed to init mutex: %d\n", retc);<br>
+ }<br>
+ }<br>
+-#endif<br>
+<br>
+ startThread(&arg1);<br>
+ startThread(&arg2);<br>
+--<br>
+1.7.9.5<br>
+<br>
diff --git a/meta/recipes-extended/ltp/<a href="http://ltp_20140422.bb" target="_blank">ltp_20140422.bb</a> b/meta/recipes-extended/ltp/<a href="http://ltp_20140422.bb" target="_blank">ltp_20140422.bb</a><br>
index 30761fd..2ac2187 100644<br>
--- a/meta/recipes-extended/ltp/<a href="http://ltp_20140422.bb" target="_blank">ltp_20140422.bb</a><br>
+++ b/meta/recipes-extended/ltp/<a href="http://ltp_20140422.bb" target="_blank">ltp_20140422.bb</a><br>
@@ -26,6 +26,7 @@ SRC_URI = "git://<a href="http://github.com/linux-test-project/ltp.git" target="_blank">github.com/linux-test-project/ltp.git</a> \<br>
file://0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch \<br>
file://ltp-Do-not-link-against-libfl.patch \<br>
file://automake-foreign.patch \<br>
+ file://0001-Allow-mutex-initialization-without-PI-configured.patch \<br>
"<br>
<br>
S = "${WORKDIR}/git"<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br></div>