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

Add a musl compatible fallback for libc detection on Linux #1072

Closed
wants to merge 4 commits into from
Closed

Add a musl compatible fallback for libc detection on Linux #1072

wants to merge 4 commits into from

Conversation

drandreas
Copy link
Contributor

The libc detection code is very glibc centric. At the end of config-linux.h there was already a uclib fixup. I've added an additional section for musl.

Follow up to #914

Copy link
Member

@iguessthislldo iguessthislldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't an approval or disapproval, just some observations, but I'm personally interested. I've never directly used musl before, but through zig and some os development research I at least know of it. At the very least making ACE slightly more platform agnostic can never a bad thing.

ACE/ace/config-linux.h Outdated Show resolved Hide resolved
#define ACE_LACKS_ISCTYPE
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS

// Following the example set by uclib undef some festures
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think would be better to actually fix these instead, which would benefit the ulibc support too. For example ACE_SCANDIR_CMP_USES_VOIDPTR up on line 112 looks like it's just assuming __GLIBC__ is defined, so that could be fixed by adding an check for defined (__GLIBC__) before trying to use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not feel competent enough to perform this task. I would be thankful if this could be handled in another PR by someone else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's understandable. ACE is a labyrinth of macros.

ACE/ace/config-linux.h Outdated Show resolved Hide resolved
ACE/ace/config-linux.h Outdated Show resolved Hide resolved
@drandreas
Copy link
Contributor Author

We switched from glibc to musl to ease the maintenance of a very old hardware. One of the advantages of musl is its Linux Kernel independence. It simply "works" with Kernels 2.6.39 and up and it can even be back ported to older Kernels with little effort:
https://www.openwall.com/lists/musl/2020/03/10/10

ACE_Dev_Poll_Reactor is using __uint32_t for no apparent
reason. Since struct epoll_event.events is defined as
uint32_t and using __uint32_t breaks compatibility
with musl, __uint32_t should be replaced with uint32_t.
But to conform with ACE Guidelines I'm using ACE_UINT32.
@drandreas
Copy link
Contributor Author

closed due to inactivity

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

Successfully merging this pull request may close these issues.

3 participants