[libsys-syscall-perl] 01/05: Add support for arm64, ppc64el and s390x
Niko Tyni
ntyni at moszumanska.debian.org
Sat May 21 09:40:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
ntyni pushed a commit to branch master
in repository libsys-syscall-perl.
commit e1442273568cc442e1a4b708bf9ad48a717f4698
Author: Niko Tyni <ntyni at debian.org>
Date: Sat May 21 12:14:02 2016 +0300
Add support for arm64, ppc64el and s390x
Thanks to Eric Wong.
Closes: #824843
---
debian/patches/aarch64.patch | 70 ++++++++++++++++++++++++++++++++++++++++++++
debian/patches/ppc64le.patch | 29 ++++++++++++++++++
debian/patches/s390x.patch | 32 ++++++++++++++++++++
debian/patches/series | 3 ++
4 files changed, 134 insertions(+)
diff --git a/debian/patches/aarch64.patch b/debian/patches/aarch64.patch
new file mode 100644
index 0000000..c2423e0
--- /dev/null
+++ b/debian/patches/aarch64.patch
@@ -0,0 +1,70 @@
+From 6c7c516edfabd2edc835d0aaad39f946164bb25d Mon Sep 17 00:00:00 2001
+From: Yaakov Selkowitz <yselkowi at redhat.com>
+Date: Fri, 4 Dec 2015 02:31:28 -0600
+Subject: [PATCH 3/3] Add aarch64 support
+
+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.
+
+Origin: backport, https://github.com/bradfitz/sys-syscall/commit/6c7c516edfabd2edc835d0aaad39f946164bb25d
+Bug-Debian: https://bugs.debian.org/824843
+---
+ 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-1) {
+ # 16 byte epoll_event structs, with format:
+ # 4 byte mask [idx 1]
+--
+2.8.1
+
diff --git a/debian/patches/ppc64le.patch b/debian/patches/ppc64le.patch
new file mode 100644
index 0000000..aeca4da
--- /dev/null
+++ b/debian/patches/ppc64le.patch
@@ -0,0 +1,29 @@
+From b877ec33b331ba01e8fad8bed0d3cde55e1efa9e Mon Sep 17 00:00:00 2001
+From: Yaakov Selkowitz <yselkowi at redhat.com>
+Date: Fri, 4 Dec 2015 02:26:35 -0600
+Subject: [PATCH 1/3] Add ppc64le support
+
+Little endian uses the same syscalls as the big endian kernel.
+
+Origin: upstream, https://github.com/bradfitz/sys-syscall/commit/b877ec33b331ba01e8fad8bed0d3cde55e1efa9e
+Bug-Debian: https://bugs.debian.org/824843
+---
+ 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.8.1
+
diff --git a/debian/patches/s390x.patch b/debian/patches/s390x.patch
new file mode 100644
index 0000000..0f5311c
--- /dev/null
+++ b/debian/patches/s390x.patch
@@ -0,0 +1,32 @@
+From 5628d9c0e299eea79e87aa8a5ed2d99a2895a4d0 Mon Sep 17 00:00:00 2001
+From: Yaakov Selkowitz <yselkowi at redhat.com>
+Date: Fri, 4 Dec 2015 02:28:00 -0600
+Subject: [PATCH 2/3] Add s390/x support
+
+Origin: upstream, https://github.com/bradfitz/sys-syscall/commit/5628d9c0e299eea79e87aa8a5ed2d99a2895a4d0
+Bug-Debian: https://bugs.debian.org/824843
+---
+ 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.8.1
+
diff --git a/debian/patches/series b/debian/patches/series
index e354b5b..fe0a255 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
0001-restore-missing-changes-from-0.20.0.22.patch
+ppc64le.patch
+s390x.patch
+aarch64.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libsys-syscall-perl.git
More information about the Pkg-perl-cvs-commits
mailing list