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 compilation on musl #394

Closed
wants to merge 2 commits into from
Closed

Conversation

classabbyamp
Copy link

this should allow for compilation on musl libc

possibly fixes #150

@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

I have a simpler solution to the first part. Simply use:

    qsort (tocalls, num_tocalls, sizeof(struct tocalls_s), tocall_cmp);

gcc does not complain about the missing type cast. Don't recall why I put it in there.

@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

cmake tests whether the runtime library contains strlcpy and strlcat.
This determines whether we include our own copy.
We should be able to use result of that test rather than listing all of the possible operating system variations.

To be continued...

@classabbyamp
Copy link
Author

updated to address the first comment.

cmake tests whether the runtime library contains strlcpy and strlcat

I couldn't find this in any of the cmake files. Can you point it out to me?

@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

The "dev" development branch already has this in direwolf.h

#ifndef HAVE_STRLCPY // Need to supply our own.
...
#define strlcpy(dst,src,siz) strlcpy_debug(dst,src,siz)
size_t strlcpy_debug(char *restrict dst, const char *restrict src, size_t siz);
...
#endif

Were you using the "master" branch?

@classabbyamp
Copy link
Author

classabbyamp commented May 24, 2022

yes I was basing the PR on master. so that change won't be needed?

@classabbyamp classabbyamp changed the base branch from master to dev May 24, 2022 01:04
this should allow for compilation on musl libc

possibly fixes wb2osz#150
@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

Try the "dev" branch.
My convention is to do development on "dev" and push to master when I have something stable.

@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

Oops. I meant merge to master. Need to be more careful about terminology.

@classabbyamp
Copy link
Author

Ok I see you've pulled in the change to dev in 59288b7, I'll close this now

@classabbyamp classabbyamp deleted the fix-musl branch May 24, 2022 01:07
@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

Thanks for helping to make this more portable.

@classabbyamp
Copy link
Author

No problem! I'm trying to get direwolf accepted into void linux's repositories in void-linux/void-packages#37147

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.

Compile error in Alpine Linux 3.7
2 participants