haskell-crypto / cryptonite

lowlevel set of cryptographic primitives for haskell
Other
226 stars 139 forks source link

Cryptonite 0.27 fails to compile, but 0.26 works #326

Closed LeventErkok closed 4 years ago

LeventErkok commented 4 years ago

I can successfully install cryptonite 0.26, but 0.27 fails with:

[135 of 135] Compiling Crypto.Tutorial  ( Crypto/Tutorial.hs, dist/build/Crypto/Tutorial.o )
In file included from cbits/aes/x86ni.h:38,

                 from cbits/aes/gf.c:35:0: error:

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/wmmintrin.h:34:3: error:
     error: #error "AES/PCLMUL instructions not enabled"
   |
34 | # error "AES/PCLMUL instructions not enabled"
   |   ^
In file included from cbits/aes/x86ni.h:39,

                 from cbits/aes/gf.c:35:0: error:

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/tmmintrin.h:31:3: error:
     error: #error "SSSE3 instruction set not enabled"
   |
31 | # error "SSSE3 instruction set not enabled"
   |   ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build cryptonite-0.27

This is compiling on a somewhat limited virtual machine, but it actually does support SSSE3:

$ cat /proc/cpuinfo | grep sse3
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm

and given 0.26 compiles fine, I wonder if a bug crept in in the meantime during configuration perhaps?

ocheron commented 4 years ago

GCC >= 4.9 is supported, or else you can try disabling cabal flag use_target_attributes. See the README file for details.

LeventErkok commented 4 years ago

-f -use_target_attributes solved it indeed. Thanks!