Cynosureprime / rling

RLI Next Gen (Rling), a faster multi-threaded, feature rich alternative to rli found in hashcat utilities.
MIT License
81 stars 11 forks source link

feature: Apple Silicon / M1 / M1 Pro support #31

Open roycewilliams opened 2 years ago

roycewilliams commented 2 years ago

Copy-pasted from a friend's attempt to compile (to be clear, we didn't expect it to work "out of the box" :D )

/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:50:12:
error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size

To clarify, -DINTEL gets further, but we assume additional optimization is feasible. :D

akhepcat commented 2 years ago

Using non-byte-specific (i.e., "long long") identifiers is bad for portable code, because they change size on different architectures.

using types that are direct equivalents to "__uint32_t" or "__uint64_t" result in code that works as expected everywhere.

jermudgeon commented 2 years ago

I believe I have successfully compiled (Monterey 12.1, latest Xcode/clang/gcc) with:

superevr commented 1 year ago

I can confirm that it builds and runs fine on M1 mac. All I had to do was install judy from MacPorts and specify the include and lib directories.

The makefile didn't take CFLAGS and LDFLAGS like I expected, but those parameters can be shoved into COPTS, which overwrites the -DINTEL flag that would otherwise produce an error, "This header is only meant to be used on x86 and x64 architecture"

make all COPTS="-I/opt/local/include -L/opt/local/lib"