Skip to content

perl 5.40.2 fails to run simple script when compiled with Clang-21.1.0-rc2 #152241

@kraj

Description

@kraj

I use yocto to build a system using clang as default system compiler. When using clang-21 RC2, resulting perl is not working correctly. A simple reproducer is

perl -e 'use Getopt::Std;'

instead of executing successfully results in

panic: magic_killbackrefs (flags=0) at /usr/lib/perl5/5.40.2/warnings.pm line 620.
Compilation failed in require at /usr/lib/perl5/5.40.2/Getopt/Std.pm line 4.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.40.2/Getopt/Std.pm line 4.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

This happens on x86_64 and also on arm64 targets.

If perl is built with -Doptimize='-O2 -fno-strict-aliasing' added to configure then it works correctly. It also works file when using just -O1

I do not have a further narrowed down reproducer than this yet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Fix

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions