Commit Graph

197 Commits

Author SHA1 Message Date
Timothy M. Ace
5f76e1c0ad perlbase-extutils: Adding required perlbase-version dependency
Attempting to use ExtUtils::MakeMaker from perlbase-extutils results in an
error of "Can't locate ExtUtils/MakeMaker/version/vpp.pm in @INC".
Installing perlbase-version fixes the error. Therefore we add
perlbase-version as a dependency of perlbase-extutils.

Signed-off-by: Timothy M. Ace <openwrt@timothyace.com>
2025-05-25 11:42:05 -06:00
Matthias Schiffer
6766939892 perl: do not set LD_LIBRARY_PATH for cross compile
We don't want to set LD_LIBRARY_PATH to a directory filled with target
libraries when running a host perl. When the host and target
architecture are the same, some libraries will be loaded from this
path, resulting in the build to break because of glibc/musl mismatch.

Reported-by: John Audia <therealgraysky@proton.me>
Fixes: e7b5a35e5c ("perl: drop 110-always_use_miniperl.patch")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2025-05-16 10:01:27 +02:00
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
Matthias Schiffer
2a7dc15402 perl: replace 910-miniperl-needs-inc-dot.patch with smaller scope fix
The patch was first introduced in commit 4a94479f96 ("perl: update to
5.26.1") to fix the target build when the host perl has
default_inc_excludes_dot enabled. It just added back the `-I`. to every
call of miniperl; this solution is questionable however, as it adds `.` to
the beginning of the search path, not as a final fallback like perl did
before default_inc_excludes_dot (and like miniperl does).

It is also not necessary - only two scripts, write_buildcustomize.pl and
configpm, expect to be able to include a file from `.` (in both cases a
file the script just generated). Just fix the two scripts instead.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2025-05-05 11:20:38 +02:00
Tianling Shen
9dc0ee812d perl: perlmod: make version apk compatible
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-16 11:42:47 +02:00
Andreas Gnau
68c0a57f57 perl: Run make depend to fix build race condition
Run make depend before building perl. This fixes parallel build failures
on machines with a high number of cores.

Example error 1:

    /bin/ln -s /build/staging_dir/hostpkg/usr/bin/generate_uudmap generate_uidmap
    make[5]: ./generate_uudmap: Command not found
    make[5]: *** [Makefile:321: bitcount.h] Error 127

Example error 2:

    /bin/ln -s /build/staging_dir/hostpkg/usr/bin/generate_uudmap generate_udmap
    ./generate_uudmap uudmap.h bitcount.h mg_data.h
    /bin/ln: failed to create symbolic link 'generate_uudmap': File exists
    make[5]: *** [Makefile:325: generate_uudmap] Error 1

Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996953
Link: 366bc98c91
Closes: https://github.com/openwrt/packages/issues/8238
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2024-07-28 15:53:19 -06: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
Rosen Penev
ea8e6fbf33 perl: fix compilation with GCC14
Need the header for fegetround.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-08 17:47:24 -07:00
Christian Marangi
e28bd51cab treewide: update packages to use new toolchain define
Update packages to use new toolchain define and drop usage of
TOOLCHAIN_DIR.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-28 15:42:30 +08:00
Georgi Valkov
847a535a3b perl: fix not a Mach-O file on macOS
Reverts [1] to resolve the following build error on macOS:

/Volumes/wrt3200/openwrt/staging_dir/hostpkg/usr/bin/perl installperl --destdir=/Volumes/wrt3200/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/perl/perl-5.38.2/ipkg-install
WARNING: You've never run 'make test' or some tests failed! (Installing anyway.)
  /usr/bin/perl5.38.2
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: input file: /Volumes/wrt3200/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/perl/perl-5.38.2/ipkg-install/usr/bin/perl5.38.2 is not a Mach-O file

[1] 88efce3814

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
2024-04-23 19:00:11 -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
Oskari Rauta
96de355818 perl: fix tests
Enabling Perl tests causes failure during build.
Files that should be installed into packages, are
missing or in different location.

This PR removes missing files/paths and replaces
paths that have changed with working ones.

Most likely, test files have been relocated during
time and this portion hasn't been updated when
perl package has updated.

Fixes #21127

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
2023-05-24 06:06:17 +03:00
Tianling Shen
b9481f55d8 perl: perlmod: append _LARGEFILE64_SOURCE flag for musl 1.2.4
musl 1.2.4 deprecated legacy "LFS64" ("large file support") interfaces so
just having _GNU_SOURCE defined is not enough anymore.

Manually pass -D_LARGEFILE64_SOURCE to allow to keep using LFS64 definitions.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-20 13:05:19 +08:00
Robert Marko
2251916df1 perl: fix compilation with musl 1.2.4
musl 1.2.4 deprecated legacy "LFS64" ("large file support") interfaces so
just having _GNU_SOURCE defined is not enough anymore.

_LARGEFILE64_SOURCE has to be defined in the source, or CFLAGS can be used
to pass -D_LARGEFILE64_SOURCE to allow to keep using LFS64 definitions.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-18 10:27:20 +03:00
Doug Thomson
6db2fe93cd perl: enable threading support for aarch64 by default
Perl threads seem to be supported and working for aarch64, and
including aarch64 here would allow packages like freeswitch-mod-perl
to become available from the standard OpwnWrt package repository for
popular routers such as the Linksys E8450 and Belkin RT3200.

Signed-off-by: Doug Thomson <dwt62f+github@gmail.com>
2022-12-14 22:13:40 +08: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
Robert Högberg
7064f30865 perlbase-data: Add dependency on perlbase-scalar
Data::Dumper requires Scalar::Util -> add missing dependency.

Signed-off-by: Robert Högberg <robert.hogberg@gmail.com>
2021-08-31 15:37:32 +02:00
Eneas U de Queiroz
1e18c4324f perl: perlmod.mk: use flock when hostpkg/perl used
Avoid parallel relinking and usage of the host perl binary by wrapping
its usage around flock calls.

Sometimes, two packages will try to relink the static host perl binary
at the same time.  Neither of them will have the other's module linked
in, and one of them will unavoidably clobber the other one's binary.

This will lead to errors when a package will not be able to find a
module that was supposed to be installed.

To fix that, an exclusive flock is used when relinking, with a 900
seconds timeout to avoid locking up the build process forever.

This is not enough because the binary may be concurrently used to build
another module package; perl is used in Configure, Compile, and Install
procedures.  If timing is right, a package will fail with a "permission
denied" error.

So a shared flock call is added in Configure, Compile, and Install
definitions for host and target, with a shorter, 300 seconds timeout.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-08-17 12:03:34 -03:00
Eneas U de Queiroz
19c7496648 perl: perlmod.mk: use 'install' for host binaries
When installing a host perl module, the host perl binary in the staging
dir is replaced by using 'cp'.  However, if the binary is running in a
parallel job, cp will fail with a text file busy error.  Use
$(INSTALL_BIN), which unliks the file first to avoid the error.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-08-11 16:59:20 -03:00
Georgi Valkov
6375f73b29 perl: fix build errors on macOS
Added a check for macOS 11 and newer to resolve a compile error:
*** Unexpected product version 11.2.

Added Internals::getcwd.
Fallback to the built-in getcwd to resolve compile errors on macOS:
Can't locate Errno.pm in @INC
/miniperl not found

Signed-off-by: Georgi Valkov <gvalkov@abv.bg>
2021-02-09 10:45:30 +02:00
Rosen Penev
35f1ef1c50 Revert "perl: fix compilation on x86_64 with glibc and ssp"
This reverts commit 3d5ba0f094.

As of b933f9cf0cb254e368027cad6d5799e45b237df5 , this is not needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-17 20:05:58 -07:00
Ken Wong
65578a43f0 perl: fix build failure in GCC10
The perl Configure file was matching GCC 10 against "1*" and treating it
as GCC 1, causing ABI breakage and segfaults.

Cherry-pick the upstream patch which fixes it to check against (e.g)
"1.*" instead, which will make it work for hundreds more GCC versions
to come.

https://github.com/Perl/perl5/commit/6bd6308fcea3541
 "Adapt Configure to GCC version 10"

Also includes the previous commit just adding GCC 8 and 9 to one case:
https://github.com/Perl/perl5/commit/ae195500577d707
 "Add gcc-8 and gcc-9 for FORTIFY_SOURCE"

Signed-off-by: Ken Wong <xinxijishuwyq@gmail.com>
2020-06-03 11:59:49 +01:00
Ian Cooper
3d5ba0f094 perl: fix compilation on x86_64 with glibc and ssp
perl fails to compile on x86_64 with glibc and stack smashing
protection enabled due to libssp not being specified in the
ldflags.

Signed-off-by: Ian Cooper <iancooper@hotmail.com>
2020-04-29 13:26:25 +01: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
Rosen Penev
2628584ffd perl: Don't build InstallDev under ARC
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-03 20:06:40 -08:00
Jakub Piotr Cłapa
3954356a23 perl: fixed host compilation of static perl on MacOS
All symbols on MacOS are prefixed with an underscore which
interfered with the filtering mechanism (added in perl 5.28)
for extension libraries to be linked into static perl.

Signed-off-by: Jakub Piotr Cłapa <jpc@loee.pl>
2019-11-10 10:48:38 +01:00
Jan Pavlinec
299e5b0a9b treewide: add PKG_CPE_ID for better cvescanner coverage
Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
2019-09-17 12:40:26 +02:00
Sven Eckelmann
bbb1ea7345 treewide: Change .*GPL.*+ licenses to SPDX compatible identifier
The CONTRIBUTING.md requests an (or multiple) SPDX identifier for GPL
licenses. But a lot of packages did use a different, non-SPDX style with a
"+" at the end instead of "-or-later".

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-09-10 07:45:15 +02:00
Rosen Penev
52453b921b perl: Do not build on ARC
Not supported.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-06-02 15:49:58 -07: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
Hans Dedecker
86b8d1946c perl: fix compilation with glibc 2.27
Remove dependency on glibc in 010-musl-compat patch as glibc does not
support _LIB_VERSION anymore in 2.27; see
https://sourceware.org/ml/libc-announce/2018/msg00000.html

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-10-16 11:45:12 +02:00
Philip Prindeville
a5a4eafc93 perlmod: fix ability to build module out-of-feed
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-09-23 14:19:51 -06:00
Philip Prindeville
0d9584724f perl: version modules and non-base packages
Currently external modules and non-base packages are numbered
from their own internal number space, and even though the Perl
ABI number is embedded into them this isn't externally visible.

For example, perl-html-parser-3.72.1 could be built for ABI
5.26 or for 5.28, we can't easily tell.  This changes all of
that by embedding the ABI number into the filename.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-08-13 13:23:11 -06: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
Philip Prindeville
cda0e18b27 Merge pull request #5504 from pprindeville/perl-cleanup
perlmod: avoid 'do' semantics and just concatenate
2018-01-26 16:41:46 -07:00
Philip Prindeville
1e0db9ba80 perlmod: avoid 'do' semantics and just concatenate
In Perl the 'do' construct has some odd side-effects regarding $@,
$!, and return values (i.e. 'do'ing a file which evaluates to undef
can be a little ambiguous).

Instead, generate a preamble to the Makefile.PL and execute it as
stdin.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-01-25 18:48:34 -07:00
Philip Prindeville
531eb4404b Revert "perl: when Makefile.PL fails give more feedback"
This reverts commit a4aaaf8d8f.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-01-25 18:48:34 -07:00
Philip Prindeville
be52f902d8 Revert "perlmod: redux handling odd Makefile.PL eval value"
This reverts commit f03cd7b5ac.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-01-25 18:48:34 -07: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
Alexander Couzens
a73e96cb0c perl: remove build timestamp
Build timestamp prevents reproducible builds [0].

[0] https://reproducible-builds.org/docs/timestamps/

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2017-12-14 18:59:10 +01:00
Philip Prindeville
f03cd7b5ac perlmod: redux handling odd Makefile.PL eval value
It seems that Inline::C evaluates to undef which is problematic, so
we need to handle this better.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-11-07 16:13:02 -07:00
Philip Prindeville
a4aaaf8d8f perl: when Makefile.PL fails give more feedback
There are a few packages which mysteriously fail during the configure
stage.  Give us better means of understanding why.

Also, some Makefile.PL's have "use" statements which reference
files which are in or under ".".

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-10-27 18:22:13 -06:00
Philip Prindeville
c79911b66d perl: modules failing due to dot not in @INC
5.26.1 introduced default_inc_excludes_dot which is causing
perl-html-tags and possibly other modules to fail.  Add explict
dot back when invoking module's ./Makefile.PL.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-10-27 15:43:14 -06:00