OpenSSL编译在测试中失败

时间:2019-09-19 09:13:51

标签: c++ compiler-errors openssl fips

我已经编译了Openssl FIPS object module 2.0.16,并且我正在尝试使用openssl 1.0.2编译兼容的FIPS 2.0.16

以下是使用的选项

./config fips no-shared --with-fipsdir=/home/dinesh/openssl-fips-install
make depend
make

在测试目录中编译失败。

make[2]: Entering directory '/home/dinesh/openssl-1.0.2t/test'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto  -ldl}"; LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--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 -I/home/dinesh/openssl-fips-install/include -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=dtlstest} dtlstest.o ssltestlib.o ${LIBDEPS} )
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: ssltestlib.o: in function `main':
ssltestlib.c:(.text.startup+0x0): multiple definition of `main'; dtlstest.o:dtlstest.c:(.text.startup+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: dtlstest.o: in function `test_dtls_unprocessed':
dtlstest.c:(.text+0x6d): undefined reference to `create_ssl_ctx_pair'
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: dtlstest.c:(.text+0xaf): undefined reference to `bio_f_tls_dump_filter'
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: dtlstest.c:(.text+0xde): undefined reference to `create_ssl_objects'
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: dtlstest.c:(.text+0x124): undefined reference to `mempacket_test_inject'
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: dtlstest.c:(.text+0x133): undefined reference to `create_ssl_connection'
collect2: error: ld returned 1 exit status
make[2]: *** [../Makefile.shared:164: link_app.] Error 1
make[2]: Leaving directory '/home/dinesh/openssl-1.0.2t/test'
make[1]: *** [Makefile:583: dtlstest] Error 2
make[1]: Leaving directory '/home/dinesh/openssl-1.0.2t/test'
make: *** [Makefile:295: build_tests] Error 1

我已经阅读了一些建议以root身份登录并尝试make clean并运行make的论坛。我仍然遇到相同的错误。请提出建议。

1 个答案:

答案 0 :(得分:0)

最后我可以编译了。这就是我发现的。 尽管config告诉我们运行make depend,但是由于这是一个新的编译,因此不需要运行make depend。 通过以root用户身份登录,而只用make来运行make depend,就解决了这个问题。

相关问题