From a23f7734d9ead88e30bc582b7612a7465d5ead50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= <con...@redhat.com> Date: Tue, 8 Dec 2015 17:45:24 +0100 Subject: Add support for ppc64le, s390x and aarch64 (#1288335)
- Restore EPEL compatibility --- Sys-Syscall-0.25-Add-aarch64-support.patch | 72 ++++++++++++++++++++++++++++++ Sys-Syscall-0.25-Add-ppc64le-support.patch | 31 +++++++++++++ Sys-Syscall-0.25-Add-s390-x-support.patch | 34 ++++++++++++++ perl-Sys-Syscall.spec | 20 +++++++-- 4 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 Sys-Syscall-0.25-Add-aarch64-support.patch create mode 100644 Sys-Syscall-0.25-Add-ppc64le-support.patch create mode 100644 Sys-Syscall-0.25-Add-s390-x-support.patch diff --git a/Sys-Syscall-0.25-Add-aarch64-support.patch b/Sys-Syscall-0.25-Add-aarch64-support.patch new file mode 100644 index 0000000..ebb407a --- /dev/null +++ b/Sys-Syscall-0.25-Add-aarch64-support.patch @@ -0,0 +1,72 @@ +From 6c7c516edfabd2edc835d0aaad39f946164bb25d Mon Sep 17 00:00:00 2001 +From: Yaakov Selkowitz <yselk...@redhat.com> +Date: Fri, 4 Dec 2015 02:31:28 -0600 +Subject: [PATCH 6/6] Add aarch64 support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is a bit complicated because AArch64, as a completely new architecture, +does not support the deprecated epoll_create and epoll_wait syscalls. +Instead, these wrap the epoll_create1 and epoll_pwait syscalls, which serve +the same purpose but with slightly different syntaxes. + +Signed-off-by: Petr Šabata <con...@redhat.com> +--- + lib/Sys/Syscall.pm | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/lib/Sys/Syscall.pm b/lib/Sys/Syscall.pm +index 702e835..abd010a 100644 +--- a/lib/Sys/Syscall.pm ++++ b/lib/Sys/Syscall.pm +@@ -48,6 +48,8 @@ our ( + $SYS_readahead, + ); + ++our $no_deprecated = 0; ++ + if ($^O eq "linux") { + # whether the machine requires 64-bit numbers to be on 8-byte + # boundaries. +@@ -101,6 +103,14 @@ if ($^O eq "linux") { + $SYS_epoll_wait = 409; + $SYS_readahead = 379; + $u64_mod_8 = 1; ++ } elsif ($machine eq "aarch64") { ++ $SYS_epoll_create = 20; # (sys_epoll_create1) ++ $SYS_epoll_ctl = 21; ++ $SYS_epoll_wait = 22; # (sys_epoll_pwait) ++ $SYS_sendfile = 71; # (sys_sendfile64) ++ $SYS_readahead = 213; ++ $u64_mod_8 = 1; ++ $no_deprecated = 1; + } elsif ($machine =~ m/arm(v\d+)?.*l/) { + # ARM OABI + $SYS_epoll_create = 250; +@@ -203,7 +213,7 @@ sub epoll_defined { return $SYS_epoll_create ? 1 : 0; } + # size doesn't even matter (radix tree now, not hash) + sub epoll_create { + return -1 unless defined $SYS_epoll_create; +- my $epfd = eval { syscall($SYS_epoll_create, ($_[0]||100)+0) }; ++ my $epfd = eval { syscall($SYS_epoll_create, $no_deprecated ? 0 : ($_[0]||100)+0) }; + return -1 if $@; + return $epfd; + } +@@ -241,7 +251,12 @@ sub epoll_wait_mod8 { + $epoll_wait_size = $_[1]; + $epoll_wait_events = "\0" x 16 x $epoll_wait_size; + } +- my $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0); ++ my $ct; ++ if ($no_deprecated) { ++ $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0, undef); ++ } else { ++ $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0); ++ } + for ($_ = 0; $_ < $ct; $_++) { + # 16 byte epoll_event structs, with format: + # 4 byte mask [idx 1] +-- +2.5.0 + diff --git a/Sys-Syscall-0.25-Add-ppc64le-support.patch b/Sys-Syscall-0.25-Add-ppc64le-support.patch new file mode 100644 index 0000000..a37ff49 --- /dev/null +++ b/Sys-Syscall-0.25-Add-ppc64le-support.patch @@ -0,0 +1,31 @@ +From b877ec33b331ba01e8fad8bed0d3cde55e1efa9e Mon Sep 17 00:00:00 2001 +From: Yaakov Selkowitz <yselk...@redhat.com> +Date: Fri, 4 Dec 2015 02:26:35 -0600 +Subject: [PATCH 4/6] Add ppc64le support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Little endian uses the same syscalls as the big endian kernel. + +Signed-off-by: Petr Šabata <con...@redhat.com> +--- + lib/Sys/Syscall.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Sys/Syscall.pm b/lib/Sys/Syscall.pm +index 8d7cca2..ece65de 100644 +--- a/lib/Sys/Syscall.pm ++++ b/lib/Sys/Syscall.pm +@@ -65,7 +65,7 @@ if ($^O eq "linux") { + $SYS_epoll_wait = 232; + $SYS_sendfile = 40; + $SYS_readahead = 187; +- } elsif ($machine eq "ppc64") { ++ } elsif ($machine =~ m/^ppc64/) { + $SYS_epoll_create = 236; + $SYS_epoll_ctl = 237; + $SYS_epoll_wait = 238; +-- +2.5.0 + diff --git a/Sys-Syscall-0.25-Add-s390-x-support.patch b/Sys-Syscall-0.25-Add-s390-x-support.patch new file mode 100644 index 0000000..6b98ce7 --- /dev/null +++ b/Sys-Syscall-0.25-Add-s390-x-support.patch @@ -0,0 +1,34 @@ +From 5628d9c0e299eea79e87aa8a5ed2d99a2895a4d0 Mon Sep 17 00:00:00 2001 +From: Yaakov Selkowitz <yselk...@redhat.com> +Date: Fri, 4 Dec 2015 02:28:00 -0600 +Subject: [PATCH 5/6] Add s390/x support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Šabata <con...@redhat.com> +--- + lib/Sys/Syscall.pm | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/lib/Sys/Syscall.pm b/lib/Sys/Syscall.pm +index ece65de..702e835 100644 +--- a/lib/Sys/Syscall.pm ++++ b/lib/Sys/Syscall.pm +@@ -79,6 +79,13 @@ if ($^O eq "linux") { + $SYS_sendfile = 186; # sys_sendfile64=226 + $SYS_readahead = 191; + $u64_mod_8 = 1; ++ } elsif ($machine =~ m/^s390/) { ++ $SYS_epoll_create = 249; ++ $SYS_epoll_ctl = 250; ++ $SYS_epoll_wait = 251; ++ $SYS_sendfile = 187; # sys_sendfile64=223 ++ $SYS_readahead = 222; ++ $u64_mod_8 = 1; + } elsif ($machine eq "ia64") { + $SYS_epoll_create = 1243; + $SYS_epoll_ctl = 1244; +-- +2.5.0 + diff --git a/perl-Sys-Syscall.spec b/perl-Sys-Syscall.spec index 7e4b242..88d97a4 100644 --- a/perl-Sys-Syscall.spec +++ b/perl-Sys-Syscall.spec @@ -1,16 +1,22 @@ Name: perl-Sys-Syscall Version: 0.25 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Access system calls that Perl doesn't normally provide access to License: GPL+ or Artistic +Group: Development/Libraries URL: http://search.cpan.org/dist/Sys-Syscall/ Source0: http://www.cpan.org/modules/by-module/Sys/Sys-Syscall-%{version}.tar.gz +# ghpr#6, rhbz#1288335 +Patch0: Sys-Syscall-0.25-Add-ppc64le-support.patch +Patch1: Sys-Syscall-0.25-Add-s390-x-support.patch +Patch2: Sys-Syscall-0.25-Add-aarch64-support.patch BuildArch: noarch # Build BuildRequires: coreutils +BuildRequires: findutils BuildRequires: make BuildRequires: perl -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(ExtUtils::MakeMaker) # Runtime BuildRequires: perl(constant) BuildRequires: perl(Exporter) @@ -30,13 +36,17 @@ syscalls/OSes planned for future. %prep %setup -q -n Sys-Syscall-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 +perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} +find %{buildroot} -type f -name .packlist -delete %{_fixperms} %{buildroot}/* rm -v %{buildroot}%{_mandir}/man3/Sys::README.3pm || : @@ -49,6 +59,10 @@ make test %{_mandir}/man3/Sys::Syscall.* %changelog +* Tue Dec 08 2015 Petr Šabata <con...@redhat.com> - 0.25-10 +- Add support for ppc64le, s390x and aarch64 (#1288335) +- Restore EPEL compatibility + * Wed Sep 02 2015 Petr Šabata <con...@redhat.com> - 0.25-9 - Don't remove nonexistent files - Fix the dep list -- cgit v0.11.2 http://pkgs.fedoraproject.org/cgit/perl-Sys-Syscall.git/commit/?h=master&id=a23f7734d9ead88e30bc582b7612a7465d5ead50 -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org