From f5637fcf8d6538a0270ac6eb762860fdbff8a702 Mon Sep 17 00:00:00 2001 From: anolis-bot Date: Tue, 16 May 2023 16:36:25 +0800 Subject: [PATCH 1/2] update to perl-5.26.3-422.el8 Signed-off-by: anolis-bot --- 1001-Adapt-Configure-to-GCC-version.patch | 77 ------------------- dist | 1 + ...-definition-of-OPTIMIZE-to-.ph-files.patch | 39 ++++++++++ perl.spec | 20 +++-- 4 files changed, 49 insertions(+), 88 deletions(-) delete mode 100644 1001-Adapt-Configure-to-GCC-version.patch create mode 100644 dist create mode 100644 perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch diff --git a/1001-Adapt-Configure-to-GCC-version.patch b/1001-Adapt-Configure-to-GCC-version.patch deleted file mode 100644 index 14a1e99..0000000 --- a/1001-Adapt-Configure-to-GCC-version.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 3730c664d51f0533a128307c2aa807102f9faadc Mon Sep 17 00:00:00 2001 -From: songmingliang -Date: Tue, 19 Apr 2022 18:23:08 +0800 -Subject: [PATCH] Adapt Configure to GCC version 10 - ---- - Configure | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/Configure b/Configure -index 9aa5dcc..ee85821 100755 ---- a/Configure -+++ b/Configure -@@ -4674,7 +4674,7 @@ $cat >try.c </dev/null 2>&1 - then - # Interactive Systems (ISC) POSIX mode. -@@ -5484,7 +5484,7 @@ default|recommended) - ;; - esac - case "$gccversion" in -- 1*) ;; -+ 1.*) ;; - 2.[0-8]*) ;; - ?*) set strict-aliasing -fno-strict-aliasing - eval $checkccflag -@@ -5602,7 +5602,7 @@ case "$cppflags" in - ;; - esac - case "$gccversion" in --1*) cppflags="$cppflags -D__GNUC__" -+1.*) cppflags="$cppflags -D__GNUC__" - esac - case "$mips_type" in - '');; -@@ -23613,7 +23613,7 @@ fi - - : add -D_FORTIFY_SOURCE if feasible and not already there - case "$gccversion" in --[4567].*) case "$optimize$ccflags" in -+[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in - *-O*) case "$ccflags$cppsymbols" in - *_FORTIFY_SOURCE=*) # Don't add it again. - echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 --- -2.27.0 - diff --git a/dist b/dist new file mode 100644 index 0000000..9c0e36e --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8 diff --git a/perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch b/perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch new file mode 100644 index 0000000..083d8f9 --- /dev/null +++ b/perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch @@ -0,0 +1,39 @@ +From 6d9d949fb4962e32636aee48a948081d8936d318 Mon Sep 17 00:00:00 2001 +From: Jitka Plesnikova +Date: Wed, 11 Jan 2023 09:12:18 +0100 +Subject: [PATCH] Add definition of OPTIMIZE to .ph files + +The fortify.h header includes a test to ensure that -O is used when +compiling with _FORTIFY_SOURCE, and the header looks for OPTIMIZE, which +is set by the compiler whenever -O is used. Perl translates this test +to the .ph file, but nothing ever sets OPTIMIZE. This causes a warning +for anything that uses features.ph. + +_FORTIFY_SOURCE is defined in /usr/lib64/perl5/_h2ph_pre.ph which is +generated by h2ph. It uses value of @Config{'ccsymbols', 'cppsymbols', +'cppccsymbols'} which does not contain definition for OPTIMIZE. + +The patch updated h2ph to add OPTIMIZE if -O is used. +--- + utils/h2ph.PL | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/utils/h2ph.PL b/utils/h2ph.PL +index afa53c2..3950d11 100644 +--- a/utils/h2ph.PL ++++ b/utils/h2ph.PL +@@ -865,6 +865,11 @@ sub _extract_cc_defines + my $allsymbols = join " ", + @Config{'ccsymbols', 'cppsymbols', 'cppccsymbols'}; + ++ # If optimizing -O2 is used, add the definition ++ if ($Config{'ccflags'} =~ /(?:\s+|^)-O([\d]+)(?:\s+|$)/) { ++ $allsymbols .= " __OPTIMIZE__=$1"; ++ } ++ + # Split compiler pre-definitions into 'key=value' pairs: + while ($allsymbols =~ /([^\s]+)=((\\\s|[^\s])+)/g) { + $define{$1} = $2; +-- +2.39.0 + diff --git a/perl.spec b/perl.spec index 7322d1d..80ee1b2 100644 --- a/perl.spec +++ b/perl.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.1 %global perl_version 5.26.3 %global perl_epoch 4 %global perl_arch_stem -thread-multi @@ -82,7 +81,7 @@ License: GPL+ or Artistic Epoch: %{perl_epoch} Version: %{perl_version} # release number must be even higher, because dual-lived modules will be broken otherwise -Release: 421%{anolis_release}%{?dist} +Release: 422%{?dist} Summary: Practical Extraction and Report Language Url: http://www.perl.org/ Source0: http://www.cpan.org/src/5.0/perl-%{perl_version}.tar.bz2 @@ -322,14 +321,12 @@ Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li # Link XS modules to libperl.so with EU::MM on Linux, bug #960048 Patch201: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-MM-on-Linux.patch +# If optimizing -O is used, add the definition to .ph files, bug #2152012 +Patch202: perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch + # Update some of the bundled modules # see http://fedoraproject.org/wiki/Perl/perl.spec for instructions -# Begin: Anolis customized patches -# backport patch from upstream -Patch1001: 1001-Adapt-Configure-to-GCC-version.patch -# End: Anolis customized patches - BuildRequires: bash BuildRequires: bzip2-devel BuildRequires: coreutils @@ -2938,8 +2935,7 @@ Perl extension for Version Objects %patch97 -p1 %patch200 -p1 %patch201 -p1 - -%patch1001 -p1 +%patch202 -p1 %if !%{defined perl_bootstrap} # Local patch tracking @@ -3003,6 +2999,7 @@ perl -x patchlevel.h \ 'RHEL Patch97: Fix a memory leak when compiling a regular expression with a non-word class (GH#17218)' \ 'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \ 'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \ + 'Fedora Patch202: Add definition of OPTIMIZE to .ph files (bug #2152012)' \ %{nil} %endif @@ -5288,8 +5285,9 @@ popd # Old changelog entries are preserved in CVS. %changelog -* Tue Apr 19 2022 Weitao Zhou - 4:5.26.3-421.0.1 -- Adapt Configure to GCC version 10 +* Wed Jan 11 2023 Jitka Plesnikova - 4:5.26.3-422 +- Add definition of OPTIMIZE to .ph files, if optimizing is used + (bug#2152012) * Mon Oct 18 2021 Jitka Plesnikova - 4:5.26.3-421 - Fix a memory leak when compiling a regular expression with a non-word -- Gitee From bf1001780dbf9886792a38e9f41880b734cee1c5 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Tue, 19 Apr 2022 18:32:08 +0800 Subject: [PATCH 2/2] Adapt Configure to GCC version 10 --- 1001-Adapt-Configure-to-GCC-version.patch | 77 +++++++++++++++++++++++ perl.spec | 13 +++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 1001-Adapt-Configure-to-GCC-version.patch diff --git a/1001-Adapt-Configure-to-GCC-version.patch b/1001-Adapt-Configure-to-GCC-version.patch new file mode 100644 index 0000000..14a1e99 --- /dev/null +++ b/1001-Adapt-Configure-to-GCC-version.patch @@ -0,0 +1,77 @@ +From 3730c664d51f0533a128307c2aa807102f9faadc Mon Sep 17 00:00:00 2001 +From: songmingliang +Date: Tue, 19 Apr 2022 18:23:08 +0800 +Subject: [PATCH] Adapt Configure to GCC version 10 + +--- + Configure | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Configure b/Configure +index 9aa5dcc..ee85821 100755 +--- a/Configure ++++ b/Configure +@@ -4674,7 +4674,7 @@ $cat >try.c </dev/null 2>&1 + then + # Interactive Systems (ISC) POSIX mode. +@@ -5484,7 +5484,7 @@ default|recommended) + ;; + esac + case "$gccversion" in +- 1*) ;; ++ 1.*) ;; + 2.[0-8]*) ;; + ?*) set strict-aliasing -fno-strict-aliasing + eval $checkccflag +@@ -5602,7 +5602,7 @@ case "$cppflags" in + ;; + esac + case "$gccversion" in +-1*) cppflags="$cppflags -D__GNUC__" ++1.*) cppflags="$cppflags -D__GNUC__" + esac + case "$mips_type" in + '');; +@@ -23613,7 +23613,7 @@ fi + + : add -D_FORTIFY_SOURCE if feasible and not already there + case "$gccversion" in +-[4567].*) case "$optimize$ccflags" in ++[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in + *-O*) case "$ccflags$cppsymbols" in + *_FORTIFY_SOURCE=*) # Don't add it again. + echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 +-- +2.27.0 + diff --git a/perl.spec b/perl.spec index 80ee1b2..772ffa0 100644 --- a/perl.spec +++ b/perl.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %global perl_version 5.26.3 %global perl_epoch 4 %global perl_arch_stem -thread-multi @@ -81,7 +82,7 @@ License: GPL+ or Artistic Epoch: %{perl_epoch} Version: %{perl_version} # release number must be even higher, because dual-lived modules will be broken otherwise -Release: 422%{?dist} +Release: 422%{anolis_release}%{?dist} Summary: Practical Extraction and Report Language Url: http://www.perl.org/ Source0: http://www.cpan.org/src/5.0/perl-%{perl_version}.tar.bz2 @@ -327,6 +328,11 @@ Patch202: perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch # Update some of the bundled modules # see http://fedoraproject.org/wiki/Perl/perl.spec for instructions +# Begin: Anolis customized patches +# backport patch from upstream +Patch1001: 1001-Adapt-Configure-to-GCC-version.patch +# End: Anolis customized patches + BuildRequires: bash BuildRequires: bzip2-devel BuildRequires: coreutils @@ -2937,6 +2943,8 @@ Perl extension for Version Objects %patch201 -p1 %patch202 -p1 +%patch1001 -p1 + %if !%{defined perl_bootstrap} # Local patch tracking perl -x patchlevel.h \ @@ -5285,6 +5293,9 @@ popd # Old changelog entries are preserved in CVS. %changelog +* Wed May 24 2023 Weitao Zhou - 4:5.26.3-422.0.1 +- Adapt Configure to GCC version 10 + * Wed Jan 11 2023 Jitka Plesnikova - 4:5.26.3-422 - Add definition of OPTIMIZE to .ph files, if optimizing is used (bug#2152012) -- Gitee