0.38 bump

This commit is contained in:
Petr Písař 2023-08-09 15:58:24 +02:00
parent b052e10401
commit fc069b61d0
5 changed files with 6 additions and 132 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@
/XS-Parse-Keyword-0.34.tar.gz
/XS-Parse-Keyword-0.36.tar.gz
/XS-Parse-Keyword-0.37.tar.gz
/XS-Parse-Keyword-0.38.tar.gz

View File

@ -1,78 +0,0 @@
From 2e2114556330296d7451b7dd11f9ead7d0b40b4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 26 Jul 2023 13:21:20 +0200
Subject: [PATCH] No special linker flags for checking for PL_infix_plugin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
$Config{libs} lists all discovered libraries for optional perl
extensions. If perl is built dynamically, there is no need to link an
executable to all the libraries. For this purpose there is
$Config{perllibs}.
Actually the extensions can be uninstalled when building
XS-Parse-Keyword and the check would fail like this:
Checking for PL_infix_plugin...
test-56-1.c: In function 'main':
test-56-1.c:6:29: warning: variable 'def' set but not used [-Wunused-but-set-variable]
6 | struct Perl_custom_infix def;
| ^~~
/usr/bin/ld: cannot find -lgdbm: No such file or directory
/usr/bin/ld: cannot find -ldb: No such file or directory
$Config{perllibs} should be used instead.
In reality both $Config{libs} and $Config{perllibs} are wrong because
they list libraries used for building perl. The only library needed for
building perl extensions is -lperl itself. Unfortunately %Config does
not make the distinction and does not provide any variable which would
contain only required flags (i.e. -lperl and additional libraries
necessary for a statically linked perl).
At the end, the Keyword.so is also not linked to all the libraries.
In the actual reallity, the check program does use any perl function
or variable, hence strictely speaking the program does not have to
link to libper.so at all and @linker_flags should be empty.
That's what this patch does.
It might breaks what upstream fixed in 0.24, but for dynamic ELF
systems it's the best solution.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
Build.PL | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/Build.PL b/Build.PL
index 27aa208..560dc75 100644
--- a/Build.PL
+++ b/Build.PL
@@ -40,21 +40,11 @@ EOF
{
print "Checking for PL_infix_plugin...\n";
- # Teach $cc how to find and link to libperl
- require Config;
- require Text::ParseWords;
-
- my @linker_flags = (
- "-L" . File::Spec->catdir($Config::Config{archlibexp}, "CORE"),
- "-lperl", Text::ParseWords::shellwords( $Config::Config{libs} ),
- );
-
my $have_pl_infix_plugin = 0;
$have_pl_infix_plugin = 1 if grep { $_ eq "--have-pl_infix_plugin" } @ARGV;
$have_pl_infix_plugin ||= $cc->try_compile_run(
- extra_linker_flags => \@linker_flags,
source => <<'EOF'
#include "EXTERN.h"
#include "perl.h"
--
2.41.0

View File

@ -1,47 +0,0 @@
From 2f53d01f14661f7a663090582ac4f2a5414328b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 9 Aug 2023 12:19:21 +0200
Subject: [PATCH] Pass a format string to warn()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Building with -Werror=format-security compiler flag raised an error:
gcc -Isrc/ -I/usr/lib64/perl5/CORE -fPIC -DHAVE_PL_INFIX_PLUGIN -I. -Ihax -c -D_REENTRANT -D_GNU_SOURCE -O2 '-flto=auto' -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang '-Werror=format-security' '-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3' -Wp,-D_GLIBCXX_ASSERTIONS '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' -fstack-protector-strong '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1' -m64 '-mtune=generic' -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE '-D_FILE_OFFSET_BITS=64' -O2 '-flto=auto' -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall '-Werror=format-security' '-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3' -Wp,-D_GLIBCXX_ASSERTIONS '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' -fstack-protector-strong '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1' -m64 '-mtune=generic' -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -o src/keyword.o src/keyword.c
[...]
src/keyword.c: In function 'parse_piece':
src/keyword.c:422:7: error: format not a string literal and no format arguments [-Werror=format-security]
422 | warn(piece->u.str);
| ^~~~
This is becaue warn() expects a format string as a first argument, see proto.h:
Perl_warn(pTHX_ const char *pat, ...)
__attribute__format__(__printf__,pTHX_1,pTHX_2);
This patch fixes it by formatting the unknown string with "%s".
CPAN RT#149346
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
src/keyword.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/keyword.c b/src/keyword.c
index 30d0900..07aae26 100644
--- a/src/keyword.c
+++ b/src/keyword.c
@@ -419,7 +419,7 @@ static void parse_piece(pTHX_ SV *argsv, size_t *argidx, const struct XSParseKey
int warnbit = piece->type >> 24;
if(warnbit && !ckWARN(warnbit))
return;
- warn(piece->u.str);
+ warn("%s", piece->u.str);
return;
}
--
2.41.0

View File

@ -2,18 +2,13 @@
%bcond_without perl_XS_Parse_Keyword_enables_optional_test
Name: perl-XS-Parse-Keyword
Version: 0.37
Version: 0.38
Release: 1%{?dist}
Summary: XS functions to assist in parsing keyword syntax
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/XS-Parse-Keyword
Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/XS-Parse-Keyword-%{version}.tar.gz
Source1: macros.perl-XS-Parse-Keyword
# Fix a check for PL_infix_plugin, not suitable for upstream, bug #2226738,
# CPAN RT#149179.
Patch0: XS-Parse-Keyword-0.36-No-special-linker-flags-for-checking-for-PL_infix_pl.patch
# Fix calling warn(), CPAN RT#149346, proposed to the upstream.
Patch1: XS-Parse-Keyword-0.37-Pass-a-format-string-to-warn.patch
BuildRequires: coreutils
BuildRequires: perl-devel
BuildRequires: perl-generators
@ -149,6 +144,9 @@ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print
%{_libexecdir}/%{name}
%changelog
* Wed Aug 09 2023 Petr Pisar <ppisar@redhat.com> - 0.38-1
- 0.38 bump
* Wed Aug 09 2023 Petr Pisar <ppisar@redhat.com> - 0.37-1
- 0.37 bump

View File

@ -1 +1 @@
SHA512 (XS-Parse-Keyword-0.37.tar.gz) = 6a0c125e8f4afb6c33260e1bb07e64b168f1e7e1776739b6f09cc47232cb41ae65cee9ea5bbcafcc67eefa91b7cb3cd7a916581649b4b2da3049f306987ca5a9
SHA512 (XS-Parse-Keyword-0.38.tar.gz) = 2b7dfade590c00095681a55ff937e3d9de1f939e0ea9fec6ae5cd06e618c2dacdc226f94047d41e6d95725dbf722feb3f2c8794a9a6950bfe12fc53bdbb823fa