-
Notifications
You must be signed in to change notification settings - Fork 34
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
[GraalVM] Static image with musl libc
fails with error: ‘struct termios’ has no member named ‘c_ispeed’
#189
Comments
error: ‘struct termios’ has no member named ‘c_ispeed’
error: ‘struct termios’ has no member named ‘c_ispeed’
error: ‘struct termios’ has no member named ‘c_ispeed’
musl libc
fails with error: ‘struct termios’ has no member named ‘c_ispeed’
Hm, is there a way to change the struct definition based on the linked libc? |
Sorry, I don't know how to do that. A quick search showed a similar issue on OpenJDK - https://bugs.openjdk.org/browse/JDK-8308544 |
When compiling a native image for linux with musl libc, the following error was displayed: `'struct termios' has no member named 'c_ispeed'` On musl, it is named `__c_ispeed` Since we don't really need those fields anyway, we can remove them from the struct definition. We then need to mark the struct definition as incomplete. The documentation says: If marked as incomplete, we will not try to determine the size of the struct. `StackValue.get(structType)` is actually a shortcut for `StackValue.get(SizeOf.get(structType))` We now simply need to pass the explicit size in bytes. Fixes #189
I do have a sample GraalVM native image project to create a static image with
musl libc
. Recently the build started failing (not sure if it's because of any change in GH Action env or updating to the latest dependency2.7.1
) with the following error message (com.github.ajalt.mordant.internal.syscalls.nativeimage.LinuxLibC$termios.getC_ispeed()
)Native image builds with mordant are working fine on all other platforms (Windows/Linux/Mac)
The text was updated successfully, but these errors were encountered: