[arch-commits] Commit in perl-file-rsyncp/trunk (PKGBUILD gcc12.patch)

Evangelos Foutras foutrelis at gemini.archlinux.org
Sun May 29 14:09:45 UTC 2022


    Date: Sunday, May 29, 2022 @ 14:09:44
  Author: foutrelis
Revision: 1214751

Fix build with GCC 12

Added:
  perl-file-rsyncp/trunk/gcc12.patch
Modified:
  perl-file-rsyncp/trunk/PKGBUILD

-------------+
 PKGBUILD    |   12 ++++++++++--
 gcc12.patch |   44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-05-29 12:56:28 UTC (rev 1214750)
+++ PKGBUILD	2022-05-29 14:09:44 UTC (rev 1214751)
@@ -10,9 +10,17 @@
 depends=('perl')
 options=('!emptydirs' '!makeflags')
 url='https://search.cpan.org/dist/File-RsyncP'
-source=("https://search.cpan.org/CPAN/authors/id/C/CB/CBARRATT/File-RsyncP-$pkgver.tar.gz")
-sha512sums=('b81d9ce63181605939e8aff87c9e56ab276899f019f44eb3f149e7ee0d44a94fcbee771381ebe6ca8281c2de0d57d9cbdbcb972ccb7406a0aefd920040603bb3')
+source=("https://search.cpan.org/CPAN/authors/id/C/CB/CBARRATT/File-RsyncP-$pkgver.tar.gz"
+        gcc12.patch)
+sha512sums=('b81d9ce63181605939e8aff87c9e56ab276899f019f44eb3f149e7ee0d44a94fcbee771381ebe6ca8281c2de0d57d9cbdbcb972ccb7406a0aefd920040603bb3'
+            'b85bce8160f48b6325aec25df71c8ca7b48bc182327e4b9089d5e8ba65de9117e6da2517cf3184f1a65f61e77c73b9457ea47fa6926814b78b3201163c54c375')
 
+prepare() {
+  cd File-RsyncP-$pkgver
+  # https://rt.cpan.org/Public/Bug/Display.html?id=141822
+  patch -Np1 -i ../gcc12.patch
+}
+
 build() {
   cd File-RsyncP-$pkgver
   USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor

Added: gcc12.patch
===================================================================
--- gcc12.patch	                        (rev 0)
+++ gcc12.patch	2022-05-29 14:09:44 UTC (rev 1214751)
@@ -0,0 +1,44 @@
+From 5fb151e46ce03c960ae05405c6f6360ccb7efa6f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Fri, 18 Mar 2022 12:28:26 +0100
+Subject: [PATCH] Fix configure check with optimizing and lto-enabled GCC 12
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+After upgrading GCC to version 12 on Linux (where strlcpy() does not exist)
+tests fail like this if CFLAGS="-O1 -flto=auto":
+
+    make[1]: Entering directory '/home/test/fedora/perl-File-RsyncP/File-RsyncP-0.76/FileList'
+    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- FileList.bs ../blib/arch/auto/File/RsyncP/FileList/FileList.bs 644
+    PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
+    t/exclude.t ... Can't load '/home/test/fedora/perl-File-RsyncP/File-RsyncP-0.76/FileList/../blib/arch/auto/File/RsyncP/FileList/FileList.so' for module File::RsyncP::FileList: /home/test/fedora/perl-File-RsyncP/File-RsyncP-0.76/FileList/../blib/arch/auto/File/RsyncP/FileList/FileList.so: undefined symbol: strlcpy at /usr/lib64/perl5/DynaLoader.pm line 193.
+
+The new compiler optimizes out a check for strlcpy() perform by
+FileList/configure script. This patch changes the check to actually depend on
+strlcpy() function address. That should prevent a compiler from optimizing it
+out.
+
+CPAN RT#141822
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ FileList/configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/FileList/configure b/FileList/configure
+index faeaf78..023b606 100755
+--- a/FileList/configure
++++ b/FileList/configure
+@@ -9330,7 +9330,7 @@ char (*f) () = $ac_func;
+ int
+ main ()
+ {
+-return f != $ac_func;
++return (int)f;
+   ;
+   return 0;
+ }
+-- 
+2.34.1
+



More information about the arch-commits mailing list