Closed jhgit closed 11 months ago
The following patch against the configure
script (as distributed with the 5.5 release) solves the problem:
@@ -0,0 +1,20 @@
+--- configure.orig 2023-02-13 15:09:39 UTC
++++ configure
+@@ -14030,7 +14030,7 @@ if ${ac_cv_lib_crypto_EVP_sm3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lcrypto $LIBS"
++LIBS="${CRYPTO_LIBS} $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -14073,7 +14073,7 @@ if ${ac_cv_lib_crypto_EVP_sm4_cfb128+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lcrypto $LIBS"
++LIBS="${CRYPTO_LIBS} $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
I don't have a simple patch against configure.ac
at the moment. AC_CHECK_LIB
doesn't seem to support adding flags.
I don't have a simple patch against
configure.ac
at the moment.AC_CHECK_LIB
doesn't seem to support adding flags.
This does the job...
--- configure.ac.orig 2022-11-28 17:44:51.000000000 +0000
+++ configure.ac 2023-10-04 01:17:28.642321000 +0000
@@ -74,12 +74,15 @@ PKG_CHECK_MODULES([TSS2_MU], [tss2-mu])
PKG_CHECK_MODULES([TSS2_RC], [tss2-rc])
PKG_CHECK_MODULES([TSS2_SYS], [tss2-sys])
PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.1.0])
+LIBS_save="${LIBS}"
+LIBS="${CRYPTO_LIBS} ${LIBS}"
AC_CHECK_LIB(crypto, [EVP_sm3], [
AC_DEFINE([HAVE_EVP_SM3], [1], [Support EVP_sm3 in openssl])],
[])
AC_CHECK_LIB(crypto, [EVP_sm4_cfb128], [
AC_DEFINE([HAVE_EVP_SM4_CFB], [1], [Support EVP_sm4_cfb in openssl])],
[])
+LIBS="${LIBS_save}"
PKG_CHECK_MODULES([CURL], [libcurl])
# pretty print of devicepath if efivar library is present
In case a system has more than one version of libcrypt installed in different locations, the
configure
script may detect the presence of EVP_sm3 and EVP_sm4_cfb128 ...But the build uses what CRYPTO_CFLAGS & CRYPTOLIBS are set to. If
configure
found the above EVP* functions, and the openssl library that CRYPTO_CFLAGS/CRYPT_LIBS points to does not have those functions, then you get a build error like so: