Skip to contentSkip to conversation

rdma-core: Replace pthread_yield with sched_yield

PATCH New Khem Raj 1 participant 2 messages Dec 15, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 rdma-core: Replace pthread_yield with sched_yield

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

---
 ...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
meta-networking/recipes-support/rdma-core/rdma-core/0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch new file +30 -0
new file mode 100644
index 0000000000..80abd33139
@@ -0,0 +1,30 @@
+From 6ac9562d756d42592994aeaac7a5e7b2bbce5cab Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-networking/recipes-support/rdma-core/rdma-core_26.1.bb +1 -0
index 1afe496c5a..87710bcf14 100644
@@ -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"
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH 2/2 grpc: Define libdir and cmakedir in terms of multilib

This helps in avoiding packaging errors seen with distros enabling multilib

Fixes

ERROR: grpc-1.24.3-r0 do_package: QA Issue: grpc: Files/directories were installed but not shipped in any package:
/usr/lib/libgrpc++.so.1.24.3
...
/usr/lib/cmake
/usr/lib/cmake/grpc
/usr/lib/cmake/grpc/gRPCConfigVersion.cmake
/usr/lib/cmake/grpc/gRPCConfig.cmake
/usr/lib/cmake/grpc/gRPCTargets-noconfig.cmake
/usr/lib/cmake/grpc/gRPCTargets.cmake
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or de lete them within do_install.

---
 meta-networking/recipes-devtools/grpc/grpc_1.24.3.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-networking/recipes-devtools/grpc/grpc_1.24.3.bb +3 -1
index 24072c0832..3cde6f79cc 100644
@@ -36,6 +36,8 @@ EXTRA_OECMAKE = " \
     -DgRPC_INSTALL=ON \
     -DCMAKE_CROSSCOMPILING=ON \
     -DBUILD_SHARED_LIBS=ON \
+    -DgRPC_INSTALL_LIBDIR=${baselib} \
+    -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \
     "
 
 do_configure_prepend_mipsarch() {
@@ -48,6 +50,6 @@ do_configure_prepend_toolchain-clang_x86() {
 
 BBCLASSEXTEND = "native nativesdk"
 
-SYSROOT_DIRS_BLACKLIST_append_class-target = "${libdir}/cmake/grpc"
+SYSROOT_DIRS_BLACKLIST_append_class-target = "${baselib}/cmake/grpc"
 
 FILES_${PN}-dev += "${bindir}"
Signature · 1 line
2.24.1