Tongsuo-Project / Tongsuo

铜锁/Tongsuo is a Modern Cryptographic Primitives and Protocols Library
https://www.tongsuo.net
Apache License 2.0
1.16k stars 186 forks source link

centos 7.9 编译Tongsuo-8.3.3报错:include/crypto/sm4.h:53:48: error: missing binary operator before token "(" #545

Closed ff2035 closed 12 months ago

ff2035 commented 12 months ago

centos 7.9 下编译Tongsuo-8.3.2正常,但Tongsuo-8.3.3会报错:

CentOS Linux release 7.9.2009

# 编译 Tongsuo
wget -q --no-check-certificate -c "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/8.3.3.tar.gz"
tar -xf 8.3.3.tar.gz
cd /root/source/Tongsuo-8.3.3
./config --prefix=/usr/local/babassl
make 

报错如下:

gcc  -I. -Iinclude -Icrypto -Icrypto/modes -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/babassl/ssl\"" -DENGINESDIR="\"/usr/local/babassl/lib/engines-1.1\"" -DNDEBUG  -MMD -MF crypto/evp/e_sm4.d.tmp -MT crypto/evp/e_sm4.o -c -o crypto/evp/e_sm4.o crypto/evp/e_sm4.c
gcc  -I. -Iinclude -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/babassl/ssl\"" -DENGINESDIR="\"/usr/local/babassl/lib/engines-1.1\"" -DNDEBUG  -MMD -MF crypto/evp/encode.d.tmp -MT crypto/evp/encode.o -c -o crypto/evp/encode.o crypto/evp/encode.c
In file included from crypto/evp/e_sm4.c:19:0:
include/crypto/sm4.h:53:48: error: missing binary operator before token "("
 #  if defined (__has_include) && (__has_include(<x86intrin.h>))
                                                ^
make[1]: *** [crypto/evp/e_sm4.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/root/source/Tongsuo-8.3.3'
make: *** [all] Error 2
InfoHunter commented 12 months ago

看下这个:https://github.com/Tongsuo-Project/Tongsuo/pull/519

InfoHunter commented 12 months ago

或者直接用8.3-stable分支的代码