jschanck / ntru

Implementations of the NIST post-quantum cryptography process finalist NTRU.
https://ntru.org
Creative Commons Zero v1.0 Universal
41 stars 8 forks source link

Current master avx2-hrss701 can't compile on Mac #15

Closed mouse07410 closed 4 years ago

mouse07410 commented 4 years ago
$ make test -C avx2-hrss701
clang -O3 -fomit-frame-pointer -march=native -fPIC -fPIE -pie -Wall -Wextra -Wpedantic -DCRYPTO_NAMESPACE\(s\)=ntru##s -o test/test_polymul fips202.c kem.c owcpa.c pack3.c packq.c poly.c poly_r2_inv.c sample.c sample_iid.c cmov.c randombytes.c square_1_701_patience.s square_3_701_patience.s square_6_701_patience.s square_12_701_shufbytes.s square_15_701_shufbytes.s square_27_701_shufbytes.s square_42_701_shufbytes.s square_84_701_shufbytes.s square_168_701_shufbytes.s square_336_701_shufbytes.s poly_rq_mul.s poly_r2_mul.s poly_rq_to_s3.s vec32_sample_iid.s poly_mod_3_Phi_n.s poly_mod_q_Phi_n.s poly_s3_to_rq.s poly_s3_inv.s poly_rq_mul_x_minus_1.s test/test_polymul.c cpucycles.c
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
poly_s3_to_rq.s:3116:1: error: unsupported symbol modifier in branch relocation
call ntrupoly_Rq_mul_x_minus_1@plt
^
cpucycles.c:6:3: warning: extension used [-Wlanguage-extension-token]
  asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
  ^
1 warning generated.
mouse07410 commented 4 years ago

Recommended and tested (on Mac and Linux) fix is here: https://github.com/jschanck/ntru/issues/14#issuecomment-683524509