diff --git a/meta-oe/recipes-devtools/php/php_8.6.0.bb b/meta-oe/recipes-devtools/php/php_8.6.0.bb
index b6cbf02a2f..69eb79a42c 100644
--- a/meta-oe/recipes-devtools/php/php_8.6.0.bb
+++ b/meta-oe/recipes-devtools/php/php_8.6.0.bb
@@ -127,6 +127,18 @@ CFLAGS += " -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_S
 # default when cross compiling
 # See https://bugs.php.net/bug.php?id=60109
 CFLAGS += " -DHAVE_LIBDL "
+
+# The bundled xxHash in ext/hash marks its XXH3 vector paths always_inline but
+# only reaches them through function pointers. It drops the inline hints on its
+# own when __NO_INLINE__ is defined (-O0, -fno-inline) but never for -Og, and
+# GCC 14 and newer no longer resolve those indirect calls at -Og, so
+# hash_xxhash.c fails to build with DEBUG_BUILD. Upstream xxHash closed this as
+# not fixable in code and documents XXH_NO_INLINE_HINTS as the supported way to
+# compile with -Og:
+# https://github.com/Cyan4973/xxHash/issues/943
+# https://github.com/Cyan4973/xxHash#binary-size-control
+CFLAGS += "${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Og', '-DXXH_NO_INLINE_HINTS', '', d)}"
+
 LDFLAGS += " -ldl "
 LDFLAGS:append:libc-musl = " -lucontext "
 LDFLAGS:append:riscv64 = " -latomic"
