Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gmssl在windows10的winrar解压后,在linux下make报错。直接在linux下用unzip解压,可以成功编译 #23

Closed
abgceagle opened this issue Jun 28, 2016 · 10 comments

Comments

@abgceagle
Copy link

复现步骤:1、下载gmssl zip压缩包;2、把压缩包通过samba拷贝到redhat 6.5;3、采用winrar解压。
4、ssh进入linux,./config ,然后make,报错,错误如下:
gcc -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -c -o e_skf.o e_skf.c
In file included from e_skf.c:61:
../include/openssl/ssf33.h:1: error: expected identifier or ‘(’ before ‘.’ token
In file included from e_skf.c:65:
../include/openssl/sms4.h:71: warning: data definition has no type or storage class
../include/openssl/sms4.h:71: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:73: error: expected ‘)’ before ‘’ token
../include/openssl/sms4.h:74: error: expected ‘)’ before ‘
’ token
../include/openssl/sms4.h:75: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:75: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token
../include/openssl/sms4.h:79: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:79: error: expected ‘;’, ‘,’ or ‘)’ before ‘
’ token
../include/openssl/sms4.h:81: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:81: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token
../include/openssl/sms4.h:83: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:83: error: expected ‘;’, ‘,’ or ‘)’ before ‘
’ token
../include/openssl/sms4.h:85: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:85: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token
../include/openssl/sms4.h:87: warning: type defaults to ‘int’ in declaration of ‘sms4_key_t’
../include/openssl/sms4.h:87: error: expected ‘;’, ‘,’ or ‘)’ before ‘
’ token
../include/openssl/sms4.h:90: error: expected ‘)’ before ‘’ token
../include/openssl/sms4.h:92: error: expected ‘)’ before ‘
’ token
../include/openssl/sms4.h:100: error: expected specifier-qualifier-list before ‘sms4_key_t’
e_skf.c: In function ‘skf_init_key’:
e_skf.c:383: warning: implicit declaration of function ‘SKF_nid_to_encparam’
e_skf.c: In function ‘engine_skf’:
e_skf.c:747: warning: implicit declaration of function ‘bind_helper’
make[1]: *** [e_skf.o] Error 1
make[1]: Leaving directory `/usr/local/SINO/GmSSL-master-20160628/GmSSL-master/engines'
make: *** [build_engines] Error 1

解决办法:压缩包直接用 linux的 unzip命令解压,则编译通过。具体原因未知,怀疑跟解压后文件的格式或者操作系统的换行符或编码有关

@wendal
Copy link
Contributor

wendal commented Jan 5, 2017

换行符问题.

@chary931201
Copy link

@wendal @abgceagle 什么换行符!我unzip这样还是没法成功!还是 报错!

@wendal
Copy link
Contributor

wendal commented Apr 1, 2017

dos2unix 处理一下

@chary931201
Copy link

@wendal 不好使!还是 同样的问题。
Error: EVP_PKEY_get0_PAILLIER does not have a number assigned
LD_LIBRARY_PATH=: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="/usr/local/ssl" -DENGINESDIR="/usr/local/lib/engines-1.1" -Wall -O3 -pthread -m32 -DL_ENDIAN -fomit-frame-pointer -Wa,--noexecstack -fPIC -DOPENSSL_USE_NODELETE -Wl,-znodelete -m32 -shared -Wl,-Bsymbolic -Wl,-soname=libcrypto.so.1.1 -o ./libcrypto.so.1.1 -Wl,--whole-archive,--version-script=crypto.map ./libcrypto.a -Wl,--no-whole-archive -ldl
/usr/bin/ld:crypto.map:1620: syntax error in VERSION script
collect2: error: ld returned 1 exit status
make[2]: *** [link_shlib.linux-shared] Error 1
make[2]: Leaving directory /home/guard/experiment/TCP/PassWord/SM2/Gmssl/GmSSL-master/GmSSL-master' make[1]: *** [libcrypto.so] Error 2 make[1]: Leaving directory /home/guard/experiment/TCP/PassWord/SM2/Gmssl/GmSSL-master/GmSSL-master'
make: *** [all] Error 2
还是这样。

@wendal
Copy link
Contributor

wendal commented Apr 1, 2017

描述一下你从下载直至编译的步骤

@chary931201
Copy link

好的!
完全是按照官网步骤走的。

下载到windows桌面,使用 flashfxp 传到ubuntu服务器上

下载源代码(zip),解压缩至当前工作目录

$ unzip GmSSL-master.zip
编译与安装

Linux平台 (其他平台的安装过程见编译与安装)

$ ./config no-saf no-sdf no-skf no-sof no-zuc
$ make
$ sudo make install
安装之后可以执行gmssl命令行工具检查是否成功

$ gmssl version
GmSSL 2.0 - OpenSSL 1.1.0d****

make 之后就是 我上面发出来的错误

@chary931201
Copy link

我之前自己装了openssl 这个 有影响? 我的openssl 版本: OpenSSL 1.1.0e

@wendal
Copy link
Contributor

wendal commented Apr 1, 2017

有可能哦

@chary931201
Copy link

@guanzhi 老师。我之前自己装了openssl 这个 有影响? 我的openssl 版本: OpenSSL 1.1.0e 。现在 出现 我贴图的错误。这里 一直 有点问题,

@github-actions
Copy link

Marked as stale issue. Will be closed later if no activity for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants