[PATCH 1/1] build: fix no-crypto configuration link failure

8 views
Skip to first unread message

James Hilliard

unread,
Mar 24, 2026, 4:24:17 PM (8 days ago) Mar 24
to swup...@googlegroups.com, Giulio Benetti, James Hilliard
When no crypto backend is selected, the crypto directory contributes
no objects, so this kbuild variant does not generate
crypto/built-in.o.

The top-level build still linked that file unconditionally, causing
the final link to fail.

Introduce a hidden SWUPDATE_CRYPTO helper selected by the Kconfig
options that actually populate crypto/, and only descend into the
crypto directory when that helper is enabled.

Signed-off-by: James Hilliard <james.h...@gmail.com>
---
Makefile | 3 ++-
crypto/Kconfig | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index aa9604aa..759fd191 100644
--- a/Makefile
+++ b/Makefile
@@ -369,7 +369,8 @@ include $(srctree)/Makefile.flags
# This allow a user to issue only 'make' to build a kernel including modules
# Defaults to vmlinux, but the arch makefile usually adds further targets

-objs-y := core handlers crypto bootloader suricatta
+objs-y := core handlers bootloader suricatta
+objs-$(CONFIG_SWUPDATE_CRYPTO) += crypto
libs-y := corelib mongoose parser fs containers
bindings-y := bindings
tools-y := tools
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 1e2b4fe5..ee512456 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -27,9 +27,13 @@ menu "Crypto libraries"
depends on HAVE_P11KIT
endmenu

+config SWUPDATE_CRYPTO
+ bool
+
config HASH_VERIFY
bool "Allow to add sha256 hash to each image"
depends on SSL_IMPL_OPENSSL || SSL_IMPL_WOLFSSL || SSL_IMPL_MBEDTLS
+ select SWUPDATE_CRYPTO
help
Allow to add a sha256 hash to an artifact.
This is automatically set in case of Signed Image
@@ -91,6 +95,7 @@ menu "Encryption"
config ENCRYPTED_IMAGES
bool "Images can be encrypted with a symmetric key"
depends on SSL_IMPL_OPENSSL || SSL_IMPL_WOLFSSL || SSL_IMPL_MBEDTLS || PKCS11
+ select SWUPDATE_CRYPTO
comment "Image encryption needs an SSL implementation"
depends on !SSL_IMPL_OPENSSL && !SSL_IMPL_WOLFSSL && !SSL_IMPL_MBEDTLS && !PKCS11

--
2.43.0

Stefano Babic

unread,
Mar 26, 2026, 2:22:31 PM (6 days ago) Mar 26
to James Hilliard, swup...@googlegroups.com, Giulio Benetti
Hi James,
Applied to -master, thanks !

Best regards,
Stefano Babic

Reply all
Reply to author
Forward
0 new messages