johanns / sha3

SHA3 for Ruby is a XKCP based native (C) binding to SHA3 (FIPS 202) cryptographic hashing algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support --disable-march-tune-native

mmkader85 opened this issue · comments

Hello @johanns / @mmoghadas,

Thanks for the gem. As you know that Apple M1 doesn't support march=native, please add support for --disable-march-tune-native.

https://developer.apple.com/forums/thread/672654

--- a/ext/sha3/extconf.rb
+++ b/ext/sha3/extconf.rb
@@ -17,5 +17,10 @@ end
 find_header("sha3.h")
 find_header("digest.h")

-$CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=native '
+if enable_config('march-tune-native', false)
+  $CFLAGS = ' -fomit-frame-pointer -O3 -g0 '
+else
+  $CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=native '
+end
+

@mmkader85 Thanks for the report. I'll cut a new gem with a fix for Apple M1 support in a few days.

Hi there,

Any updates on this?

Best,

commented

Hi. This definitely needs a bump :)

Merged @orlando-labs fixed and cut a new gem (1.0.3).

Thanks @orlando-labs