Skip to contentSkip to conversation

package/openscap: set dependency on C++ support

PATCH Superseded Alexis Lothoré via buildroot 1 participant 4 messages Feb 16

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/openscap: set dependency on C++ support

When the toolchain involved in openscap build does not support C++, the configure step fails with the following error:

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /bin/false
-- Check for working CXX compiler: /bin/false - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler

"/bin/false"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: '/home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/buildroot-build/CMakeFiles/CMakeScratch/TryCompile-tUydqI'

Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_1834b/fast
make[1]: Entering directory '/home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/buildroot-build/CMakeFiles/CMakeScratch/TryCompile-tUydqI' /usr/bin/make -f CMakeFiles/cmTC_1834b.dir/build.make CMakeFiles/cmTC_1834b.dir/build
make[2]: Entering directory '/home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/buildroot-build/CMakeFiles/CMakeScratch/TryCompile-tUydqI' Building CXX object CMakeFiles/cmTC_1834b.dir/testCXXCompiler.cxx.o
/bin/false -o CMakeFiles/cmTC_1834b.dir/testCXXCompiler.cxx.o -c /home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/buildroot-build/CMakeFiles/CMakeScratch/TryCompile-tUydqI/testCXXCompiler.cxx
make[2]: *** [CMakeFiles/cmTC_1834b.dir/build.make:81: CMakeFiles/cmTC_1834b.dir/testCXXCompiler.cxx.o] Error 1
make[2]: Leaving directory '/home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/buildroot-build/CMakeFiles/CMakeScratch/TryCompile-tUydqI' make[1]: *** [Makefile:134: cmTC_1834b/fast] Error 2
make[1]: Leaving directory '/home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/buildroot-build/CMakeFiles/CMakeScratch/TryCompile-tUydqI'

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:11 (project)

-- Configuring incomplete, errors occurred!
make: *** [package/pkg-generic.mk:263: /home/autobuild/autobuild/instance-6/output-1/build/openscap-1.3.12/.stamp_configured] Error 1
make: Leaving directory '/home/autobuild/autobuild/instance-6/buildroot'

Make openscap depend on proper C++ support.

---
 package/openscap/Config.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/openscap/Config.in +3 -2
index 317055c75327..375fcacc2d05 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_OPENSCAP
 	bool "openscap"
 	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS  # libgcrypt
 	depends on !BR2_STATIC_LIBS # dlfcn.h
+	depends on BR2_INSTALL_LIBSTDCPP
 	select BR2_PACKAGE_LIBCURL
 	# In theory should build without crypto, but in practice it
 	# doesn't: https://github.com/OpenSCAP/openscap/issues/2310
@@ -19,6 +20,6 @@ config BR2_PACKAGE_OPENSCAP
 	  https://www.open-scap.org/
 	  https://github.com/OpenSCAP/openscap
 
-comment "openscap needs a toolchain w/ dynamic library"
+comment "openscap needs a toolchain w/ C++, dynamic library"
 	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS
-	depends on BR2_STATIC_LIBS
+	depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP

---
base-commit: 78d38d9ddda81d7c6bff9b520656fe4f46f0f692
change-id: 20260216-openscap_cpp-5e4035d7dbf8

Best regards,

Signature · 6 lines
Alexis Lothoré <[email protected]>

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Alexis,

Thanks for the fix!

Quoted 9 lines · Alexis Lothoré

When the toolchain involved in openscap build does not support C++, the configure step fails with the following error:

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /bin/false
-- Check for working CXX compiler: /bin/false - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler

From a quick look, it doesn't seem like openscap contains C++ code. So instead the right fix is most likely to change CMakeLists.txt to check for the C compiler only.

To do that, in CMakeLists.txt, change:

project(blabla)

to

project(blabla C)

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 19 lines · Thomas Petazzoni

Hello Alexis,

Thanks for the fix!

Quoted 9 lines · Alexis Lothoré

When the toolchain involved in openscap build does not support C++, the configure step fails with the following error:

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /bin/false
-- Check for working CXX compiler: /bin/false - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler

From a quick look, it doesn't seem like openscap contains C++ code. So instead the right fix is most likely to change CMakeLists.txt to check for the C compiler only.

Quoted 7 lines

To do that, in CMakeLists.txt, change:

project(blabla)

to

project(blabla C)

Good point, thanks. I'll send this fix to the upstream project. As the package is now integrated in master (and so triggering failures every day in the autobuilder), I guess it is ok to follow-up with a v2 bringing the corresponding patch submitted on the upstream project, even if not merged yet ?

Alexis

Signature · 8 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
Quoted 5 lines · Alexis Lothoré

Good point, thanks. I'll send this fix to the upstream project. As the package is now integrated in master (and so triggering failures every day in the autobuilder), I guess it is ok to follow-up with a v2 bringing the corresponding patch submitted on the upstream project, even if not merged yet ?

It is absolutely OK, and is exactly what we would expect :-)

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot