package: openscap: fix build failure when crypto backend is not gcrypt
PATCH 1/1 package: openscap: fix build failure when crypto backend is not gcrypt
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
--- package/openscap/openscap.mk | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
package/openscap/openscap.mk +4 -5
@@ -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,
Signature · 6 lines
Alexis Lothoré <[email protected]> _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot