You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2023/03/18 19:59:37 UTC

[openoffice] branch AOO41X updated: Auto-disable use of pthread_mutexattr_setkind_np due to compile errors (Revised-Revised)

This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO41X by this push:
     new d5b37d1cdb Auto-disable use of pthread_mutexattr_setkind_np due to compile errors (Revised-Revised)
d5b37d1cdb is described below

commit d5b37d1cdb91c4ac6e73fa6110cd737d9cf84eda
Author: 20kdc <as...@gmail.com>
AuthorDate: Tue Mar 7 12:15:56 2023 +0000

    Auto-disable use of pthread_mutexattr_setkind_np due to compile errors (Revised-Revised)
    
    The code being disabled here causes a compilation issue on Ubuntu Jammy Jellyfish. (undefined reference to `pthread_mutexattr_setkind_np`) The best I can tell, https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2003146 explains this somewhat.
    
    This workaround likely hasn't been necessary for the past 20 years, if glibc "converted to git" repositories are any indication (see for instance https://github.com/lattera/glibc/blob/d82e4c7bb231c9e0f835bd46467563ac3b56cebe/linuxthreads/sysdeps/pthread/pthread.h ).
    
    And indeed, anyone who would be attempting to run OpenOffice on such a system would likely encounter issues with the other varied libraries in use.
    
    Unfortunately other compilation issues prevented me from performing a full test, but osl mutex tests pass at least.
    
    (cherry picked from commit 02cabb04b49373d08a7dec0ed934e6f30ac72dc8)
---
 main/sal/osl/unx/mutex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/main/sal/osl/unx/mutex.c b/main/sal/osl/unx/mutex.c
index c8702b9ba3..3ad5dafa35 100644
--- a/main/sal/osl/unx/mutex.c
+++ b/main/sal/osl/unx/mutex.c
@@ -30,10 +30,12 @@
 #include <stdlib.h>
 
 #if defined LINUX /* bad hack */
+#if !defined(__USE_XOPEN2K8)
 int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int);
 #define pthread_mutexattr_settype pthread_mutexattr_setkind_np
 #define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
 #endif
+#endif
 
 /*
 	Implementation notes: