diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-08-16 22:53:31 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-18 21:14:07 +0100 |
| commit | 36c6209b323bb15f7ab366d4a503012d1f43eb6b (patch) | |
| tree | a5e922cb8806a79d1e68639519fad731f2616d7f /meta | |
| parent | f9e0afedea37edeabc7dcb03bddd7a60fe8d6945 (diff) | |
| download | poky-36c6209b323bb15f7ab366d4a503012d1f43eb6b.tar.gz | |
perl: Disable builtin memcpy & string inlines with gcc/x86-64-v3
PERL built with GCC 15 and -march=x86-64-v3 fails several
op/pack.t cases due to aggressive lowering of __builtin_memcpy
and inlined/fortified string ops. In pp_pack, some in-place copies
can overlap, treating memcpy as non-overlapping yields corrupted
bytes (zeros or wrong prefixes).
The issue does not reproduce with -march=core2.
When using x86-64-v3 memcpy gets emitted very aggressively
(vectorized / reordered) and assumes no overlap.
The flags force calls through libc (overlap-safe behavior),
restoring deterministic pack/unpack and fixing the test failures.
Inline functions could be faster in execution but correctness is
more important
Fixes [YOCTO #15950]
(From OE-Core rev: 6d557b16f1e45e616c6eb208e4d7a2f2839a2e4f)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/perl/perl_5.40.2.bb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl_5.40.2.bb b/meta/recipes-devtools/perl/perl_5.40.2.bb index 1df1467d42..a78d2ed0be 100644 --- a/meta/recipes-devtools/perl/perl_5.40.2.bb +++ b/meta/recipes-devtools/perl/perl_5.40.2.bb | |||
| @@ -54,6 +54,9 @@ CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |||
| 54 | # https://github.com/llvm/llvm-project/issues/152241 | 54 | # https://github.com/llvm/llvm-project/issues/152241 |
| 55 | CFLAGS:append:toolchain-clang = " -fno-strict-aliasing" | 55 | CFLAGS:append:toolchain-clang = " -fno-strict-aliasing" |
| 56 | 56 | ||
| 57 | # Needed with -march=x86-64-v3 | ||
| 58 | CFLAGS:append:toolchain-gcc:class-target:x86-64 = " -fno-builtin-memcpy -D__NO_STRING_INLINES -U_FORTIFY_SOURCE" | ||
| 59 | |||
| 57 | do_configure:prepend() { | 60 | do_configure:prepend() { |
| 58 | rm -rf ${B} | 61 | rm -rf ${B} |
| 59 | cp -rfp ${S} ${B} | 62 | cp -rfp ${S} ${B} |
