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

hashcat-cli.c: fix build against musl libc #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rofl0r
Copy link

@rofl0r rofl0r commented Nov 25, 2016

GLIBC's termio.h is just an empty file with 2 include directives:

#include <termios.h>
#include <sys/ioctl.h>

and a comment that says that it is obsolete and you should use termios.h
and struct termios instead - exactly what musl libc does.

since the obsolete interface was replaced with termios by POSIX, musl
only implements the standardized interface.

GLIBC's termio.h is just an empty file with 2 include directives:

 #include <termios.h>
 #include <sys/ioctl.h>

and a comment that says that it is obsolete and you should use termios.h
and struct termios instead - exactly what musl libc does.

since the obsolete interface was replaced with termios by POSIX, musl
only implements the standardized interface.

also, instead of doing raw ioctl syscalls, we now use POSIX' tcgetattr()
and tcsetattr(), which are the high-level API to deal with struct termios.
@rofl0r
Copy link
Author

rofl0r commented Nov 26, 2016

updated to use tcgetattr/tcsetattr instead of ioctl syscalls and merged the BSD/OSX/LINUX code together..

@rofl0r
Copy link
Author

rofl0r commented Nov 26, 2016

we probably could even get rid of all ifdefs apart from

#ifdef WINDOWS
... nonportable code here
#else
posix code here
#done

that way the code works by default on all platforms conforming to POSIX, even those that are not hardcoded in yet.

@rofl0r
Copy link
Author

rofl0r commented Nov 29, 2016

hello @jsteube : is there something missing in this PR (i would be glad to add that then) or is this repo already abandoned ?
this repo here seems to be better suited for my usecase, since it doesn't depend on openCL and i would be glad if it compiled OOTB.

@jsteube
Copy link
Member

jsteube commented Nov 29, 2016 via email

@rofl0r
Copy link
Author

rofl0r commented Dec 1, 2016

looks as if all openCL implementations apart from pocl and mesa are closed-source and as such not musl-compatible (the closed-source ones are all linked against GLIBC).
mesa is AMD-GPU only, and pocl in beta stadium, so it seems we have to stick to "legacy" for the time being.

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