diff mbox series

[oe,meta-networking,1/2] rdma-core: Replace pthread_yield with sched_yield

Message ID 20191215050936.25027-1-raj.khem@gmail.com
State Accepted
Commit 29126c33387229ae2cb585b863de7b17c317f86e
Headers show
Series [oe,meta-networking,1/2] rdma-core: Replace pthread_yield with sched_yield | expand

Commit Message

Khem Raj Dec. 15, 2019, 5:09 a.m. UTC
Fixes

/usr/src/debug/rdma-core/26.1-r0/git/librdmacm/rsocket.c:3041: undefined reference to `pthread_yield'
collect2: error: ld returned 1 exit status

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Cc: Kai Kang <kai.kang@windriver.com>
---
 ...sched_yield-instead-of-pthread_yield.patch | 30 +++++++++++++++++++
 .../rdma-core/rdma-core_26.1.bb               |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta-networking/recipes-support/rdma-core/rdma-core/0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch

-- 
2.24.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/rdma-core/rdma-core/0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch b/meta-networking/recipes-support/rdma-core/rdma-core/0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch
new file mode 100644
index 0000000000..80abd33139
--- /dev/null
+++ b/meta-networking/recipes-support/rdma-core/rdma-core/0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch
@@ -0,0 +1,30 @@ 
+From 6ac9562d756d42592994aeaac7a5e7b2bbce5cab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 14 Dec 2019 14:07:57 -0800
+Subject: [PATCH] librdmacm: Use sched_yield instead of pthread_yield
+
+glibc redirects pthread_yield to sched_yield additionally we get it
+working with musl on linux
+
+Upstream-Status: Submitted [https://github.com/linux-rdma/rdma-core/pull/635]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ librdmacm/rsocket.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/librdmacm/rsocket.c b/librdmacm/rsocket.c
+index 89ae2139..7fc5b266 100644
+--- a/librdmacm/rsocket.c
++++ b/librdmacm/rsocket.c
+@@ -3038,7 +3038,7 @@ static int rs_poll_enter(void)
+ 	pthread_mutex_lock(&mut);
+ 	if (suspendpoll) {
+ 		pthread_mutex_unlock(&mut);
+-		pthread_yield();
++		sched_yield();
+ 		return -EBUSY;
+ 	}
+ 
+-- 
+2.24.1
+
diff --git a/meta-networking/recipes-support/rdma-core/rdma-core_26.1.bb b/meta-networking/recipes-support/rdma-core/rdma-core_26.1.bb
index 1afe496c5a..87710bcf14 100644
--- a/meta-networking/recipes-support/rdma-core/rdma-core_26.1.bb
+++ b/meta-networking/recipes-support/rdma-core/rdma-core_26.1.bb
@@ -8,6 +8,7 @@  RDEPENDS_${PN} = "bash perl"
 BRANCH = "stable-v${@d.getVar('PV').split('.')[0]}"
 SRC_URI = "git://github.com/linux-rdma/rdma-core.git;branch=${BRANCH} \
            file://0001-Remove-man-files-which-cant-be-built.patch \
+           file://0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch \
            "
 SRCREV = "9f820de9ca7d6e315be92bc830d354afad3e7960"
 S = "${WORKDIR}/git"