diff mbox series

[meta-oe,1/7] bit7z: Fix build with clang

Message ID 20260911141756.2275517-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,1/7] bit7z: Fix build with clang | expand

Commit Message

Khem Raj Sept. 11, 2026, 2:17 p.m. UTC
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 <khem.raj@oss.qualcomm.com>
---
 meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

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] = " \