Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexis Lothoré via buildroot" <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alexis Lothoré" <alexis.lothore@bootlin.com>
Subject: [Buildroot] [PATCH] package: openscap: fix build failure when crypto backend is not gcrypt
Date: Tue, 16 Jun 2026 13:35:20 +0200	[thread overview]
Message-ID: <20260616-fix_openscap-v1-1-e02d43887309@bootlin.com> (raw)

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

                 reply	other threads:[~2026-06-16 11:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260616-fix_openscap-v1-1-e02d43887309@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=alexis.lothore@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox