diff mbox series

[meta-oe,blacksail,87/95] php: fix build of the bundled xxHash with -Og

Message ID 20261203111406.4182597-87-ankur.tyagi85@gmail.com
State New
Headers show
Series [meta-gnome,blacksail,1/95] eog: upgrade 50.3 -> 50.4 | expand

Commit Message

Ankur Tyagi Dec. 3, 2026, 11:13 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>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
(cherry picked from commit 8214a11d320dff9121ec622b45b2d1fbeeb71473)
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
 meta-oe/recipes-devtools/php/php_8.5.13.bb | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/php/php_8.5.13.bb b/meta-oe/recipes-devtools/php/php_8.5.13.bb
index 0fbcfd6ea2..55dcc07786 100644
--- a/meta-oe/recipes-devtools/php/php_8.5.13.bb
+++ b/meta-oe/recipes-devtools/php/php_8.5.13.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"