diff mbox series

[meta-oe,v2] php: fix build of the bundled xxHash with -Og

Message ID 20261201073018.4053558-1-anuj.mittal@oss.qualcomm.com
State Under Review
Headers show
Series [meta-oe,v2] php: fix build of the bundled xxHash with -Og | expand

Commit Message

Anuj Mittal Dec. 1, 2026, 7:30 a.m. UTC
From: Anuj Mittal <anuj.mittal@oss.qualcomm.com>

With DEBUG_BUILD enabled, php and php-native fail to compile
ext/hash/hash_xxhash.c with GCC 14 and newer:

  ext/hash/xxhash/xxhash.h:4786:1: error: inlining failed in call to
  'always_inline' 'XXH3_accumulate_512_sse2': function not considered
  for inlining

The bundled xxHash marks its XXH3 vector paths always_inline but only
reaches them through function pointers. It drops the inline hints when
__NO_INLINE__ is defined (-O0, -fno-inline) but not for -Og, which
can't be detected at compile time. Upstream xxHash closed this as not
fixable in code [1] and documents XXH_NO_INLINE_HINTS as the way to
compile with -Og [2].

Define XXH_NO_INLINE_HINTS when DEBUG_BUILD is selected.

[1] https://github.com/Cyan4973/xxHash/issues/943
[2] https://github.com/Cyan4973/xxHash#binary-size-control

Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
---
 meta-oe/recipes-devtools/php/php_8.6.0.bb | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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..1fa897270e 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,9 @@  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 "
+
+CFLAGS += "${@oe.utils.vartrue('DEBUG_BUILD', '-DXXH_NO_INLINE_HINTS=1', '', d)}"
+
 LDFLAGS += " -ldl "
 LDFLAGS:append:libc-musl = " -lucontext "
 LDFLAGS:append:riscv64 = " -latomic"