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 on musl #3206

Open
wants to merge 3 commits into
base: 2.9
Choose a base branch
from
Open

Fix build on musl #3206

wants to merge 3 commits into from

Conversation

NTULINUX
Copy link
Contributor

@NTULINUX NTULINUX commented Dec 2, 2024

While probably not perfect; this patch series allows LinuxCNC to be successfully compiled on a musl system.

Attempt to build LinuxCNC against musl C library

Signed-off-by: Alec Ari <[email protected]>
Signed-off-by: Alec Ari <[email protected]>
Signed-off-by: Alec Ari <[email protected]>
@NTULINUX
Copy link
Contributor Author

NTULINUX commented Dec 2, 2024

Please see #3185 for discussion on the changes.

@BsAtHome
Copy link
Contributor

BsAtHome commented Dec 2, 2024

The call to pthread_setaffinity_np() is wrong. It is performed before the thread is created by pthread_create(). The thread's ID is unknown at that time. In my earlier description, I wrote that such change should go after creating the thread (see #3185 (comment)).

Also, using pthread_setaffinity_np() must be conditional and only be used if pthread_attr_setaffinity_np() is not available. Therefore, you need to have a autoconf check.

@NTULINUX
Copy link
Contributor Author

NTULINUX commented Dec 3, 2024

I never wrote an autoconf test before for a C function but I'll try :) I have some experience with autotools and I think there's a few places I know to look for example code.

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