Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build when linking against musl #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link

@Calinou Calinou commented Nov 10, 2019

musl doesn't define PTHREAD_MUTEX_RECURSIVE, so it has to be done manually.

From my testing, this seems to work when using both GCC + glibc and GCC + musl (on Fedora 31 and Alpine respectively).

@akien-mga
Copy link

musl doesn't define this macro, so it has to be done manually. Since there doesn't seem to be a macro to detect whether musl is used, we should always define the macro on Linux.

I think you can use !defined(__GLIBC__): https://stackoverflow.com/questions/4266354/how-to-tell-if-glibc-is-used
It might still let through some non-GNU C libraries which define __GLIBC__ for compatibility, but at least musl doesn't seem to: http://git.musl-libc.org/cgit/musl/tree/include/features.h

musl doesn't define `PTHREAD_MUTEX_RECURSIVE`, so it has to be done
manually.
@akien-mga
Copy link

Any chance to see this reviewed/merged? We use it downstream in Godot, would be good to have it upstream for others.

@Calinou
Copy link
Author

Calinou commented Mar 9, 2021

Bump (again) 🙂

cc @kmammou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants