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 non-glibc 32 bit architectures #524

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Conversation

ii8
Copy link
Contributor

@ii8 ii8 commented Nov 5, 2023

No description provided.

platform/linux: `__suseconds_t_defined` is not portable across libcs
and should only be checked on glibc.
@MatthewFluet
Copy link
Member

Seems reasonable. I'm surprised that it isn't an issue on 64-bit platforms. I was playing around with a musl build on my amd64-linux Fedora machine, and I needed to avoid the #include <linux/types.h>.

Long term, I suspect that it would be better to clean up these platform files and eliminate the workarounds for outdated systems.

@ii8
Copy link
Contributor Author

ii8 commented Nov 6, 2023

It's sometimes not an issue on 64 bit platforms because while the type is still defined twice, it will be 64 bits in both cases so the compiler doesn't mind. It's possible that it depends on the kernel version, some kernels will have __kernel_suseconds_t as 64 bits and others as 32 bits, only when it's different from the libc value does the error surface.

@MatthewFluet
Copy link
Member

I suspect that what I ran into was a situation where the musl-gcc cross-compilation wrapper doesn't expose linux in the cpp #include path, but it is exposed under systems on which you were building.

@MatthewFluet MatthewFluet merged commit 38eb9de into MLton:master Nov 6, 2023
8 of 9 checks passed
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