From 038f7e70cfe30e550030d227ab7b318f9756b6ed Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 19 Sep 2025 08:52:24 +0200 Subject: [PATCH] Do not use RW mutexes on RISC-V arch For unknown reasons using RW mutexes on RISC-V arch seems to be broken, at least with glibc. Fixes #28550 Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/28634) (cherry picked from commit bea53924ce729353df41129c58bd3349df7d7a82) --- crypto/threads_pthread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c index b75971d19ab..ace2dc49906 100644 --- a/crypto/threads_pthread.c +++ b/crypto/threads_pthread.c @@ -62,8 +62,10 @@ __tsan_mutex_post_lock((x), 0, 0) /* * The Non-Stop KLT thread model currently seems broken in its rwlock * implementation + * Likewise is there a problem with the glibc implementation on riscv. */ -# if defined(PTHREAD_RWLOCK_INITIALIZER) && !defined(_KLT_MODEL_) +# if defined(PTHREAD_RWLOCK_INITIALIZER) && !defined(_KLT_MODEL_) \ + && !defined(__riscv) # define USE_RWLOCK # endif -- 2.47.3