[PATCH] tsm-mr: fix sample dependencies

From: Arnd Bergmann

Date: Wed Mar 18 2026 - 06:53:12 EST


From: Arnd Bergmann <arnd@xxxxxxxx>

The tsm sample fails to link when crypto support is in a loadable module:

ld.lld-22: error: undefined symbol: crypto_alloc_shash
ld.lld-22: error: undefined symbol: crypto_shash_tfm_digest
ld.lld-22: error: undefined symbol: crypto_destroy_tfm
ld.lld-22: error: undefined symbol: crypto_shash_init
ld.lld-22: error: undefined symbol: crypto_shash_finup
>>> referenced by tsm_mr_sample.c
>>> samples/tsm-mr/tsm_mr_sample.o:(sample_report_extend_mr) in archive vmlinux.a

This used to be handled indirectly by CONFIG_TSM_MEASUREMENTS forcing
the crypto code to be built-in, but that was changed because TSM
itself does not require it.

Move the select into the Kconfig option that controls the sample
instead.

Fixes: f6953f1f9ec4 ("tsm-mr: Add tsm-mr sample code")
Fixes: 44a3873df811 ("coco/guest: Remove unneeded selection of CRYPTO")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
samples/Kconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/samples/Kconfig b/samples/Kconfig
index 5bc7c9e5a59e..730cc9f4197e 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -186,6 +186,8 @@ config SAMPLE_TIMER

config SAMPLE_TSM_MR
tristate "TSM measurement sample"
+ select CRYPTO
+ select CRYPTO_HASH
select TSM_MEASUREMENTS
select VIRT_DRIVERS
help
--
2.39.5