Package: libsys-syscall-perl
Version: 0.25-2
Severity: serious
Tags: patch

This package fails to build on mips, mipsel and mips64el.

#   Failed test 'event is stdout'
#   at t/01-epoll.t line 39.
#          got: '0'
#     expected: '4'
# listening on 39575 and 41406

#   Failed test 'got both'
#   at t/01-epoll.t line 80.

The code gets the right constants from sys/syscall.ph, but
the default aligment requirements are wrong. Patch attached
hardcoding the constants like the rest of the archs do.

This needs to be sent upstream too. It's tested manually
on the Debian porter machines, but I'll run it by the
autobuilders to make sure it's working first.
-- 
Niko Tyni   nt...@debian.org
>From 27084cb9b8a0cdc0bdaae792a329ea3b35a9ef92 Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sat, 21 May 2016 14:05:31 +0000
Subject: [PATCH] Add mips* support

---
 lib/Sys/Syscall.pm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/lib/Sys/Syscall.pm b/lib/Sys/Syscall.pm
index b7ac0ce..165b152 100644
--- a/lib/Sys/Syscall.pm
+++ b/lib/Sys/Syscall.pm
@@ -64,6 +64,11 @@ if ($^O eq "linux") {
         $machine = "i386";
     }
 
+    # Similarly for mips64 vs mips
+    if ($machine eq "mips64" && $Config{ptrsize} == 4) {
+        $machine = "mips";
+    }
+
     if ($machine =~ m/^i[3456]86$/) {
         $SYS_epoll_create = 254;
         $SYS_epoll_ctl    = 255;
@@ -113,6 +118,20 @@ if ($^O eq "linux") {
         $SYS_sendfile     = 187;
         $SYS_readahead    = 225;
         $u64_mod_8        = 1;
+    } elsif ($machine =~ m/^mips64/) {
+        $SYS_sendfile     = 5039;
+        $SYS_epoll_create = 5207;
+        $SYS_epoll_ctl    = 5208;
+        $SYS_epoll_wait   = 5209;
+        $SYS_readahead    = 5179;
+        $u64_mod_8        = 1;
+    } elsif ($machine =~ m/^mips/) {
+        $SYS_sendfile     = 4207;
+        $SYS_epoll_create = 4248;
+        $SYS_epoll_ctl    = 4249;
+        $SYS_epoll_wait   = 4250;
+        $SYS_readahead    = 4223;
+        $u64_mod_8        = 1;
     } else {
         # as a last resort, try using the *.ph files which may not
         # exist or may be wrong
-- 
2.1.4

Reply via email to