diff mbox series

[1/1] package/rauc: select BR2_PACKAGE_LIBOPENSSL_ENGINES

Message ID 20240626145942.3154406-1-fiona.klute@gmx.de
State New
Headers show
Series [1/1] package/rauc: select BR2_PACKAGE_LIBOPENSSL_ENGINES | expand

Commit Message

Fiona Klute June 26, 2024, 2:59 p.m. UTC
This fixes link time errors, undefined references to various ENGINE_*
functions (paths shortened to the output directory):

host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: librauc.a.p/src_signature.c.o: in function `get_pkcs11_engine.constprop.0':
signature.c:(.text.get_pkcs11_engine.constprop.0+0x14): undefined reference to `ENGINE_load_builtin_engines'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: signature.c:(.text.get_pkcs11_engine.constprop.0+0x20): undefined reference to `ENGINE_by_id'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: signature.c:(.text.get_pkcs11_engine.constprop.0+0x54): undefined reference to `ENGINE_ctrl_cmd_string'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: signature.c:(.text.get_pkcs11_engine.constprop.0+0x60): undefined reference to `ENGINE_init'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: signature.c:(.text.get_pkcs11_engine.constprop.0+0xe0): undefined reference to `ENGINE_ctrl_cmd_string'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: signature.c:(.text.get_pkcs11_engine.constprop.0+0x128): undefined reference to `ENGINE_free'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: signature.c:(.text.get_pkcs11_engine.constprop.0+0x1a4): undefined reference to `ENGINE_finish'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: librauc.a.p/src_signature.c.o: in function `load_cert':
signature.c:(.text.load_cert+0x114): undefined reference to `ENGINE_ctrl_cmd'
host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: librauc.a.p/src_signature.c.o: in function `load_key':
signature.c:(.text.load_key+0x124): undefined reference to `ENGINE_load_private_key'

Before linking there were matching implicit declaration warnings
during compile.

Signed-off-by: Fiona Klute <fiona.klute+wiwa@gmx.de>
---
I assume this is a consequence of
623d3bbe43e9193aa8e3395367d01af59071b859, previously RAUC built fine
without the option enabled.

 package/rauc/Config.in | 1 +
 1 file changed, 1 insertion(+)

--
2.45.2

Comments

Dario Binacchi June 26, 2024, 3:29 p.m. UTC | #1
*Dario Binacchi*

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com
Fiona Klute June 26, 2024, 3:42 p.m. UTC | #2
Am 26.06.24 um 17:29 schrieb Dario Binacchi:
> *Dario Binacchi*
>
> Senior Embedded Linux Developer
>
> dario.binacchi@amarulasolutions.com
>
> __________________________________
>
>
> *Amarula Solutions SRL*
>
> Via Le Canevare 30, 31100 Treviso, Veneto, IT
>
> T. +39 042 243 5310
> info@amarulasolutions.com
>
> www.amarulasolutions.com
>
> Hi Fiona,
>
> Il giorno mer 26 giu 2024 alle 16:59 Fiona Klute <fiona.klute@gmx.de> ha
> scritto:
>
>> This fixes link time errors, undefined references to various ENGINE_*
>> functions (paths shortened to the output directory):
>>
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> librauc.a.p/src_signature.c.o: in function `get_pkcs11_engine.constprop.0':
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0x14): undefined
>> reference to `ENGINE_load_builtin_engines'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0x20): undefined reference
>> to `ENGINE_by_id'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0x54): undefined reference
>> to `ENGINE_ctrl_cmd_string'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0x60): undefined reference
>> to `ENGINE_init'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0xe0): undefined reference
>> to `ENGINE_ctrl_cmd_string'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0x128): undefined
>> reference to `ENGINE_free'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> signature.c:(.text.get_pkcs11_engine.constprop.0+0x1a4): undefined
>> reference to `ENGINE_finish'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> librauc.a.p/src_signature.c.o: in function `load_cert':
>> signature.c:(.text.load_cert+0x114): undefined reference to
>> `ENGINE_ctrl_cmd'
>> host/lib/gcc/aarch64-buildroot-linux-musl/13.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld:
>> librauc.a.p/src_signature.c.o: in function `load_key':
>> signature.c:(.text.load_key+0x124): undefined reference to
>> `ENGINE_load_private_key'
>
>
>>
>> Before linking there were matching implicit declaration warnings
>> during compile.
>>
>> Signed-off-by: Fiona Klute <fiona.klute+wiwa@gmx.de>
>> ---
>> I assume this is a consequence of
>> 623d3bbe43e9193aa8e3395367d01af59071b859, previously RAUC built fine
>> without the option enabled.
>>
>
> I think you are right. This patch raised the error because it was not
> backward compatible. So my suggestion is to fix the problem patching
> package/libopensslConfig.in to enable by default the _ENGINES option.

I'm happy to add a patch to change the default, but I believe the RAUC
package needs the dependency either way: A user could override the
changed default for BR2_PACKAGE_LIBOPENSSL_ENGINES, and then the RAUC
build would break again. The explicit dependency prevents that and makes
clear that if you want RAUC you need the OpenSSL engines.

Best regards,
Fiona

>>   package/rauc/Config.in | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/package/rauc/Config.in b/package/rauc/Config.in
>> index 7451b29a55..69a65d165b 100644
>> --- a/package/rauc/Config.in
>> +++ b/package/rauc/Config.in
>> @@ -5,6 +5,7 @@ config BR2_PACKAGE_RAUC
>>          depends on BR2_USE_WCHAR # glib2
>>          select BR2_PACKAGE_LIBGLIB2
>>          select BR2_PACKAGE_OPENSSL
>> +       select BR2_PACKAGE_LIBOPENSSL_ENGINES
>>          select BR2_PACKAGE_SQUASHFS # run-time dependency
>>          select BR2_PACKAGE_UBOOT_TOOLS if BR2_TARGET_UBOOT # run-time
>> dependency
>>          select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV if BR2_TARGET_UBOOT
>> --
>> 2.45.2
>>
>>
>
diff mbox series

Patch

diff --git a/package/rauc/Config.in b/package/rauc/Config.in
index 7451b29a55..69a65d165b 100644
--- a/package/rauc/Config.in
+++ b/package/rauc/Config.in
@@ -5,6 +5,7 @@  config BR2_PACKAGE_RAUC
 	depends on BR2_USE_WCHAR # glib2
 	select BR2_PACKAGE_LIBGLIB2
 	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_LIBOPENSSL_ENGINES
 	select BR2_PACKAGE_SQUASHFS # run-time dependency
 	select BR2_PACKAGE_UBOOT_TOOLS if BR2_TARGET_UBOOT # run-time dependency
 	select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV if BR2_TARGET_UBOOT