【MTK Uboot】recipe for target ‘tools/dumpimage‘ failed 报错解决

编译MTK mt7981芯片的Uboot时,遇到的报错 (在Uboot-upstream文件夹编译时)

报错内容

  WRAP    tools/lib/aes/aes-decrypt.c
  HOSTCC  tools/lib/aes/aes-decrypt.o
  HOSTCC  tools/dumpimage.o
  HOSTLD  tools/dumpimage
tools/sunxi_toc0.o: In function `toc0_verify_header':
sunxi_toc0.c:(.text+0x52c): undefined reference to `RSA_set0_key'
sunxi_toc0.c:(.text+0x543): undefined reference to `RSA_get0_n'
sunxi_toc0.c:(.text+0x560): undefined reference to `RSA_get0_e'
sunxi_toc0.c:(.text+0x626): undefined reference to `RSA_set0_key'
sunxi_toc0.c:(.text+0x72c): undefined reference to `RSA_set0_key'
sunxi_toc0.c:(.text+0x743): undefined reference to `RSA_get0_n'
sunxi_toc0.c:(.text+0x750): undefined reference to `RSA_get0_n'
sunxi_toc0.c:(.text+0x76d): undefined reference to `RSA_get0_e'
sunxi_toc0.c:(.text+0x77a): undefined reference to `RSA_get0_e'
tools/sunxi_toc0.o: In function `toc0_set_header':
sunxi_toc0.c:(.text+0xb53): undefined reference to `RSA_get0_d'
sunxi_toc0.c:(.text+0xe06): undefined reference to `RSA_get0_d'
sunxi_toc0.c:(.text+0xea2): undefined reference to `RSA_get0_n'
sunxi_toc0.c:(.text+0xecc): undefined reference to `RSA_get0_e'
sunxi_toc0.c:(.text+0xf0e): undefined reference to `RSA_get0_n'
sunxi_toc0.c:(.text+0xf38): undefined reference to `RSA_get0_e'
sunxi_toc0.c:(.text+0x104d): undefined reference to `RSA_get0_n'
sunxi_toc0.c:(.text+0x1062): undefined reference to `BN_bn2binpad'
sunxi_toc0.c:(.text+0x1074): undefined reference to `RSA_get0_e'
sunxi_toc0.c:(.text+0x1089): undefined reference to `BN_bn2binpad'
tools/lib/ecdsa/ecdsa-libcrypto.o: In function `prepare_ctx':
ecdsa-libcrypto.c:(.text+0xa7): undefined reference to `OPENSSL_init_ssl'
ecdsa-libcrypto.c:(.text+0x161): undefined reference to `EC_GROUP_order_bits'
tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_check_signature.isra.3':
ecdsa-libcrypto.c:(.text+0x3bd): undefined reference to `ECDSA_SIG_set0'
tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_sign':
ecdsa-libcrypto.c:(.text+0x4b3): undefined reference to `ECDSA_SIG_get0'
ecdsa-libcrypto.c:(.text+0x4d0): undefined reference to `BN_bn2binpad'
ecdsa-libcrypto.c:(.text+0x4e2): undefined reference to `BN_bn2binpad'
tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_add_verify_data':
ecdsa-libcrypto.c:(.text+0x6c5): undefined reference to `EC_GROUP_order_bits'
ecdsa-libcrypto.c:(.text+0x70d): undefined reference to `EC_POINT_get_affine_coordinates'
tools/lib/rsa/rsa-sign.o: In function `rsa_sign':
rsa-sign.c:(.text+0x544): undefined reference to `OPENSSL_init_ssl'
tools/lib/rsa/rsa-sign.o: In function `rsa_get_params':
rsa-sign.c:(.text+0x973): undefined reference to `RSA_get0_key'
rsa-sign.c:(.text+0x9be): undefined reference to `RSA_get0_key'
tools/lib/rsa/rsa-sign.o: In function `rsa_add_verify_data':
rsa-sign.c:(.text+0xdc2): undefined reference to `EVP_PKEY_get0_RSA'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:104: recipe for target 'tools/dumpimage' failed
make[1]: *** [tools/dumpimage] Error 1
Makefile:1884: recipe for target 'tools' failed
make: *** [tools] Error 2

或者以下报错

  HOSTCC  tools/lib/crc8.o
  HOSTLD  tools/gen_ethaddr_crc
  HOSTCC  tools/img2srec
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/os_support.o
  HOSTLD  tools/mkenvimage
  HOSTCC  tools/aisimage.o
In file included from tools/imagetool.h:24,
                 from tools/aisimage.c:7:
include/image.h:1293:12: fatal error: openssl/evp.h: No such file or directory
 1293 | #  include 
      |            ^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:112: tools/aisimage.o] Error 1
make: *** [Makefile:1884: tools] Error 2

解决办法

安装libssl-dev即可

sudo apt-get install libssl-dev

你可能感兴趣的:(c语言,嵌入式硬件,物联网,arm开发)