[meta-intel] [PATCH 06/10] openssl-qat: Add patch to support MUSL
Saul Wold
sgw at linux.intel.com
Fri Feb 10 11:10:10 PST 2017
openssl-qat was using pthread_yield() instead of the POSIX API of
sched_yield() which MUSL supports
Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
.../openssl-qat/0001-Use_sched_yield_api.patch | 47 ++++++++++++++++++++++
.../openssl-qat/openssl-qat_0.4.9-009.bb | 2 +
2 files changed, 49 insertions(+)
create mode 100644 common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch
diff --git a/common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch b/common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch
new file mode 100644
index 0000000..1b7921f
--- /dev/null
+++ b/common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch
@@ -0,0 +1,47 @@
+From f4c50648752ee1000f606585f4df9fa6bd9ff8e8 Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw at linux.intel.com>
+Date: Wed, 8 Feb 2017 17:36:48 -0800
+Subject: [PATCH] openssl-qat: Use sched_yield() instead of pthread_yield()
+
+sched_yield() is the correct POSIX API to use for thread switching
+This futher supports building with MUSL.
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw at linux.intel.com>
+---
+ engines/qat_engine/e_qat.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/engines/qat_engine/e_qat.c b/engines/qat_engine/e_qat.c
+index 17d7935..af543bc 100644
+--- a/engines/qat_engine/e_qat.c
++++ b/engines/qat_engine/e_qat.c
+@@ -90,6 +90,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sched.h>
+ #include <pthread.h>
+ #include <unistd.h>
+ #include <ctype.h>
+@@ -545,7 +546,7 @@ CpaStatus myPerformOp(const CpaInstanceHandle instanceHandle,
+ pSrcBuffer, pDstBuffer, pVerifyResult);
+ if (status == CPA_STATUS_RETRY) {
+ qatPerformOpRetries++;
+- pthread_yield();
++ sched_yield();
+ if (uiRetry >= iMsgRetry
+ && iMsgRetry != QAT_INFINITE_MAX_NUM_RETRIES) {
+ break;
+@@ -588,7 +589,7 @@ static void *sendPoll(void *ih)
+ if (likely(CPA_STATUS_SUCCESS == status)) {
+ /* Do nothing */
+ } else if (CPA_STATUS_RETRY == status) {
+- pthread_yield();
++ sched_yield();
+ } else {
+ WARN("WARNING icp_sal_CyPollInstance returned status %d\n",
+ status);
+--
+2.7.4
+
diff --git a/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb b/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb
index f2c479e..e3d8ccc 100644
--- a/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb
+++ b/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb
@@ -7,6 +7,8 @@ SRC_URI += "git://opensslfoundation.com/openssl-async.git;branch=OpenSSL_1_0_1-
file://openssl-qat_0.4.9-009-openssl_qat-add-openssl-async-specific-symbols.patch \
"
+SRC_URI_append_libc-musl = " file://0001-Use_sched_yield_api.patch"
+
SRC_URI[openssl_qat.md5sum]="8e2b45cf9b345356bdff0956845c6103"
SRC_URI[openssl_qat.sha256sum]="c2334b4d1fc8498e06f0554ef155041a6bf441de134cfdd3635e5a449a34bf81"
--
2.7.4
More information about the meta-intel
mailing list