Build failed when CONFIG_TOOLS_LIBCRYPTO is disabled on latest u-boot

Hi Experts,
We need to disable CONFIG_TOOLS_LIBCRYPTO in our u-boot.
But when I disable CONFIG_TOOLS_LIBCRYPTO from menuconfig, my u-boot build fails.
Logs: /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/image-host.o: in function `read_pub_key': image-host.c:(.text+0x8f): undefined reference to `PEM_read_X509' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: image-host.c:(.text+0x9e): undefined reference to `X509_get_pubkey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: image-host.c:(.text+0xae): undefined reference to `i2d_PublicKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: image-host.c:(.text+0xc1): undefined reference to `X509_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `openssl_err': kwbimage.c:(.text+0xbb): undefined reference to `ERR_get_error' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0xd7): undefined reference to `ERR_error_string' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_load_rsa_key': kwbimage.c:(.text+0x19d): undefined reference to `PEM_read_RSAPrivateKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_compute_pubkey_hash': kwbimage.c:(.text+0x278): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x28c): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x291): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x29c): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2b6): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2ca): undefined reference to `EVP_DigestFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2d9): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2e1): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_export_pubkey': kwbimage.c:(.text+0x3b2): undefined reference to `RSA_get0_key' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x3c3): undefined reference to `RSA_get0_key' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x3f5): undefined reference to `BN_num_bits' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x408): undefined reference to `BN_num_bits' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x47e): undefined reference to `BN_bn2bin' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x49f): undefined reference to `BN_bn2bin' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_verify': kwbimage.c:(.text+0x66f): undefined reference to `EVP_PKEY_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x686): undefined reference to `EVP_PKEY_set1_RSA' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x696): undefined reference to `EVP_PKEY_size' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6a6): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6ba): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6bf): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6ca): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6e2): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6fd): undefined reference to `EVP_VerifyFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x71d): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x73b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x807): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x80f): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x817): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_sign_and_verify': kwbimage.c:(.text+0x84e): undefined reference to `EVP_PKEY_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x865): undefined reference to `EVP_PKEY_set1_RSA' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x875): undefined reference to `EVP_PKEY_size' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x885): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x89a): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x89f): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x8ae): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x8cc): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x8ef): undefined reference to `EVP_SignFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x907): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x913): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x91b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x93b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x9ed): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwbimage_set_header': kwbimage.c:(.text+0x26aa): undefined reference to `d2i_RSAPublicKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `EVP_MD_CTX_cleanup': kwbimage.c:(.text+0x4aa5): undefined reference to `EVP_MD_CTX_reset' collect2: error: ld returned 1 exit status make[1]: *** [scripts/Makefile.host:104: tools/dumpimage] Error 1 make[1]: *** Waiting for unfinished jobs....
Do you know whether there is a patch to fix the issue?
Thanks!
Regards Terry

Hi Experts,
Any feedback on this?
Thanks!
Regards Terry ________________________________ 发件人: Terry Lv 发送时间: 2023年10月18日 12:03 收件人: u-boot@lists.denx.de u-boot@lists.denx.de 主题: Build failed when CONFIG_TOOLS_LIBCRYPTO is disabled on latest u-boot
Hi Experts,
We need to disable CONFIG_TOOLS_LIBCRYPTO in our u-boot.
But when I disable CONFIG_TOOLS_LIBCRYPTO from menuconfig, my u-boot build fails.
Logs: /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/image-host.o: in function `read_pub_key': image-host.c:(.text+0x8f): undefined reference to `PEM_read_X509' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: image-host.c:(.text+0x9e): undefined reference to `X509_get_pubkey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: image-host.c:(.text+0xae): undefined reference to `i2d_PublicKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: image-host.c:(.text+0xc1): undefined reference to `X509_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `openssl_err': kwbimage.c:(.text+0xbb): undefined reference to `ERR_get_error' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0xd7): undefined reference to `ERR_error_string' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_load_rsa_key': kwbimage.c:(.text+0x19d): undefined reference to `PEM_read_RSAPrivateKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_compute_pubkey_hash': kwbimage.c:(.text+0x278): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x28c): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x291): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x29c): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2b6): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2ca): undefined reference to `EVP_DigestFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2d9): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x2e1): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_export_pubkey': kwbimage.c:(.text+0x3b2): undefined reference to `RSA_get0_key' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x3c3): undefined reference to `RSA_get0_key' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x3f5): undefined reference to `BN_num_bits' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x408): undefined reference to `BN_num_bits' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x47e): undefined reference to `BN_bn2bin' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x49f): undefined reference to `BN_bn2bin' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_verify': kwbimage.c:(.text+0x66f): undefined reference to `EVP_PKEY_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x686): undefined reference to `EVP_PKEY_set1_RSA' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x696): undefined reference to `EVP_PKEY_size' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6a6): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6ba): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6bf): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6ca): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6e2): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x6fd): undefined reference to `EVP_VerifyFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x71d): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x73b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x807): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x80f): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x817): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwb_sign_and_verify': kwbimage.c:(.text+0x84e): undefined reference to `EVP_PKEY_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x865): undefined reference to `EVP_PKEY_set1_RSA' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x875): undefined reference to `EVP_PKEY_size' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x885): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x89a): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x89f): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x8ae): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x8cc): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x8ef): undefined reference to `EVP_SignFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x907): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x913): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x91b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x93b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: kwbimage.c:(.text+0x9ed): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `kwbimage_set_header': kwbimage.c:(.text+0x26aa): undefined reference to `d2i_RSAPublicKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/ld: tools/kwbimage.o: in function `EVP_MD_CTX_cleanup': kwbimage.c:(.text+0x4aa5): undefined reference to `EVP_MD_CTX_reset' collect2: error: ld returned 1 exit status make[1]: *** [scripts/Makefile.host:104: tools/dumpimage] Error 1 make[1]: *** Waiting for unfinished jobs....
Do you know whether there is a patch to fix the issue?
Thanks!
Regards Terry

Hello,
Am Montag, 27. November 2023, 03:53:49 CET schrieb Terry Lv:
Hi Experts,
Any feedback on this?
Bitten by the same problem again, I did a quick search on lore and found these:
1. Patch from 2021:
https://lore.kernel.org/u-boot/20211021093304.25399-1-pali@kernel.org/
I carried that patch up to 2022.04, but it does not solve the whole problem in recent U-Boot anymore.
2. Another patch tackling the same issue from early 2022:
https://lore.kernel.org/u-boot/20220111153120.1276641-1-marex@denx.de/
3. Discussion from mid 2022:
https://lore.kernel.org/u-boot/1884029.XjOfZupGQm@ada/
4. Patch series from earlier this year:
https://lore.kernel.org/u-boot/20230121154743.667253-1-paulerwan.rio@gmail.c...
As far as I can tell none of the proposed patches got applied. I'm going to test those now which I was not aware of yet.
Greets Alex
Thanks!
Regards Terry ________________________________ 发件人: Terry Lv 发送时间: 2023年10月18日 12:03 收件人: u-boot@lists.denx.de u-boot@lists.denx.de 主题: Build failed when CONFIG_TOOLS_LIBCRYPTO is disabled on latest u-boot
Hi Experts,
We need to disable CONFIG_TOOLS_LIBCRYPTO in our u-boot.
But when I disable CONFIG_TOOLS_LIBCRYPTO from menuconfig, my u-boot build fails.
Logs: /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-lin ux/usr/bin/ld: tools/image-host.o: in function `read_pub_key': image-host.c:(.text+0x8f): undefined reference to `PEM_read_X509' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: image-host.c:(.text+0x9e): undefined reference to `X509_get_pubkey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: image-host.c:(.text+0xae): undefined reference to `i2d_PublicKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: image-host.c:(.text+0xc1): undefined reference to `X509_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `openssl_err': kwbimage.c:(.text+0xbb): undefined reference to `ERR_get_error' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-lin ux/usr/bin/ld: kwbimage.c:(.text+0xd7): undefined reference to `ERR_error_string' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `kwb_load_rsa_key': kwbimage.c:(.text+0x19d): undefined reference to `PEM_read_RSAPrivateKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `kwb_compute_pubkey_hash': kwbimage.c:(.text+0x278): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x28c): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x291): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x29c): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x2b6): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x2ca): undefined reference to `EVP_DigestFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x2d9): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x2e1): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `kwb_export_pubkey': kwbimage.c:(.text+0x3b2): undefined reference to `RSA_get0_key' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-lin ux/usr/bin/ld: kwbimage.c:(.text+0x3c3): undefined reference to `RSA_get0_key' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x3f5): undefined reference to `BN_num_bits' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x408): undefined reference to `BN_num_bits' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x47e): undefined reference to `BN_bn2bin' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x49f): undefined reference to `BN_bn2bin' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `kwb_verify': kwbimage.c:(.text+0x66f): undefined reference to `EVP_PKEY_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-lin ux/usr/bin/ld: kwbimage.c:(.text+0x686): undefined reference to `EVP_PKEY_set1_RSA' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x696): undefined reference to `EVP_PKEY_size' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x6a6): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x6ba): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x6bf): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x6ca): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x6e2): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x6fd): undefined reference to `EVP_VerifyFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x71d): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x73b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x807): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x80f): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x817): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `kwb_sign_and_verify': kwbimage.c:(.text+0x84e): undefined reference to `EVP_PKEY_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-lin ux/usr/bin/ld: kwbimage.c:(.text+0x865): undefined reference to `EVP_PKEY_set1_RSA' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x875): undefined reference to `EVP_PKEY_size' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x885): undefined reference to `EVP_MD_CTX_new' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x89a): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x89f): undefined reference to `EVP_sha256' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x8ae): undefined reference to `EVP_DigestInit' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x8cc): undefined reference to `EVP_DigestUpdate' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x8ef): undefined reference to `EVP_SignFinal' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x907): undefined reference to `EVP_MD_CTX_reset' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x913): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x91b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x93b): undefined reference to `EVP_PKEY_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: kwbimage.c:(.text+0x9ed): undefined reference to `EVP_MD_CTX_free' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `kwbimage_set_header': kwbimage.c:(.text+0x26aa): undefined reference to `d2i_RSAPublicKey' /opt/samba/nxa08304/gcc_cross_toolchain/5.4-zeus/sysroots/x86_64-pokysdk-li nux/usr/bin/ld: tools/kwbimage.o: in function `EVP_MD_CTX_cleanup': kwbimage.c:(.text+0x4aa5): undefined reference to `EVP_MD_CTX_reset' collect2: error: ld returned 1 exit status make[1]: *** [scripts/Makefile.host:104: tools/dumpimage] Error 1 make[1]: *** Waiting for unfinished jobs....
Do you know whether there is a patch to fix the issue?
Thanks!
Regards Terry
participants (2)
-
Alexander Dahl
-
Terry Lv