From acddabbd47565a4e36210117eb8a3c11656907ea Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 28 Nov 2023 14:44:16 +0100 Subject: [PATCH] Backport upstream patch to fix C99 compatibility issue Related to: --- perl-IO-Tty-c99.patch | 48 +++++++++++++++++++++++++++++++++++++++++++ perl-IO-Tty.spec | 8 ++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 perl-IO-Tty-c99.patch diff --git a/perl-IO-Tty-c99.patch b/perl-IO-Tty-c99.patch new file mode 100644 index 0000000..99b9fda --- /dev/null +++ b/perl-IO-Tty-c99.patch @@ -0,0 +1,48 @@ +commit 1735a78561dbe139fd138caef2d44d81f5494fe7 +Author: Khem Raj +Date: Tue Apr 4 12:28:11 2023 -0700 + + Make function checks more robust within shared libs + + Previous attempt to error at link like was with + + https://github.com/toddr/IO-Tty/commit/1747cdf9f98cfd3aada9bf6c09f9d46297e18a5e + + this however causes issues with newer clang where it detects + the assignment as -Wint-conversion warning which is treated at error + and builds with clang fail. So this is an attempt to instruct + linker explicitly to error out if the symbol is not found during link + time when building a shared library, this fixes both the problems + as reported in + + https://github.com/toddr/IO-Tty/issues/23 + + as well as + + https://github.com/toddr/IO-Tty/pull/33#issuecomment-1260147256 + + Signed-off-by: Khem Raj + +diff --git a/Makefile.PL b/Makefile.PL +index 6b1b6fab1a57f457..2efb6f9bb54d7ff8 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -163,7 +163,8 @@ main () + #if defined (__stub_$f) || defined (__stub___$f) + choke me + #else +-f = $f (); ++f = $f; ++f(); + #endif + + ; +@@ -173,7 +174,7 @@ ESQ + + close(TST); + print "Looking for $f()" . "." x (13-length($f)) . " "; +- if (system("$cfg{'cc'} $flags $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) { ++ if (system("$cfg{'cc'} $flags -Wl,--no-undefined $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) { + print "not found.\n"; + } else { + $define{"-DHAVE_\U$f"} = undef; diff --git a/perl-IO-Tty.spec b/perl-IO-Tty.spec index 80ac072..90567d8 100644 --- a/perl-IO-Tty.spec +++ b/perl-IO-Tty.spec @@ -1,10 +1,11 @@ Name: perl-IO-Tty Version: 1.17 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Perl interface to pseudo tty's License: (GPL-1.0-or-later OR Artistic-1.0-Perl) AND BSD-2-Clause URL: https://metacpan.org/release/IO-Tty Source0: https://cpan.metacpan.org/modules/by-module/IO/IO-Tty-%{version}.tar.gz +Patch0: perl-IO-Tty-c99.patch # Module Build BuildRequires: coreutils BuildRequires: findutils @@ -37,7 +38,7 @@ BuildRequires: perl(Test::More) IO::Tty and IO::Pty provide an interface to pseudo tty's. %prep -%setup -q -n IO-Tty-%{version} +%autosetup -p1 -n IO-Tty-%{version} %build perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -60,6 +61,9 @@ make test %{_mandir}/man3/IO::Tty::Constant.3* %changelog +* Tue Nov 28 2023 Florian Weimer - 1.17-5 +- Backport upstream patch to fix C99 compatibility issue + * Thu Jul 20 2023 Fedora Release Engineering - 1.17-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild