webkitgtk3: upgrade 2.50.6 -> 2.52.4

fix -Werror=poison-system-directories in g-ir-scanner

CMake's pkg_check_modules stores the bare INCLUDEDIR variable (/usr/include)
on imported targets' INTERFACE_INCLUDE_DIRECTORIES. WebKit's FindGI.cmake
forwards every interface include dir to g-ir-scanner as -I, so the
introspection compile is invoked with -I/usr/include. With a GCC configured
with --enable-poison-system-directories=error (as in OpenEmbedded cross gcc):

  cc1: error: include location "/usr/include" is unsafe for cross-compilation
  [-Werror=poison-system-directories]

g-ir-scanner only extracts -D/-I/-U from CFLAGS (not -Wno-error flags), so the
warning cannot be relaxed via the recipe CFLAGS. Filter the bare host system
include directories (/usr/include, /usr/local/include) out of the scanner flags
in FindGI.cmake instead; the sysroot include path is added automatically.

filter bare system include dirs from gir generator expr

The FindGI g-ir-scanner fix only filtered /usr/include from the dependency
loop that builds scanner_flags. The include dirs also reach the scanner via
the per-target INTERFACE_INCLUDE_DIRECTORIES generator expression that is
joined into -I flags on the g-ir-scanner command line, which was left
unfiltered.

JavaScriptCore-4.1.gir happens to carry no bare /usr/include on its target
so it succeeded, but WebKit2/WebKitGTK does, so the WebKitGTK introspection
still failed under the OpenEmbedded cross compiler:

  cc1: error: include location "/usr/include" is unsafe for cross-compilation
  [-Werror=poison-system-directories]

Filter /usr/include and /usr/local/include out of the target_inc generator
expression with $<FILTER:...,EXCLUDE,...> too.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj
2026-06-09 21:17:26 -07:00
parent 63f74f7a1c
commit fd064db6b1
2 changed files with 74 additions and 1 deletions
@@ -0,0 +1,72 @@
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 25 Jun 2026 00:00:00 +0000
Subject: [PATCH] FindGI: drop bare system include dirs from g-ir-scanner flags
When cross-compiling, CMake's pkg_check_modules records the bare pkg-config
INCLUDEDIR variable (e.g. /usr/include) on the imported targets'
INTERFACE_INCLUDE_DIRECTORIES. FindGI forwards every interface include dir
to g-ir-scanner as -I, so the introspection compile is invoked with a bare
-I/usr/include. With a GCC configured with
--enable-poison-system-directories=error (as in OpenEmbedded) this is a hard
error:
cc1: error: include location "/usr/include" is unsafe for cross-compilation
[-Werror=poison-system-directories]
g-ir-scanner does not forward the recipe's -Wno-error=poison-system-directories
(it only extracts -D/-I/-U from CFLAGS), so the warning cannot be relaxed from
the recipe. Filter the bare host system include directories out instead; the
proper sysroot include path is added by the compiler driver automatically, so
dropping them is safe.
The include dirs reach the scanner through two paths, both of which must be
filtered:
* the dependency loop that appends to scanner_flags, and
* the per-target INTERFACE_INCLUDE_DIRECTORIES generator expression that is
joined into -I flags on the g-ir-scanner command line.
Filtering only the first path is not enough: JavaScriptCore-4.1.gir happens to
have no bare /usr/include on its target, but WebKit2/WebKitGTK does, so the
WebKitGTK introspection still failed via the generator-expression path. Filter
both.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Source/cmake/FindGI.cmake | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- a/Source/cmake/FindGI.cmake
+++ b/Source/cmake/FindGI.cmake
@@ -297,6 +297,15 @@ function(GI_INTROSPECT namespace nsversion header)
if (NOT IS_ABSOLUTE "${incdir}")
get_filename_component(incdir "${incdir}" REALPATH BASE_DIR "${target_srcdir}")
endif ()
+ # Skip bare host system include directories. When cross-compiling
+ # these leak in via the bare pkg-config INCLUDEDIR variable and
+ # g-ir-scanner passes them to the compiler, which rejects them with
+ # -Werror=poison-system-directories ("include location \"/usr/include\"
+ # is unsafe for cross-compilation"). The sysroot include path is added
+ # automatically, so dropping these is safe.
+ if (incdir STREQUAL "/usr/include" OR incdir STREQUAL "/usr/local/include")
+ continue ()
+ endif ()
list(APPEND scanner_flags "-I${incdir}")
endforeach ()
@@ -337,6 +346,13 @@ function(GI_INTROSPECT namespace nsversion header)
# Generate .gir
set(target_def "$<TARGET_PROPERTY:${opt_TARGET},COMPILE_DEFINITIONS>")
set(target_inc "$<TARGET_PROPERTY:${opt_TARGET},INTERFACE_INCLUDE_DIRECTORIES>")
+ # The target's INTERFACE_INCLUDE_DIRECTORIES are joined into -I flags on
+ # the g-ir-scanner command line below. Drop the bare host system include
+ # dirs (/usr/include, /usr/local/include) here too, otherwise -I/usr/include
+ # trips -Werror=poison-system-directories under the OpenEmbedded cross
+ # compiler. The sysroot include path is added automatically, so dropping
+ # them is safe.
+ set(target_inc "$<FILTER:${target_inc},EXCLUDE,^/usr/(local/)?include$>")
add_custom_command(
OUTPUT "${gir_path}"
COMMENT "Generating ${gir_name}.gir"
@@ -15,13 +15,14 @@ LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d842
SRC_URI = "https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz \
file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \
file://0001-FindGI-drop-bare-system-include-dirs-from-g-ir-scann.patch \
file://reproducibility.patch \
file://no-musttail-arm.patch \
file://sys_futex.patch \
file://fix-ftbfs-riscv64.patch \
file://0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch \
"
SRC_URI[sha256sum] = "2b281abf8894ffc6172152e5660b75eeeedbe1cc43d6783d09dc79f7c865bb42"
SRC_URI[sha256sum] = "cf4076a1ca2a64788edca8c452d8ebb68d5e2965e588fe46a388a016513edce4"
inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gi-docgen