https://bugs.gentoo.org/898866 From: Brahmajit Das Date: Sat, 17 Jun 2023 15:32:10 +0000 Subject: [PATCH 1/1] Fix building against musl C library PTHREAD_RWLOCK_PREFER_WRITER_NP isn't available in musl libc/non-glibc systems. Checking for only __linux__ being defined isn't enough, additional check of __GLIBC__ being defined is needed. Signed-off-by: Brahmajit Das --- a/lib/FXReadWriteLock.cpp +++ b/lib/FXReadWriteLock.cpp @@ -80,7 +80,7 @@ FXReadWriteLock::FXReadWriteLock(){ FXASSERT(sizeof(data)>=sizeof(pthread_rwlock_t)); pthread_rwlockattr_t rwlockatt; pthread_rwlockattr_init(&rwlockatt); -#if defined(__linux__) +#if defined(__linux__) && defined(__GLIBC__) pthread_rwlockattr_setkind_np(&rwlockatt,PTHREAD_RWLOCK_PREFER_WRITER_NP); #endif pthread_rwlock_init((pthread_rwlock_t*)data,&rwlockatt); -- 2.41.0