Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package: openscap: fix build failure when crypto backend is not gcrypt
@ 2026-06-16 11:35 Alexis Lothoré via buildroot
  0 siblings, 0 replies; only message in thread
From: Alexis Lothoré via buildroot @ 2026-06-16 11:35 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni, Alexis Lothoré

When enabling the openscap package and the libnss library _but not_
libgcrypt, the build can fail on the following error:

  ../src/libopenscap.so.33.1.3: undefined reference to `crapi_init'

The issue is due to the fact that the corresponding Makefile
systematically forces -DWITH_CRYPTO=gcrypt: openscap CMake
instrumentation then searches only this backend, fails to find it,
assumes that no crypto backend is available, and so does not include the
crapi_object in the final link step.

Commit 7c85f3adf4a8 ("package/openscap: new package") took into account
the fact that openscap isn't actually able to build if no crypto backend
is provided (see [0]), and so made sure to force libgcrypt inclusion if
libnss is not included.

Replicate this fallback mechanism in the makefile to make sure that the
correct backend is selected.

[0] https://github.com/OpenSCAP/openscap/issues/2310

Fixes: https://autobuild.buildroot.org/results/31d26d9469c0d02c58b32085f37043e752b7dca4/
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 package/openscap/openscap.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/package/openscap/openscap.mk b/package/openscap/openscap.mk
index 7da38df345b4..16e3678271b5 100644
--- a/package/openscap/openscap.mk
+++ b/package/openscap/openscap.mk
@@ -36,7 +36,6 @@ OPENSCAP_CONF_OPTS = \
 	-DENABLE_OSCAP_UTIL_VM=OFF \
 	-DENABLE_PROBES_WINDOWS=OFF \
 	-DENABLE_TESTS=OFF \
-	-DWITH_CRYPTO=gcrypt \
 	-DENABLE_PYTHON3=OFF
 
 HOST_OPENSCAP_CONF_OPTS = \
@@ -58,12 +57,12 @@ ifeq ($(BR2_PACKAGE_LIBCAP),y)
 OPENSCAP_DEPENDENCIES += libcap
 endif
 
-ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
-OPENSCAP_DEPENDENCIES += libgcrypt
-endif
-
 ifeq ($(BR2_PACKAGE_LIBNSS),y)
 OPENSCAP_DEPENDENCIES += libnss
+OPENSCAP_CONF_OPTS += -DWITH_CRYPTO=nss
+else
+OPENSCAP_DEPENDENCIES += libgcrypt
+OPENSCAP_CONF_OPTS += -DWITH_CRYPTO=gcrypt
 endif
 
 ifneq ($(BR2_TOOLCHAIN_USES_GLIBC),y)

---
base-commit: cbe867b895d19861cd809c953f88c576f2073223
change-id: 20260616-fix_openscap-410e397f7257

Best regards,
--  
Alexis Lothoré <alexis.lothore@bootlin.com>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-16 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 11:35 [Buildroot] [PATCH] package: openscap: fix build failure when crypto backend is not gcrypt Alexis Lothoré via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox