From e43f9ef8c977fdc8c3295b57503da2886ae25f8f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 9 Sep 2026 22:33:24 -0700 Subject: [PATCH] bit7z: Fix build with clang The 4.1.0 upgrade added two CXXFLAGS that only work with GCC, which breaks the clang build of the testsuite (BIT7Z_WARNINGS_AS_ERRORS defaults to BIT7Z_BUILD_TESTS, so -Werror is on whenever ptest is enabled). error: unknown warning option '-Wno-sfinae-incomplete'; did you mean '-Wno-delete-incomplete'? [-Werror,-Wunknown-warning-option] -Wsfinae-incomplete is a GCC 15+ diagnostic that clang does not have, so only pass it when building with GCC. cpm_cache/ghc_filesystem/include/ghc/filesystem.hpp:4090:41: error: implicit conversion changes signedness: 'int' to 'mode_t' (aka 'unsigned int') [-Werror,-Wsign-conversion] Upstream declares the ghc::filesystem include directory as a SYSTEM one (target_include_directories(ghc_filesystem SYSTEM INTERFACE ...) in cmake/Dependencies.cmake), which keeps warnings from that header quiet. Passing it as a plain -I undoes that, so use -isystem instead. There is nothing to upgrade to here, 4.1.0 is the latest release and upstream master is a single documentation commit ahead of it. Signed-off-by: Khem Raj --- meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb b/meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb index 4661046220..5f0b65b3cc 100644 --- a/meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb +++ b/meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb @@ -35,8 +35,15 @@ DEPENDS = "7zip" EXTRA_OECMAKE += "-DBIT7Z_CUSTOM_7ZIP_PATH=${STAGING_INCDIR}/7zip" -CXXFLAGS:append = " -Wno-error=array-bounds -Wno-sfinae-incomplete" -CXXFLAGS:append = " -I${B}/cpm_cache/ghc_filesystem/include" +CXXFLAGS:append = " -Wno-error=array-bounds" +# -Wsfinae-incomplete is a GCC 15+ diagnostic, clang does not know the option +# and errors out on it because the testsuite build enables -Werror. +CXXFLAGS:append:toolchain-gcc = " -Wno-sfinae-incomplete" +# Use -isystem, the same way upstream declares this include directory +# (target_include_directories(ghc_filesystem SYSTEM INTERFACE ...) in +# cmake/Dependencies.cmake). With a plain -I the warnings coming out of +# ghc/filesystem.hpp are reported and the testsuite build enables -Werror. +CXXFLAGS:append = " -isystem ${B}/cpm_cache/ghc_filesystem/include" PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" PACKAGECONFIG[tests] = " \