package/openscap: add patch to enforce project as C project
PATCH v2 1/1 package/openscap: add patch to enforce project as C project
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'
The openscap project does not contain any C++ file, and so does not need a C++ capable compiler. Bring the to-be-integrated-upstream patch enforcing C language in CMakeLists.txt to prevent this build failure.
---
Changes in v2:
- fix upstream CMakeLists.txt rather than enabling C++ support in toolchain
- bring in the to-be-integrated-upstream corresponding patch
- Link to v1: https://lore.kernel.org/r/[email protected]
--- .../openscap/0001-set-project-as-c-project.patch | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+)
package/openscap/0001-set-project-as-c-project.patch new file +78 -0
@@ -0,0 +1,78 @@ +From a742647efd215b682e4cd26b15ac3e580c10ef9f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= <[email protected]> +Date: Mon, 16 Feb 2026 13:50:48 +0100 +Subject: [PATCH] Set project as C project in CMakeLists.txt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The openscap tool has been recently integrated in the buildroot build +system ([1]), which makes the openscap tool buildable for a wide variety +or architectures/OSes, with a wide variety of _compilers_. And so when +such compilers are not supporting C++ projects (as it is the case with a +default buildroot toolchain), the build breaks on the following error +(see [2] for an example): + + -- 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) + +openscap does not have any C++ code to build, so restricting builds to +toolchains supporting C++ is overconstraining, the configuration step +should rather not try to check C++ support. + +Enforce the project as a C project in CMakeLists.txt to make sure not to +test C++ features on the used toolchain. + +[1] https://buildroot.org/ +[2] https://autobuild.buildroot.org/results/1fe550ffa79f0a083a450ae03fe067a8ab7336be/build-end.log + +Upstream: https://github.com/OpenSCAP/openscap/pull/2312 +[patch slightly adapted to be applicable on v1.3.12] +Signed-off-by: Alexis Lothoré <[email protected]> +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cb13debb47cf..05b054327951 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,7 +8,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + "MinSizeRel" "RelWithDebInfo") + endif() + +-project("openscap") ++project("openscap" C) + set(OPENSCAP_VERSION_MAJOR "1") + set(OPENSCAP_VERSION_MINOR "3") + set(OPENSCAP_VERSION_PATCH "12") +-- +2.53.0 +
---
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
Quoted 36 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"
/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-fMakefilecmTC_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 objectCMakeFiles/cmTC_1834b.dir/testCXXCompiler.cxx.o/bin/false-oCMakeFiles/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'
Quoted 8 lines
The openscap project does not contain any C++ file, and so does not need a C++ capable compiler. Bring the to-be-integrated-upstream patch enforcing C language in CMakeLists.txt to prevent this build failure.
Signed-off-by Alexis Lothoré <[email protected]>
Thanks for this new iteration!
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
Quoted 46 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Alexis" == Alexis Lothoré via buildroot <[email protected]> writes:
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-fMakefilecmTC_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 objectCMakeFiles/cmTC_1834b.dir/testCXXCompiler.cxx.o/bin/false-oCMakeFiles/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'The openscap project does not contain any C++ file, and so does not need a C++ capable compiler. Bring the to-be-integrated-upstream patch enforcing C language in CMakeLists.txt to prevent this build failure.
Signed-off-by Alexis Lothoré <[email protected]>
Quoted 5 lines
---
Changes in v2:
- fix upstream CMakeLists.txt rather than enabling C++ support in toolchain
- bring in the to-be-integrated-upstream corresponding patch
- Link to v1: https://lore.kernel.org/r/[email protected]
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot