Related previous topic (locked now for being too old): https://archlinuxarm.org/forum/viewtopic.php?f=15&t=13000&hilit=perl
On an armv5 device with current perl installed (5.30.0-3 as of now), various perl based utilities throw strange errors. Example:
$this->bbcode_second_pass_code('', '
$ autoreconf
Operator or semicolon missing before %_local_duplicate_messages at /usr/share/autoconf/Autom4te/Channels.pm line 315.
Ambiguous use of % resolved as operator % at /usr/share/autoconf/Autom4te/Channels.pm line 315.
Operator or semicolon missing before %_global_duplicate_messages at /usr/share/autoconf/Autom4te/Channels.pm line 327.
Ambiguous use of % resolved as operator % at /usr/share/autoconf/Autom4te/Channels.pm line 327.
Operator or semicolon missing before %channel_opts at /usr/share/autoconf/Autom4te/Channels.pm line 366.
Ambiguous use of % resolved as operator % at /usr/share/autoconf/Autom4te/Channels.pm line 366.
Global symbol "%_local_duplicate_messages" requires explicit package name (did you forget to declare "my %_local_duplicate_messages"?) at /usr/share/autoconf/Autom4te/Channels.pm line 286.
Global symbol "%_global_duplicate_messages" requires explicit package name (did you forget to declare "my %_global_duplicate_messages"?) at /usr/share/autoconf/Autom4te/Channels.pm line 287.
BEGIN not safe after errors--compilation aborted at /usr/share/autoconf/Autom4te/Channels.pm line 406.
Compilation failed in require at /usr/share/autoconf/Autom4te/ChannelDefs.pm line 19.
BEGIN failed--compilation aborted at /usr/share/autoconf/Autom4te/ChannelDefs.pm line 19.
Compilation failed in require at /usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /usr/bin/autoreconf line 39.
')
According to this reply for perlbug #133803, the cause of these errors are unaligned memory accesses.
Issuing the following command locally makes the errors go away, which confirms this is indeed the cause:
$this->bbcode_second_pass_code('', '# echo 2 > /proc/cpu/alignment')
Explanation: https://www.kernel.org/doc/Documentation/arm/mem_alignment
The above is rather a quick&dirty hack than a real solution though. There is also a suggested workaround that can be implemented at distro level until they invent a proper fix upstream:
$this->bbcode_second_pass_quote('', 'T')his issue seems to be caused by wrong alignment causing unexpected behaviour. Running Configure with -Dd_u32align makes the build succeed.