0.23 bump

This commit is contained in:
Petr Písař 2019-03-08 08:37:49 +01:00
parent 15df7ea7fd
commit 1428c35d0d
5 changed files with 12 additions and 60 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/Alien-FFI-0.22.tar.gz
/Alien-FFI-0.23.tar.gz

View File

@ -1,54 +0,0 @@
From caceb5a9f5ec37b32b2996e2936f383b2490f29b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 7 Mar 2019 13:58:13 +0100
Subject: [PATCH] test: Hande return value type properly
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
t/xs.t test failed on big-endian. The return_value after ffi_call()
was always 0. Big endian systems have the least siginicant byte at the
end of a word and interpreting a signed char memory as an integer
must take that offset into account.
This was not the case of the t/xs.t where doublechaar() returned
unsigned char but return_value was of int type and thus libffi stored
the value at a wrong offset.
Moreover the libffi was not properly used because a storage size of a libffi
return value must always be at least sizeof(ffi_arg) large and that's
not true for an unsigned char variable.
This patch fixes it.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/xs.t | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/xs.t b/t/xs.t
index 08914ce..085c736 100644
--- a/t/xs.t
+++ b/t/xs.t
@@ -31,15 +31,15 @@ test2(unsigned char input_value)
ffi_cif ffi_cif;
ffi_type *args[1];
void *values[1];
- unsigned char return_value;
+ ffi_arg return_value;
args[0] = &ffi_type_uint8;
- if(ffi_prep_cif(&ffi_cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint8, args) == FFI_OK)
+ if(ffi_prep_cif(&ffi_cif, FFI_DEFAULT_ABI, 1, &ffi_type_uchar, args) == FFI_OK)
{
values[0] = &input_value;
ffi_call(&ffi_cif, FFI_FN(doublechaar), &return_value, values);
- return return_value;
+ return (int)(unsigned char)return_value;
}
return -1;
}
--
2.20.1

6
perl-Alien-FFI.rpmlintrc Normal file
View File

@ -0,0 +1,6 @@
from Config import *
# The package builds in architecture specific data
addFilter("perl-Alien-FFI.*: E: no-binary")
# Installing libffi developmental files is a meaning of this package
addFilter("explicit-lib-dependency libffi-devel");
addFilter("spelling-error .* libffi");

View File

@ -1,13 +1,10 @@
Name: perl-Alien-FFI
Version: 0.22
Version: 0.23
Release: 1%{?dist}
Summary: Make available libffi
License: GPL+ or Artistic
URL: https://metacpan.org/release/Alien-FFI
Source0: https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Alien-FFI-%{version}.tar.gz
# Correct tests to be endianess-safe, proposed to upstream,
# <https://github.com/Perl5-FFI/Alien-FFI/pull/7>
Patch0: Alien-FFI-0.22-test-Hande-return-value-type-properly.patch
# This is an architecture-dependenant package because it stores data about
# architecture-specific library, but it has no XS code, hence no debuginfo.
%global debug_package %{nil}
@ -44,7 +41,6 @@ This ensures that libffi library can be used by other Perl distributions.
%prep
%setup -q -n Alien-FFI-%{version}
%patch0 -p1
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
@ -64,5 +60,8 @@ make test
%{_mandir}/man3/*
%changelog
* Fri Mar 08 2019 Petr Pisar <ppisar@redhat.com> - 0.23-1
- 0.23 bump
* Thu Feb 28 2019 Petr Pisar <ppisar@redhat.com> 0.22-1
- Specfile autogenerated by cpanspec 1.78.

View File

@ -1 +1 @@
SHA512 (Alien-FFI-0.22.tar.gz) = 989b61a7fc8856216616987ff78c1b18914da5ab8b64a5466852c8f107540f0369a35fce4e12fc6bda61b527da82c18c213d7e9b6b62412d54760f63af4efce2
SHA512 (Alien-FFI-0.23.tar.gz) = 72470af1999d47a8a8b70860212958b9f751441e18f993b102c804943b95d8bbdc2b6f70d5a13c29a709ae850c9837a8fc07647ac2b5b5ac9a73e5a85e2e0bcf