Commit Graph

65 Commits

Author SHA1 Message Date
Matthias Schiffer
b98fb60635 perl: fix parallel build race condition in target build
We have received reports of builds of perl occasionally failing when
building with many parallel jobs, with a log like the following:

    LD_LIBRARY_PATH=[...]/perl/perl-5.40.0 ./miniperl -Ilib make_ext.pl \
        dist/constant/pm_to_blib  MAKE="make" LIBPERL_A=libperl.so
    File/Path.pm did not return a true value at [...]/hostpkg/usr/lib/perl5/5.40.0/ExtUtils/MakeMaker.pm line 13.
    BEGIN failed--compilation aborted at [...]/hostpkg/usr/lib/perl5/5.40.0/ExtUtils/MakeMaker.pm line 13.
    Compilation failed in require at Makefile.PL line 3.
    BEGIN failed--compilation aborted at Makefile.PL line 3.
    Unsuccessful Makefile.PL(dist/constant): code=65280 at make_ext.pl line 532.

The failing extension (dist/constant in the above log) would differ
between runs.

The cause of the issue is the `-Ilib` in the command line of miniperl.
In the host build, `./miniperl -I lib` will use the following include
path:

    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/AutoLoader/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/dist/Carp/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/dist/PathTools
    [..]/build_dir/hostpkg/perl/perl-5.40.0/dist/PathTools/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-Install/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-MakeMaker/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-Manifest/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/File-Path/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/ext/re
    [..]/build_dir/hostpkg/perl/perl-5.40.0/dist/Term-ReadLine/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/dist/Exporter/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/ext/File-Find/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/Text-Tabs/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/dist/constant/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/version/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/Getopt-Long/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/Text-ParseWords/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-PL2Bat/lib
    [..]/build_dir/hostpkg/perl/perl-5.40.0/lib
    .

Various dependencies of the extension build scripts (Makefile.PL) -
including File-Path, which failed to be loaded in the error log - are
included in the path by buildcustomize.pl, as these extensions are only
installed to `lib` as the build proceeds.

However, in a target build, miniperl is just a symlink to the previously
built host perl. As the host perl does not implicitly load
`buildcustomize.pl`, we get the following include path for
`./miniperl -Ilib`:

    lib
    [..]/staging_dir/hostpkg/usr/lib/perl5/site_perl/5.40.0/x86_64-linux
    [..]/staging_dir/hostpkg/usr/lib/perl5/site_perl/5.40.0
    [..]/staging_dir/hostpkg/usr/lib/perl5/5.40.0/x86_64-linux
    [..]/staging_dir/hostpkg/usr/lib/perl5/5.40.0

The host perl's install location is used as the default include path
which provides File-Path etc. for the target build; however, as more
and more libraries get installed into `lib` during the extension build,
they may get loaded from there instead, as `lib` is at the beginning of
the include path. When multiple extensions are built in parallel, a
Makefile.PL may attempt to load File/Path from `lib` after the file has
been created, but before its contents have been written fully, resulting
in the build to fail.

In fact, we should not load anything from `lib` during the target build,
as it is the staging directory for the target, including native
extensions built for the target architecture - with one exception: The
build scripts expect to find target information in the `Config` module,
so simply removing `lib` from the include path completely would break
the build.

Solve the issue by creating an alternative lib directory `lib_build`,
symlinking `Config.pm` and its dependencies in it, and replacing the
`-Ilib` argument with `-Ilib_build` using a wrapper script around the
host perl executable. This is similar to the approach seen in perl's own
obsolete/broken cross compile scripts (`Cross/Makefile`).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2025-05-05 11:20:38 +02:00
Matthias Schiffer
e7b5a35e5c perl: drop 110-always_use_miniperl.patch
The patch was introduced in commit 4c57844f0f ("lang/perl: Add hack to
make perl always use miniperl during build"), but it is not actually
necessary. By setting $perl to a non-empty value (using 'perl' as is
common on desktop distros), the logic works as intended and selects the
correct perl binary for host and target builds.

As miniperl just symlinks to host perl for target builds, the main
effect of this change is not unconditionally passing `-Ilib -I.`
anymore. This seems like a good thing; host libraries should be used
with host perl by default.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2025-05-05 11:20:38 +02:00
Esaaprilia Salsabila
5a923168c8 perl: fix Segmentation fault
Signed-off-by: Esaaprilia Salsabila <esaapriliasalsabila@gmail.com>
2024-07-22 18:48:26 -07:00
Esaaprilia Salsabila
c5b97d4d96 perl: update version 5.40.0
https://metacpan.org/release/HAARG/perl-5.40.0

remove bytes_heavy.pl
Perl/perl5#22047

perl update version 5.40.0

Signed-off-by: Esaaprilia Salsabila <esaapriliasalsabila@gmail.com>
2024-06-20 14:18:35 -07:00
Andy Syam
2484715985 perl: update to version 5.38.2
removed one that no longer exists in perl-5.38.2

updated one patch

fixed missing builtin.pm

Signed-off-by: Andy Syam <privasisource@gmail.com>
2023-12-01 11:18:10 -08:00
Andy Syam
0142d06598 perl: update to version 5.38.0
removed some sources to download perl. I believe I only need one source to download perl at https://www.cpan.org/src/5.0. I see some Linux distributions use that source to download.
change the position of PKG_MAINTAINER to make it neater and prettier

perform a patch refresh
removes some patches that have been applied in perl-5.38.0 as well as patches that are no longer used in perl-5.38.0

added one patch Perl/perl5@ba6e2c3 this fixes the issue regcomp*.c, regexec.c - fixup regex engine build under -Uusedl

provided updates and synchronized libc.config base.config version.config to perl-5.38.0
removed deprecated arybase in perl-5.29.4

Signed-off-by: Andy Syam <privasisource@gmail.com>
2023-11-22 18:32:50 -08:00
Zoltan HERPAI
cf59047d3c perl: add support for riscv64
Required by sifiveu and upcoming riscv targets.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2023-10-22 23:29:03 -06:00
Rosen Penev
59980b6be7 perl: add powerpc64 support
Needed by the QoriQ target.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-02 16:30:32 -08:00
Alexander Ryzhov
fed1b3b11b perl: define $sysroot for extensions
Signed-off-by: Alexander Ryzhov <github@ryzhov-al.ru>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-08 23:08:58 -08:00
Tony Ambardar
0716d8fe5a perl: add missing config for mips64el
Compilation otherwise fails building for MIPS Malta 64-bit LE.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2018-12-18 21:28:26 -08:00
Philip Prindeville
77c738c54f perl: update to 5.28.1
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-12-03 15:58:49 -07:00
Philip Prindeville
4e29b4f3bb perl: build with -fno-strict-liasing and -fwrapv
Looking at Configure and Porting/config.sh, it seems that Perl
requires both of these options to build correctly.

Should fix FS #1464.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-08-01 11:19:32 -06:00
Philip Prindeville
b94744496f perl: update to 5.28
Refresh patches 900 and 910.

Add fix (920) for improperly gated variable.

Add workaround (020) for Storable's run-time check for stacksize.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-07-31 15:45:35 -06:00
Philip Prindeville
79092d4705 perl: update to 5.26.2
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-04-29 16:18:14 -06:00
Tomasz Maciej Nowak
6535c76395 perl: add build config for aarch64
Because nonexistent aarch64.config the build of perl will fail for ARM
64-bit targets. Fix it by adding mentioned config. Fixes #2963.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2018-01-26 00:40:17 +01:00
Philip Prindeville
4a94479f96 perl: update to 5.26.1
Required changes:

* Add qualifying '.' to scripts or to @INC, as appropriate since we're
  enabling default_inc_excludes_dot;

* Add new platform/library definitions like double-double format and
  locale library functions/headers;

* Delete patch 020 as it's been upstreamed;

Optional changes:

* Instead of using -@rm and having that fail, emit an error message,
  and be ignored, just use @rm -f instead which will always succeed.

Security
[CVE-2017-12837] Heap buffer overflow in regular expression compiler

Compiling certain regular expression patterns with the case-insensitive
modifier could cause a heap buffer overflow and crash perl. This has
now been fixed. [perl #131582]

[CVE-2017-12883] Buffer over-read in regular expression parser

For certain types of syntax error in a regular expression pattern, the
error message could either contain the contents of a random, possibly
large, chunk of memory, or could crash perl. This has now been fixed.
[perl #131598]

[CVE-2017-12814] $ENV{$key} stack buffer overflow on Windows

A possible stack buffer overflow in the %ENV code on Windows has been
fixed by removing the buffer completely since it was superfluous anyway.
[perl #131665]

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-10-24 11:40:34 -06:00
Philip Prindeville
d58ac19c9f perl: put -rdynamic in proper build variable
The standard way to pass -rdynamic (or -Wl,--dynamic-export) is via
the $ccdlflags variable.  Do what is best practice.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-10-16 16:40:22 -06:00
Philip Prindeville
b392cd595a perl: simplify passing in ldflags
Originally as PR #2383 but rewritten.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Alexander Ryzhov <openwrt@ryzhov-al.ru>
2017-10-16 16:40:22 -06:00
Michail Frolov
571a810fd4 lang/perl: Upgraded to Perl 5.24.1
Signed-off-by: Michail Frolov <frolovm@pobox.com>
2017-05-10 14:46:25 -04:00
Stefan Weil
a91ab74d48 lang/perl: Fix typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-04-09 19:47:45 +02:00
Marcel Denia
a23ffef7e9 perl: Update to 5.22.1
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-12-21 17:53:02 +01:00
Marcel Denia
bb06539632 perl: Set gccversion configuration symbol correctly
This was previously manually set to '4.8.0'. Aside from just being incorrect,
it also breaks Errno's GCC5 detection.

Fixes #2044.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-11-29 22:39:39 +01:00
Marcel Denia
51bef7ad20 perl: Enable crypt() for all libc implementations
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-11-20 12:33:37 +01:00
Marcel Denia
df26e427f9 perl: Improve run_tests.sh
- Add some useful options for debugging tests and test failures
- Properly handle tests located in lib/

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-09-01 09:23:24 +02:00
Marcel Denia
88800d31ee perl: Update extensions configuration symbol
This needs to be a concatenation of {nonxs,dynamic,static}_ext, as
shown by Config/Extensions.t.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-09-01 09:23:24 +02:00
Marcel Denia
cecee995b0 perl: Disable setlocale usage under musl
While setlocale() is present, musl currently doesn't provide a suitable implementation.
It'll silently accept every locale, even if not present at all, defaulting them
to C.UTF-8. This will confuse applications as well as our testsuite(see lib/locale.t).

Even if a locale does exist, it's effects will not apply to an extent that will
satisfy many applications.

Avoid further mischief here and just disable setlocale() for now.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-09-01 09:23:24 +02:00
Marcel Denia
afad970139 perl: Switch to split configuration files
This replaces the previously used collection of configuration files for every single
architecture in conjunction with hacky overrides, which became an increasing burden to maintain.

Fixes a number of outstanding bugs and oddities, with the most important one being the
previously wrong signal order(as shown by ext/POSIX/t/sigaction.t).

See files/perlconfig.pl's POD and files/README.config for details.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-09-01 09:23:15 +02:00
Marcel Denia
5cdd6755f3 perl: Upgrade configuration files to perl 5.22.0
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-06-18 23:58:45 +02:00
Marcel Denia
273d4bd6a7 perl: Have perl's major version number in one central place
This will simplify updating the package in the future.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-06-18 23:58:45 +02:00
Marcel Denia
3c7528d2f4 perl: Pass _LARGEFILE_SOURCE and _FILE_OFFSET_BITS in cflags
Fixes broken largefile support.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-05-27 02:03:56 +02:00
Marcel Denia
afb99d5a3d perl: Remove duplicate "subversion" configuration symbol for armeb
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-05-27 02:03:56 +02:00
Marcel Denia
052129858e perl: Upgrade configuration files to perl 5.20.2
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-02-16 15:15:48 +01:00
Marcel Denia
30753fd5e5 perl: Add threading configuration for all remaining architectures
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-02-04 13:51:21 +01:00
Marcel Denia
fe91afba66 perl: Add i486 threading configuration
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-02-04 13:51:21 +01:00
Marcel Denia
14d601c0eb perl: Fix version configuration symbols
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-01-10 15:19:10 +01:00
Marcel Denia
c68e888e88 perl: Add mips64 configuration
Signed-off-by: Marcel Denia <naoir@gmx.net>
2015-01-10 15:19:03 +01:00
Marcel Denia
13f4a02172 perl: Update to 5.20.1
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-11-06 08:18:43 +01:00
Marcel Denia
771b776a19 perl: Fix signal order for i486
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-11-06 08:18:42 +01:00
Marcel Denia
671a43167f perl: Set nv_overflows_integers_at configuration symbol
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-11-06 08:18:42 +01:00
Marcel Denia
95058be605 perl: Add basic test support
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-11-06 08:18:42 +01:00
Marcel Denia
ef3ac53da2 perl: Don't try to link against libnsl
And also remove all other references to avoid confusion.
libnsl isn't really needed. Removing it allows glibc based
toolchains to build perl.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-10-16 11:12:44 +02:00
Marcel Denia
4456537077 perl: Make I8/I16/I32 types explicitly signed for PPC
Type signedness is undefined for char. char may actually be unsigned for
some CPUs.
This fixes various bugs on PPC, like negative array indices.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-10-16 11:12:44 +02:00
Marcel Denia
3d32350026 perl: Remove unused helper scripts
They're broken anyway

Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-08-14 17:14:23 +02:00
Marcel Denia
c64769bd8f perl: Build shared libperl
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-08-14 17:14:22 +02:00
Marcel Denia
9e9110eff7 lang/perl: Adjust some leftover x86_64 configuration symbols
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-07-22 16:18:54 +02:00
Marcel Denia
a1993737aa lang/perl: Make I8/I16/I32 types explicitly signed for ARM
Type signedness is undefined for char. char may actually be unsigned for
some CPUs.
This fixes various bugs on ARM, for example negative array indices.

Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-07-22 16:18:46 +02:00
Marcel Denia
1032e88566 lang/perl: Upgrade x86_64 cppsymbols configuration symbol
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-07-20 05:18:04 +02:00
Marcel Denia
3dc41445fa lang/perl: Upgrade most x86_64 configuration symbols to match a 64-bit environment
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-07-20 05:17:49 +02:00
Marcel Denia
98f601e870 lang/perl: Add x86_64 config based on i486 config
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-07-20 05:17:44 +02:00
Marcel Denia
c902e36c80 lang/perl: Set archlib symbol in powerpc configuration
Signed-off-by: Marcel Denia <naoir@gmx.net>
2014-07-19 08:29:15 +02:00