Compare commits

..

2 Commits

Author SHA1 Message Date
openeuler-ci-bot
24ccc1de55
!94 [sync] PR-89: delete unused files and provides
From: @openeuler-sync-bot 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
2023-08-29 01:35:20 +00:00
yangmingtai
c288aac50f delete unused files and provides
(cherry picked from commit 6e5a2254ee)
2023-08-25 17:02:46 +08:00
12 changed files with 11 additions and 719 deletions

1
.gitattributes vendored
View File

@ -1 +0,0 @@
*.xz filter=lfs diff=lfs merge=lfs -text

View File

@ -1,2 +0,0 @@
[lfs]
url = https://artlfs.openeuler.openatom.cn/src-openEuler/perl

View File

@ -1,42 +0,0 @@
README for perl-macros
Author: Christian Wittmer <chris@computersalat.de>
%perl_gen_filelist generates an rpmlint happy filelist of your installed files
In most cases you only need to check the %doc part
sometimes there is a "Changes" or "ChangeLog",....
Requirements for %perl_gen_filelist
You have to define following parts inside your spec file
Example:
BuildRequires: perl-macros
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root)
%doc Changes README
And here an Example of the generated filelist:
%dir /usr/lib/perl5/vendor_perl/5.8.8/Algorithm
/usr/lib/perl5/vendor_perl/5.8.8/Algorithm/DiffOld.pm
/usr/lib/perl5/vendor_perl/5.8.8/Algorithm/diff.pl
/usr/lib/perl5/vendor_perl/5.8.8/Algorithm/Diff.pm
/usr/lib/perl5/vendor_perl/5.8.8/Algorithm/diffnew.pl
/usr/lib/perl5/vendor_perl/5.8.8/Algorithm/cdiff.pl
/usr/lib/perl5/vendor_perl/5.8.8/Algorithm/htmldiff.pl
%dir /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/Algorithm
%dir /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/Algorithm/Diff
/usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/Algorithm/Diff/.packlist
/usr/share/man/man?/*
/var/adm/perl-modules/perl-Algorithm-Diff

View File

@ -1,196 +0,0 @@
From 906e92715f4ee68ea95086867f4f97b1f4f10ac3 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 3 Oct 2023 09:40:07 +1100
Subject: [PATCH] win32: default the shell to cmd.exe in the Windows system
directory
This prevents picking up cmd.exe from the current directory, or
even from the PATH.
This protects against a privilege escalation attack where an attacker
in a separate session creates a cmd.exe in a directory where the
target account happens to have its current directory.
---
t/win32/system.t | 30 ++++++++++++--------
win32/win32.c | 71 +++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 79 insertions(+), 22 deletions(-)
diff --git a/t/win32/system.t b/t/win32/system.t
index 939a02db55..c885059012 100644
--- a/t/win32/system.t
+++ b/t/win32/system.t
@@ -82,6 +82,7 @@ close $F;
chdir($testdir);
END {
chdir($cwd) && rmtree("$cwd/$testdir") if -d "$cwd/$testdir";
+ unlink "cmd.exe";
}
if (open(my $EIN, "$cwd/win32/${exename}_exe.uu")) {
note "Unpacking $exename.exe";
@@ -104,21 +105,20 @@ else {
}
note "Compiling $exename.c";
note "$Config{cc} $Config{ccflags} $exename.c";
- if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") != 0) {
+ if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") != 0 ||
+ !-f "$exename.exe") {
note "Could not compile $exename.c, status $?";
- note "Where is your C compiler?";
- skip_all "can't build test executable";
- }
- unless (-f "$exename.exe") {
- if (open(LOG,'<log'))
- {
- while(<LOG>) {
- note $_;
- }
- }
+ note "Where is your C compiler?";
+ if (open(LOG,'<log'))
+ {
+ while(<LOG>) {
+ note $_;
+ }
+ }
else {
- warn "Cannot open log (in $testdir):$!";
+ warn "Cannot open log (in $testdir):$!";
}
+ skip_all "can't build test executable";
}
}
copy("$plxname.bat","$plxname.cmd");
@@ -128,6 +128,12 @@ unless (-x "$testdir/$exename.exe") {
skip_all "can't build test executable";
}
+# test we only look for cmd.exe in the standard place
+delete $ENV{PERLSHELL};
+copy("$testdir/$exename.exe", "$testdir/cmd.exe") or die $!;
+copy("$testdir/$exename.exe", "cmd.exe") or die $!;
+$ENV{PATH} = qq("$testdir";$ENV{PATH});
+
open my $T, "$^X -I../lib -w win32/system_tests |"
or die "Can't spawn win32/system_tests: $!";
my $expect;
diff --git a/win32/win32.c b/win32/win32.c
index 94248ca168..5d54cf8d4a 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -117,7 +117,7 @@ static char* win32_get_xlib(const char *pl,
static BOOL has_shell_metachars(const char *ptr);
static long tokenize(const char *str, char **dest, char ***destv);
-static void get_shell(void);
+static int get_shell(void);
static char* find_next_space(const char *s);
static int do_spawn2(pTHX_ const char *cmd, int exectype);
static int do_spawn2_handles(pTHX_ const char *cmd, int exectype,
@@ -600,7 +600,13 @@ tokenize(const char *str, char **dest, char ***destv)
return items;
}
-static void
+static const char
+cmd_opts[] = "/x/d/c";
+
+static const char
+shell_cmd[] = "cmd.exe";
+
+static int
get_shell(void)
{
dTHX;
@@ -612,12 +618,53 @@ get_shell(void)
* interactive use (which is what most programs look in COMSPEC
* for).
*/
- const char* defaultshell = "cmd.exe /x/d/c";
- const char *usershell = PerlEnv_getenv("PERL5SHELL");
- w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
- &w32_perlshell_tokens,
- &w32_perlshell_vec);
+ const char *shell = PerlEnv_getenv("PERL5SHELL");
+ if (shell) {
+ w32_perlshell_items = tokenize(shell,
+ &w32_perlshell_tokens,
+ &w32_perlshell_vec);
+ }
+ else {
+ /* tokenize does some Unix-ish like things like
+ \\ escaping that don't work well here
+ */
+ char shellbuf[MAX_PATH];
+ UINT len = GetSystemDirectoryA(shellbuf, sizeof(shellbuf));
+ if (len == 0) {
+ translate_to_errno();
+ return -1;
+ }
+ else if (len >= MAX_PATH) {
+ /* buffer too small */
+ errno = E2BIG;
+ return -1;
+ }
+ if (shellbuf[len-1] != '\\') {
+ my_strlcat(shellbuf, "\\", sizeof(shellbuf));
+ ++len;
+ }
+ if (len + sizeof(shell_cmd) > sizeof(shellbuf)) {
+ errno = E2BIG;
+ return -1;
+ }
+ my_strlcat(shellbuf, shell_cmd, sizeof(shellbuf));
+ len += sizeof(shell_cmd)-1;
+
+ Newx(w32_perlshell_vec, 3, char *);
+ Newx(w32_perlshell_tokens, len + 1 + sizeof(cmd_opts), char);
+
+ my_strlcpy(w32_perlshell_tokens, shellbuf, len+1);
+ my_strlcpy(w32_perlshell_tokens + len +1, cmd_opts,
+ sizeof(cmd_opts));
+
+ w32_perlshell_vec[0] = w32_perlshell_tokens;
+ w32_perlshell_vec[1] = w32_perlshell_tokens + len + 1;
+ w32_perlshell_vec[2] = NULL;
+
+ w32_perlshell_items = 2;
+ }
}
+ return 0;
}
int
@@ -635,7 +682,9 @@ Perl_do_aspawn(pTHX_ SV *really, SV **mark, SV **sp)
if (sp <= mark)
return -1;
- get_shell();
+ if (get_shell() < 0)
+ return -1;
+
Newx(argv, (sp - mark) + w32_perlshell_items + 2, const char*);
if (SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
@@ -765,7 +814,8 @@ do_spawn2_handles(pTHX_ const char *cmd, int exectype, const int *handles)
if (needToTry) {
char **argv;
int i = -1;
- get_shell();
+ if (get_shell() < 0)
+ return -1;
Newx(argv, w32_perlshell_items + 2, char*);
while (++i < w32_perlshell_items)
argv[i] = w32_perlshell_vec[i];
@@ -3482,7 +3532,8 @@ win32_pipe(int *pfd, unsigned int size, int mode)
DllExport PerlIO*
win32_popenlist(const char *mode, IV narg, SV **args)
{
- get_shell();
+ if (get_shell() < 0)
+ return NULL;
return do_popen(mode, NULL, narg, args);
}
--
2.33.0

View File

@ -1,123 +0,0 @@
From 92a9eb3d0d52ec7655c1beb29999a5a5219be664 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sat, 9 Sep 2023 11:59:09 -0600
Subject: [PATCH] Fix read/write past buffer end: perl-security#140
A package name may be specified in a \p{...} regular expression
construct. If unspecified, "utf8::" is assumed, which is the package
all official Unicode properties are in. By specifying a different
package, one can create a user-defined property with the same
unqualified name as a Unicode one. Such a property is defined by a sub
whose name begins with "Is" or "In", and if the sub wishes to refer to
an official Unicode property, it must explicitly specify the "utf8::".
S_parse_uniprop_string() is used to parse the interior of both \p{} and
the user-defined sub lines.
In S_parse_uniprop_string(), it parses the input "name" parameter,
creating a modified copy, "lookup_name", malloc'ed with the same size as
"name". The modifications are essentially to create a canonicalized
version of the input, with such things as extraneous white-space
stripped off. I found it convenient to strip off the package specifier
"utf8::". To to so, the code simply pretends "lookup_name" begins just
after the "utf8::", and adjusts various other values to compensate.
However, it missed the adjustment of one required one.
This is only a problem when the property name begins with "perl" and
isn't "perlspace" nor "perlword". All such ones are undocumented
internal properties.
What happens in this case is that the input is reparsed with slightly
different rules in effect as to what is legal versus illegal. The
problem is that "lookup_name" no longer is pointing to its initial
value, but "name" is. Thus the space allocated for filling "lookup_name"
is now shorter than "name", and as this shortened "lookup_name" is
filled by copying suitable portions of "name", the write can be to
unallocated space.
The solution is to skip the "utf8::" when reparsing "name". Then both
"lookup_name" and "name" are effectively shortened by the same amount,
and there is no going off the end.
This commit also does white-space adjustment so that things align
vertically for readability.
This can be easily backported to earlier Perl releases.
Reference:https://github.com/Perl/perl5/commit/92a9eb3d0d52ec7655c1beb29999a5a5219be664
Conflict:NA
---
regcomp.c | 17 +++++++++++------
t/re/pat_advanced.t | 8 ++++++++
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/regcomp.c b/regcomp.c
index d3c135f..67aa03e 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -14450,7 +14450,7 @@ S_parse_uniprop_string(pTHX_
* compile perl to know about them) */
bool is_nv_type = FALSE;
- unsigned int i, j = 0;
+ unsigned int i = 0, i_zero = 0, j = 0;
int equals_pos = -1; /* Where the '=' is found, or negative if none */
int slash_pos = -1; /* Where the '/' is found, or negative if none */
int table_index = 0; /* The entry number for this property in the table
@@ -14582,9 +14582,13 @@ S_parse_uniprop_string(pTHX_
* all of them are considered to be for that package. For the purposes of
* parsing the rest of the property, strip it off */
if (non_pkg_begin == STRLENs("utf8::") && memBEGINPs(name, name_len, "utf8::")) {
- lookup_name += STRLENs("utf8::");
- j -= STRLENs("utf8::");
- equals_pos -= STRLENs("utf8::");
+ lookup_name += STRLENs("utf8::");
+ j -= STRLENs("utf8::");
+ equals_pos -= STRLENs("utf8::");
+ i_zero = STRLENs("utf8::"); /* When resetting 'i' to reparse
+ from the beginning, it has to be
+ set past what we're stripping
+ off */
stripped_utf8_pkg = TRUE;
}
@@ -14998,7 +15002,8 @@ S_parse_uniprop_string(pTHX_
/* We set the inputs back to 0 and the code below will reparse,
* using strict */
- i = j = 0;
+ i = i_zero;
+ j = 0;
}
}
@@ -15019,7 +15024,7 @@ S_parse_uniprop_string(pTHX_
* separates two digits */
if (cur == '_') {
if ( stricter
- && ( i == 0 || (int) i == equals_pos || i == name_len- 1
+ && ( i == i_zero || (int) i == equals_pos || i == name_len- 1
|| ! isDIGIT_A(name[i-1]) || ! isDIGIT_A(name[i+1])))
{
lookup_name[j++] = '_';
diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
index d64bd1b..e0266c0 100644
--- a/t/re/pat_advanced.t
+++ b/t/re/pat_advanced.t
@@ -2695,6 +2695,14 @@ EOF_DEBUG_OUT
"Related to Github Issue #19350, forward \\g{x} pattern segv under use re Debug => 'PARSE'");
}
+ { # perl-security#140, read/write past buffer end
+ fresh_perl_like('qr/\p{utf8::perl x}/',
+ qr/Illegal user-defined property name "utf8::perl x" in regex/,
+ {}, "perl-security#140");
+ fresh_perl_is('qr/\p{utf8::_perl_surrogate}/', "",
+ {}, "perl-security#140");
+ }
+
{ # GH 20009
my $x = "awesome quotes";
utf8::upgrade($x);
--
2.33.0

View File

@ -1,45 +0,0 @@
From 55a0aab68d5ce90ce8bb7442ba61639c49e50c1d Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Mon, 21 Sep 2020 09:45:33 +0800
Subject: [PATCH] aarch64 ilp32 support
Conflict:NA
Reference:https://build.opensuse.org/package/view_file/devel:ARM:Factory:Contrib:ILP32/perl/aarch64-ilp32.patch?expand=1
---
hints/linux.sh | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hints/linux.sh b/hints/linux.sh
index c749f0f..27322dc 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -311,6 +311,25 @@ sparc*)
;;
esac
+case $archname in
+aarch64-linux)
+ cat >try.c <<'EOM'
+/* Test for ILP32 */
+#include <stdlib.h>
+main() {
+ int ilp32 = 0;
+ #ifdef __ILP32__
+ ilp32 = 1;
+ #endif
+ exit(!ilp32);
+}
+EOM
+ if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
+ archname=aarch64-ilp32-linux
+ fi
+ ;;
+esac
+
# SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than
# true libraries. The scripts cause binding against static
# version of -lgdbm which is a bad idea. So if we have 'nm'
--
2.27.0

View File

@ -1,136 +0,0 @@
# macros.perl file
# macros for perl module building. handle with care.
# Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
#
%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
%perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
# More useful perl macros (from Raul Dias <rsd@swi.com.br>)
#
%perl_version %(perl -V:version | sed "s!.*='!!;s!'.*!!")
%perl_man1ext %(perl -V:man1ext | sed "s!.*='!!;s!'.*!!")
%perl_man3ext %(perl -V:man3ext | sed "s!.*='!!;s!'.*!!")
%perl_man1dir %(perl -V:man1dir | sed "s!.*='!!;s!'.*!!")
%perl_man3dir %(perl -V:man3dir | sed "s!.*='!!;s!'.*!!")
%perl_installman1dir %(perl -V:installman1dir | sed "s!.*='!!;s!'.*!!")
%perl_installman3dir %(perl -V:installman3dir | sed "s!.*='!!;s!'.*!!")
%perl_installarchlib %(perl -V:installarchlib | sed "s!.*='!!;s!'.*!!")
%perl_prefix %{buildroot}
# Macro to encapsulate perl requires (empty for fedora)
# we keep the complicated form even here to easy sync the other macros with
# perl-macros package
#
%perl_requires() \
%if 0%{?suse_version} > 0 \
Requires: perl(:MODULE_COMPAT_%{perl_version}) \
%endif
%libperl_requires() \
%if 0%{?suse_version} > 0 \
Requires: perl = %{perl_version} \
%endif
# suse specific macros
#
%perl_make_install make DESTDIR=$RPM_BUILD_ROOT install_vendor
%perl_process_packlist(n:) \
if test -n "$RPM_BUILD_ROOT" -a -d $RPM_BUILD_ROOT%perl_vendorarch/auto; then \
find $RPM_BUILD_ROOT%perl_vendorarch/auto -name .packlist -print0 | xargs -0 -r rm \
if [ %{_target_cpu} == noarch ]; then \
find $RPM_BUILD_ROOT%perl_vendorarch/auto -depth -type d -print0 | xargs -0 -r rmdir \
fi \
fi \
rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod \
%nil
# macro: perl_gen_filelist (from Christian <chris@computersalat.de>)
# do the rpmlint happy filelist generation
# with %dir in front of directories
#
%perl_gen_filelist(n)\
FILES=%{name}.files\
# fgen_dir func\
# IN: dir\
fgen_dir(){\
%{__cat} >> $FILES << EOF\
%dir ${1}\
EOF\
}\
# fgen_file func\
# IN: file\
fgen_file(){\
%{__cat} >> $FILES << EOF\
${1}\
EOF\
}\
# check for files in %{perl_vendorlib}\
RES=`find ${RPM_BUILD_ROOT}%{perl_vendorlib} -maxdepth 1 -type f`\
if [ -n "$RES" ]; then\
for file in $RES; do\
fgen_file "%{perl_vendorlib}/$(basename ${file})"\
done\
fi\
\
# get all dirs into array\
base_dir="${RPM_BUILD_ROOT}%{perl_vendorlib}/"\
for dir in `find ${base_dir} -type d | sort`; do\
if [ "$dir" = "${base_dir}" ]; then\
continue\
else\
el=${dir#$base_dir}\
all_dir=(${all_dir[@]} $el)\
fi\
done\
\
# build filelist\
for i in ${all_dir[@]}; do\
# do not add "dir {perl_vendorlib/arch}/auto", included in perl package\
if [ "${i}" = "auto" ]; then\
continue\
fi\
if [ "%{perl_vendorlib}/${i}" = "%{perl_vendorarch}/auto" ]; then\
continue\
else\
if [ -d ${base_dir}/${i} ]; then\
if [ "%{perl_vendorlib}/${i}" != "%{perl_vendorarch}" ]; then\
fgen_dir "%{perl_vendorlib}/${i}"\
fi\
RES=`find "${base_dir}/${i}" -maxdepth 1 -type f`\
for file in $RES; do\
fgen_file "%{perl_vendorlib}/${i}/$(basename ${file})"\
done\
fi\
fi\
done\
# add man pages\
# if exist :)\
if [ -d "${RPM_BUILD_ROOT}%{_mandir}" ]; then\
for file in `cd "${RPM_BUILD_ROOT}%{_mandir}" && find . -type f -name "*3pm*"`; do \
if test -e "%{_mandir}/$file" -o -e "%{_mandir}/$file.gz"; then \
mv ${RPM_BUILD_ROOT}%{_mandir}/$file ${RPM_BUILD_ROOT}%{_mandir}/${file/3pm/3pmc} \
fi \
done \
fgen_file "%{_mandir}/man?/*"\
fi\
\
# add packlist file\
# generated fom perllocal.pod\
if [ -f "${RPM_BUILD_ROOT}/var/adm/perl-modules/%{name}" ]; then\
fgen_file "/var/adm/perl-modules/%{name}"\
fi\
\
# check for files in %{_bindir}\
if [ -d ${RPM_BUILD_ROOT}%{_bindir} ]; then\
RES=`find "${RPM_BUILD_ROOT}%{_bindir}" -maxdepth 1 -type f`\
if [ -n "$RES" ]; then\
for file in $RES; do\
fgen_file "%{_bindir}/$(basename ${file})"\
done\
fi\
fi

View File

@ -1,66 +0,0 @@
From 5051aebec66aa530a23c7842f5c77606f208134e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jani=20V=C3=A4limaa?= <wally@mageia.org>
Date: Sat, 18 Jan 2025 15:25:52 +0200
Subject: [PATCH] Link XS modules to libperl.so with EU::CBuilder on Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Based on patch from Petr Písař <ppisar@redhat.com>
Patch is modified to use extra_linker_flags to pass -lperl after object .o files.
In that way -Wl,--as-needed linker flag doesn't strip libperl dependecy.
<https://bugzilla.redhat.com/show_bug.cgi?id=960048>
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327585#50>
---
MANIFEST | 1 +
.../lib/ExtUtils/CBuilder/Platform/linux.pm | 24 +++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
diff --git a/MANIFEST b/MANIFEST
index 2eb9ca4..31bac12 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4104,6 +4104,7 @@ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm CBuilder method
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm CBuilder methods for OSF
+dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm CBuilder methods for Linux
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm CBuilder methods for OS/2
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm CBuilder methods for Unix
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm CBuilder methods for VMS
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
new file mode 100644
index 0000000..060515a
--- /dev/null
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
@@ -0,0 +1,24 @@
+package ExtUtils::CBuilder::Platform::linux;
+
+use strict;
+use ExtUtils::CBuilder::Platform::Unix;
+use File::Spec;
+
+use vars qw($VERSION @ISA);
+$VERSION = '0.280206';
+@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
+
+sub link {
+ my ($self, %args) = @_;
+
+ # Link XS modules to libperl.so explicitly because multiple
+ # dlopen(, RTLD_LOCAL) hides libperl symbols from XS module.
+ $args{extra_linker_flags} = [
+ '-lperl',
+ $self->split_like_shell($args{extra_linker_flags})
+ ];
+
+ return $self->SUPER::link(%args);
+}
+
+1;
--
2.47.1

View File

@ -1,52 +0,0 @@
From fc1f8ac36c34c35bad84fb7b99a26ab83c9ba075 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 3 Jul 2013 12:59:09 +0200
Subject: [PATCH] Link XS modules to libperl.so with EU::MM on Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
<https://bugzilla.redhat.com/show_bug.cgi?id=960048>
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327585#50>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
index a8b172f..a3fbce2 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
@@ -30,6 +30,7 @@ BEGIN {
$Is{IRIX} = $^O eq 'irix';
$Is{NetBSD} = $^O eq 'netbsd';
$Is{Interix} = $^O eq 'interix';
+ $Is{Linux} = $^O eq 'linux';
$Is{SunOS4} = $^O eq 'sunos';
$Is{Solaris} = $^O eq 'solaris';
$Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
@@ -1028,7 +1029,7 @@ sub xs_make_dynamic_lib {
push(@m," \$(RM_F) \$\@\n");
my $libs = '$(LDLOADLIBS)';
- if (($Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
+ if (($Is{Linux} || $Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
# Use nothing on static perl platforms, and to the flags needed
# to link against the shared libperl library on shared perl
# platforms. We peek at lddlflags to see if we need -Wl,-R
@@ -1041,6 +1042,11 @@ sub xs_make_dynamic_lib {
# The Android linker will not recognize symbols from
# libperl unless the module explicitly depends on it.
$libs .= ' "-L$(PERL_INC)" -lperl';
+ } else {
+ if ($ENV{PERL_CORE}) {
+ $libs .= ' "-L$(PERL_INC)"';
+ }
+ $libs .= ' -lperl';
}
}
--
1.8.1.4

Binary file not shown.

View File

@ -1,3 +1,4 @@
%global perl_libdir %{_libdir}/perl5
%global perl_datadir %{_datadir}/perl5
%global perl_vendor_libdir %{perl_libdir}/vendor_perl
%global perl_vendor_datadir %{perl_datadir}/vendor_perl
@ -10,8 +11,6 @@
%global __provides_exclude_from ^%{_libexecdir}/perl5-tests/.*$
%global __requires_exclude_from ^%{_libexecdir}/perl5-tests/.*$
%global __brp_clean_perl_files %{nil}
#provides module without verion, no need to provide
%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\((charnames|DynaLoader|DB)\\)$
@ -22,16 +21,13 @@
%bcond_without systemtap
Name: perl
License: (GPL-1.0-or-later or Artistic-1.0-perl) and (GPL-2.0-or-later or Artistic-1.0-perl) and MIT and UCD and Public Domain and BSD
License: (GPL+ or Artistic) and (GPLv2+ or Artistic) and MIT and UCD and Public Domain and BSD
Epoch: 4
Version: %{perl_version}
Release: 10
Release: 2
Summary: A highly capable, feature-rich programming language
Url: https://www.perl.org/
Source0: https://www.cpan.org/src/5.0/%{name}-%{version}.tar.xz
# adding files for perl-macros virtual package
Source1: macros.perl
Source2: README.macros
Patch1: perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
Patch2: perl-5.16.3-create_libperl_soname.patch
@ -39,14 +35,6 @@ Patch3: perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch
Patch4: perl-5.34.0-Destroy-GDBM-NDBM-ODBM-SDBM-_File-objects-only-from-.patch
Patch5: change-lib-to-lib64.patch
Patch6: disable-rpath-by-default.patch
Patch7: backport-CVE-2023-47100-CVE-2023-47038.patch
Patch8: backport-CVE-2023-47039.patch
Patch9: perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM.patch
# Please note that Patch10 comes from mageia, which will put libperl.so into extra_linker_flags.
# So it is different from redhat/fedora, which puts libperl.so into lddlflags
Patch10: perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
Patch6000: backport-aarch64-ilp32-support.patch
BuildRequires: gcc bash findutils coreutils make tar procps bzip2-devel gdbm-devel perl-File-Compare perl-File-Find
BuildRequires: zlib-devel perl-interpreter perl-generators
@ -78,12 +66,11 @@ Provides: perl-Attribute-Handlers perl-interpreter perl(bytes_heavy.pl) pe
Provides: perl-ExtUtils-Embed perl-ExtUtils-Miniperl perl-IO perl-IO-Zlib perl-Locale-Maketext-Simple perl-Math-Complex
Provides: perl-Module-Loaded perl-Net-Ping perl-Pod-Html perl-SelfLoader perl-Test perl-Time-Piece perl-libnetcfg perl-open perl-utils
Provides: perl-Errno perl-Memoize perl-File-Compare perl-File-Find
Provides: perl-macros = 2.0
Obsoletes: perl-Attribute-Handlers perl-interpreter perl-Errno perl-ExtUtils-Embed perl-Net-Ping
Obsoletes: perl-ExtUtils-Miniperl perl-IO perl-IO-Zlib perl-Locale-Maketext-Simple perl-Math-Complex perl-Memoize perl-Module-Loaded
Obsoletes: perl-Pod-Html perl-SelfLoader perl-Test perl-Time-Piece perl-libnetcfg perl-open perl-utils perl-File-Compare perl-File-Find
Obsoletes: perl-macros < 2.0
%description
Perl 5 is a highly capable, feature-rich programming language with over 30 years of development.
@ -92,7 +79,7 @@ prototyping and large scale development projects.
%package libs
Summary: The libraries for the perl
License: (GPL-1.0-or-later or Artistic-1.0-perl) and MIT and UCD
License: (GPL+ or Artistic) and HSRL and MIT and UCD
Provides: %perl_compat
Provides: perl(:VERSION) = %{perl_version}
Provides: perl(:WITH_64BIT) perl(:WITH_ITHREADS) perl(:WITH_THREADS)
@ -105,7 +92,7 @@ This package is the shared library for perl.
%package devel
Summary: Development files for %{name}
License: (GPL-1.0-or-later or Artistic-1.0-perl) and UCD
License: (GPL+ or Artistic) and UCD
Requires: perl = %{epoch}:%{version}-%{release} system-rpm-config
%if %{with systemtap}
@ -216,9 +203,6 @@ done
%{perl_new} -MConfig -i -pn \
-e 's"\A#!(?:perl|\./perl|/perl|/usr/bin/perl|/usr/bin/env perl)\b"$Config{startperl}"' \
$(find %{buildroot}%{_libexecdir}/perl5-tests/perl-tests -type f)
# install macros.perl file
install -D -m 644 %{SOURCE2} %{build}%{_rpmconfigdir}/macros.d/macros.perl
# not sure how to install README.macros
%check
%{perl_new} -I/lib regen/lib_cleanup.pl
@ -431,7 +415,9 @@ make test_harness
%exclude %dir %{perl_vendor_datadir}
%dir %{perl_datadir}/File
%{perl_datadir}/File/Compare.pm
%{_mandir}/man3/File::Compare.3*
%{perl_datadir}/File/Find.pm
%{_mandir}/man3/File::Find.3*
%license Artistic Copying
%doc AUTHORS
@ -441,9 +427,6 @@ make test_harness
%dir %{perl_datadir}
%{perl_datadir}/*
# macros
%{_rpmconfigdir}/macros.d/macros.perl
%files libs
%license Artistic Copying
%doc AUTHORS README Changes
@ -508,39 +491,11 @@ make test_harness
%exclude %{_mandir}/man3/{Time::HiRes.*,Time::Local.*,Socket.3*,threads.3*,threads::shared*,Unicode::Collate.*}
%exclude %{_mandir}/man3/{Unicode::Collate::*,Unicode::Normalize.*,version.3*,version::Internals.3*,Devel::PPPort*}
%doc README Changes
%doc README Changes
%{_mandir}/man1/*
%{_mandir}/man3/*
%changelog
* Fri Jan 03 2025 Funda Wang <fundawang@yeah.net> - 4:5.38.0-10
- split out patch adding link to libperl.so into two separated patches,
and sync it with mageia, which is a better version than fedora
- disable cleaning empty perl directories
- use git lfs storage
* Tue Sep 3 2024 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0-9
- Delete the man of File::Compare and File::Find from the main package.
* Wed Aug 14 2024 gengqihu <gengqihu2@h-partners.com> - 4:5.38.0-8
- License info rectification
* Wed Jul 31 2024 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0-7
- sync patch from upstream
backport-aarch64-ilp32-support.patch
* Wed Mar 20 2024 zhangzikang <zhangzikang@kylinos.cn> - 4:5.38.0-6
- Fix perl re.so undefined symbol error
* Mon Dec 11 2023 huyubiao <huyubiao@huawei.com> - 4:5.38.0.5
- Fix CVE-2023-47100
* Fri Dec 8 2023 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0.4
- Fix CVE-2023-48039
* Mon Nov 27 2023 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0.3
- Fix CVE-2023-47038
* Fri Aug 25 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.38.0-2
- delete unused files and provides
@ -556,7 +511,7 @@ make test_harness
* Mon May 15 2023 dongyuzhen <dongyuzhen@h-partners.com> 4:5.34.0-5
- fix CVE-2023-31484
* Wed Jan 18 2023 yangmingtai <yangmingtai@huawei.com> 4:5.34.0-4
* Tue Jan 18 2023 <yangmingtai@huawei.com> 4:5.34.0-4
- fix compile failed caused by zlib update
* Fri Jul 01 2022 dongyuzhen <dongyuzhen@h-partners.com> 4:5.34.0-3

View File

@ -1,4 +1,4 @@
version_control: github
src_repo: Perl/perl5
tag_prefix: ^v
separator: .
seperator: .