diff mbox series

[1/3] tools/Makefile: FIT_CIPHER requires libssl

Message ID 20201111111833.741937-2-joel@jms.id.au
State Superseded
Headers show
Series mkimage usability fixes | expand

Commit Message

Joel Stanley Nov. 11, 2020, 11:18 a.m. UTC
If CONFIG_FIT_CIPHER=y and CONFIG_FIT_SIGNATURE=n then mkimage and
dumpimage will fail to link:

 /usr/bin/ld: tools/common/image-cipher.o: in function `fit_image_decrypt_data':
 image-cipher.c:(.text+0x9a): undefined reference to `image_get_host_blob'
 /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x10): undefined reference to `EVP_aes_128_cbc'
 /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x40): undefined reference to `EVP_aes_192_cbc'
 /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x70): undefined reference to `EVP_aes_256_cbc'
 /usr/bin/ld: tools/lib/aes/aes-encrypt.o: in function `image_aes_encrypt':
 aes-encrypt.c:(.text+0x22): undefined reference to `EVP_CIPHER_CTX_new'
 /usr/bin/ld: aes-encrypt.c:(.text+0x6f): undefined reference to `EVP_EncryptInit_ex'
 /usr/bin/ld: aes-encrypt.c:(.text+0x8d): undefined reference to `EVP_EncryptUpdate'
 /usr/bin/ld: aes-encrypt.c:(.text+0xac): undefined reference to `EVP_CIPHER_CTX_free'
 /usr/bin/ld: aes-encrypt.c:(.text+0xf2): undefined reference to `EVP_EncryptFinal_ex'
 collect2: error: ld returned 1 exit status

Signed-off-by: Joel Stanley <joel@jms.id.au>

---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.28.0

Comments

Philippe REYNES Dec. 7, 2020, 4:56 p.m. UTC | #1
Hi Joel,
Sorry, for this very late answer.


Le 11/11/2020 à 12:18, Joel Stanley a écrit :
> If CONFIG_FIT_CIPHER=y and CONFIG_FIT_SIGNATURE=n then mkimage and

> dumpimage will fail to link:

>

>   /usr/bin/ld: tools/common/image-cipher.o: in function `fit_image_decrypt_data':

>   image-cipher.c:(.text+0x9a): undefined reference to `image_get_host_blob'

>   /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x10): undefined reference to `EVP_aes_128_cbc'

>   /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x40): undefined reference to `EVP_aes_192_cbc'

>   /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x70): undefined reference to `EVP_aes_256_cbc'

>   /usr/bin/ld: tools/lib/aes/aes-encrypt.o: in function `image_aes_encrypt':

>   aes-encrypt.c:(.text+0x22): undefined reference to `EVP_CIPHER_CTX_new'

>   /usr/bin/ld: aes-encrypt.c:(.text+0x6f): undefined reference to `EVP_EncryptInit_ex'

>   /usr/bin/ld: aes-encrypt.c:(.text+0x8d): undefined reference to `EVP_EncryptUpdate'

>   /usr/bin/ld: aes-encrypt.c:(.text+0xac): undefined reference to `EVP_CIPHER_CTX_free'

>   /usr/bin/ld: aes-encrypt.c:(.text+0xf2): undefined reference to `EVP_EncryptFinal_ex'

>   collect2: error: ld returned 1 exit status

>

> Signed-off-by: Joel Stanley <joel@jms.id.au>

Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>

> ---

>   tools/Makefile | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/tools/Makefile b/tools/Makefile

> index 51123fd92983..103b3ab8a7f2 100644

> --- a/tools/Makefile

> +++ b/tools/Makefile

> @@ -154,7 +154,7 @@ HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_SECURE

>   endif

>   

>   # MXSImage needs LibSSL

> -ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),)

> +ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE)$(CONFIG_FIT_CIPHER),)

>   HOSTCFLAGS_kwbimage.o += \

>   	$(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")

>   HOSTLDLIBS_mkimage += \


Regards,
Philippe
diff mbox series

Patch

diff --git a/tools/Makefile b/tools/Makefile
index 51123fd92983..103b3ab8a7f2 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -154,7 +154,7 @@  HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_SECURE
 endif
 
 # MXSImage needs LibSSL
-ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),)
+ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE)$(CONFIG_FIT_CIPHER),)
 HOSTCFLAGS_kwbimage.o += \
 	$(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
 HOSTLDLIBS_mkimage += \