From: Randall S. Becker Date: Mon, 2 Feb 2026 17:31:13 +0000 (+0000) Subject: Guard RWLOCK methods by USE_RWLOCK in threads_pthread.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=307ed7b8f0345d21a4c900633b3ffc3b5ca064d7;p=thirdparty%2Fopenssl.git Guard RWLOCK methods by USE_RWLOCK in threads_pthread.c Fixes: #29883 Signed-off-by: Randall S. Becker Reviewed-by: Neil Horman Reviewed-by: Paul Dale MergeDate: Wed Feb 4 15:55:47 2026 (Merged from https://github.com/openssl/openssl/pull/29924) --- diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c index 75d26c9b305..ca2cde003e1 100644 --- a/crypto/threads_pthread.c +++ b/crypto/threads_pthread.c @@ -95,7 +95,7 @@ * 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(_PUT_MODEL_) \ && !defined(__riscv) #define USE_RWLOCK #endif @@ -852,6 +852,7 @@ static ossl_inline int ossl_rwlock_unlock(pthread_rwlock_t *lock) #else /* !REPORT_RWLOCK_CONTENTION */ +#if defined(USE_RWLOCK) static ossl_inline void ossl_init_rwlock_contention_data(void) { } @@ -870,6 +871,7 @@ static ossl_inline int ossl_rwlock_unlock(pthread_rwlock_t *rwlock) { return pthread_rwlock_unlock(rwlock); } +#endif /* USE_RWLOCK */ #endif /* REPORT_RWLOCK_CONTENTION */ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)