]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
perl: Disable strict aliasing with clang
authorKhem Raj <raj.khem@gmail.com>
Thu, 7 Aug 2025 04:14:00 +0000 (21:14 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Aug 2025 17:03:13 +0000 (18:03 +0100)
clang-21+ compiled perl ends up with segfults in
various places if this optimization is enabled

panic: del_backref, svp=0 at /usr/lib/perl5/5.40.2/warnings.pm line 622.
Compilation failed in require at /usr/lib/perl5/5.40.2/Getopt/Std.pm line 4.

The crash starts at frame #0 in Perl_sv_kill_backrefs() at sv.c:6420
called during magic cleanup (Perl_magic_killbackrefs)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/recipes-devtools/perl/perl_5.40.2.bb

index c3bcbf053d93c695f020f79f047520a28a6d80a3..1df1467d42457a733d31aa73f5f7414b6af5ca8e 100644 (file)
@@ -50,6 +50,10 @@ export ENC2XS_NO_COMMENTS = "1"
 
 CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 
+# Perl built with clang runs into sefaults with clang-21+
+# https://github.com/llvm/llvm-project/issues/152241
+CFLAGS:append:toolchain-clang = " -fno-strict-aliasing"
+
 do_configure:prepend() {
     rm -rf ${B}
     cp -rfp ${S} ${B}