Skip to content

VHACD does not compile with musl libc #31555

@jameswestman

Description

@jameswestman

Godot version: 3bd49da
OS: Alpine Linux (Docker)

Issue description:
Godot Engine does not compile on Alpine (or other musl-based systems) due to the use of PTHREAD_MUTEX_RECURSIVE_NP in the third-party VHACD module. This appears to be a glibc-specific macro.

Here is the relevant log output:

[Initial build] Compiling ==> thirdparty/vhacd/src/VHACD.cpp
In file included from thirdparty/vhacd/inc/btScalar.h:190,
                 from thirdparty/vhacd/inc/btAlignedAllocator.h:23,
                 from thirdparty/vhacd/inc/btAlignedObjectArray.h:19,
                 from thirdparty/vhacd/inc/btConvexHullComputer.h:18,
                 from thirdparty/vhacd/src/VHACD.cpp:30:
thirdparty/vhacd/inc/vhacdMutex.h: In constructor 'VHACD::Mutex::Mutex()':
thirdparty/vhacd/inc/vhacdMutex.h:97:60: error: 'PTHREAD_MUTEX_RECURSIVE_NP' was not declared in this scope
         VHACD_VERIFY(pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP) == 0);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
thirdparty/vhacd/inc/vhacdMutex.h:97:9: note: in expansion of macro 'VHACD_VERIFY'
         VHACD_VERIFY(pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP) == 0);
         ^~~~~~~~~~~~
thirdparty/vhacd/inc/vhacdMutex.h:97:60: note: suggested alternative: 'PTHREAD_MUTEX_RECURSIVE'
         VHACD_VERIFY(pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP) == 0);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
thirdparty/vhacd/inc/vhacdMutex.h:97:9: note: in expansion of macro 'VHACD_VERIFY'
         VHACD_VERIFY(pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP) == 0);
         ^~~~~~~~~~~~
scons: *** [thirdparty/vhacd/src/VHACD.x11.tools.64.o] Error 1
scons: building terminated because of errors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions