From 73c9415e6a53d717a5f83ca99f624e0bf1aadb9b Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 18 Jul 2023 12:58:58 +1000 Subject: [PATCH] MDEV-31727: pcre stack size not functioning on clang-16 noinline attribute was being ignored by clang-16 and reporting 32 stack size on Gentoo, 16 locally on Fedora 38. Based on https://stackoverflow.com/questions/54481855/clang-ignoring-attribute-noinline appended noopt in addition to the gcc recognised attributes. After that the -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) returned 1056, simlar to gcc. From https://bugs.gentoo.org/910188. Thanks Zhixu Liu for the great bug report. --- pcre/pcre_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcre/pcre_exec.c b/pcre/pcre_exec.c index c30d90acfc7..6df88071c66 100644 --- a/pcre/pcre_exec.c +++ b/pcre/pcre_exec.c @@ -513,7 +513,7 @@ Returns: MATCH_MATCH if matched ) these values are >= 0 static int match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode, PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb, - unsigned int rdepth) __attribute__((noinline,noclone)); + unsigned int rdepth) __attribute__((optnone,noinline,noclone)); #endif static int match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,