Hello,

  attached is a patch for a NMU (not uploaded yet) that uses Florian's
  proposed solution to fix this bug. Manoj, I would like to get this
  issue fixed during this weekend's BSP. If you had plans for uploading
  yourself soon, or see any problems with the proposed patch, please let
  me know so I can refrain from uploading.

  Cheers,

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
 
If you want the holes in your knowledge showing up try teaching someone.
                -- Alan Cox
diff -u -Nrua libselinux-1.24-1/debian/changelog 
libselinux-1.24-1.1/debian/changelog
--- libselinux-1.24-1/debian/changelog  2005-08-05 10:48:23.000000000 +0200
+++ libselinux-1.24-1.1/debian/changelog        2005-08-05 11:59:00.000000000 
+0200
@@ -1,3 +1,13 @@
+libselinux (1.24-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload to fix RC bug.
+    
+  * Fix FTBFS on ia64 (closes: #320193): _syscall2 is not available on ia64,
+    use INLINE_SYSCALL as defined in glibc sources to define clone(). Credit
+    for this fix goes to Florian Weimer <[EMAIL PROTECTED]>, thanks!
+
+ -- Adeodato Simó <[EMAIL PROTECTED]>  Fri, 05 Aug 2005 11:59:00 +0200
+
 libselinux (1.24-1) unstable; urgency=low
 
   * New upstream release.
diff -u -Nrua libselinux-1.24-1/utils/setupns.c 
libselinux-1.24-1.1/utils/setupns.c
--- libselinux-1.24-1/utils/setupns.c   2005-06-13 22:29:43.000000000 +0200
+++ libselinux-1.24-1.1/utils/setupns.c 2005-08-05 10:50:04.000000000 +0200
@@ -13,7 +13,17 @@
 
 #include <linux/unistd.h>
 #define CLONE_NEWNS 0x00020000 /* Flag to create new namespace */
+
+#ifndef __ia64__
 static inline _syscall2 (int, clone, int, flags, int, arg)
+#else /* There is no _syscall2 in ia64 */
+#include "ia64-inline-syscall.h"
+static inline int
+clone (int flags, int arg)
+{
+    return INLINE_SYSCALL (clone2, 6, flags, NULL, arg, NULL, NULL, NULL);
+}
+#endif
 
 char *progname;
 
diff -u -Nrua libselinux-1.24-1/utils/ia64-inline-syscall.h 
libselinux-1.24-1.1/utils/ia64-inline-syscall.h
--- libselinux-1.24-1/utils/ia64-inline-syscall.h       1970-01-01 
01:00:00.000000000 +0100
+++ libselinux-1.24-1.1/utils/ia64-inline-syscall.h     2005-08-05 
11:51:15.000000000 +0200
@@ -0,0 +1,98 @@
+/*
+ * This file was sent to Debian Bug#320193 by Florian Weimer
+ * <[EMAIL PROTECTED]>. See debian/copyright for copyright info.
+ */
+
+// The following code has been copied from GNU libc 2.3.2, Debian
+// version 2.3.2.ds1-18,, file sysdeps/unix/sysv/linux/ia64/sysdep.h.
+// The __set_errno call has been replaced with an assignment to the
+// errno location.
+//
+// We cannot use __clone2 because it requires a callback and
+// automatically invokes _exit in the child.  Even if we used longjmp to
+// work around this problem, we are still using an internal GNU libc
+// interface.  The kernel interface used below should be fairly stable.
+
+// BEGIN OF GNU LIBC EXCERPT
+
+#define BREAK_INSN_1(num) "break " #num ";;\n\t"
+#define BREAK_INSN(num) BREAK_INSN_1(num)
+
+/* On IA-64 we have stacked registers for passing arguments.  The
+   "out" registers end up being the called function's "in"
+   registers.
+
+   Also, since we have plenty of registers we have two return values
+   from a syscall.  r10 is set to -1 on error, whilst r8 contains the
+   (non-negative) errno on error or the return value on success.
+ */
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...)                       \
+  ({                                                            \
+    register long _r8 asm ("r8");                               \
+    register long _r10 asm ("r10");                             \
+    register long _r15 asm ("r15") = __NR_##name;               \
+    long _retval;                                               \
+    LOAD_ARGS_##nr (args);                                      \
+    __asm __volatile (BREAK_INSN (__BREAK_SYSCALL)              \
+                      : "=r" (_r8), "=r" (_r10), "=r" (_r15)    \
+                        ASM_OUTARGS_##nr                        \
+                      : "2" (_r15) ASM_ARGS_##nr                \
+                      : "memory" ASM_CLOBBERS_##nr);            \
+    _retval = _r8;                                              \
+    if (_r10 == -1)                                             \
+      {                                                         \
+        errno = _retval;                                        \
+        _retval = -1;                                           \
+      }                                                         \
+    _retval; })
+
+#define ASM_OUTARGS_0
+#define ASM_OUTARGS_1   ASM_OUTARGS_0, "=r" (_out0)
+#define ASM_OUTARGS_2   ASM_OUTARGS_1, "=r" (_out1)
+#define ASM_OUTARGS_3   ASM_OUTARGS_2, "=r" (_out2)
+#define ASM_OUTARGS_4   ASM_OUTARGS_3, "=r" (_out3)
+#define ASM_OUTARGS_5   ASM_OUTARGS_4, "=r" (_out4)
+#define ASM_OUTARGS_6   ASM_OUTARGS_5, "=r" (_out5)
+
+#define ASM_ARGS_0
+#define ASM_ARGS_1      ASM_ARGS_0, "3" (_out0)
+#define ASM_ARGS_2      ASM_ARGS_1, "4" (_out1)
+#define ASM_ARGS_3      ASM_ARGS_2, "5" (_out2)
+#define ASM_ARGS_4      ASM_ARGS_3, "6" (_out3)
+#define ASM_ARGS_5      ASM_ARGS_4, "7" (_out4)
+#define ASM_ARGS_6      ASM_ARGS_5, "8" (_out5)
+
+#define ASM_CLOBBERS_6  , "out6", "out7",                               \
+  /* Non-stacked integer registers, minus r8, r10, r15.  */             \
+  "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18",    \
+  "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27",        \
+  "r28", "r29", "r30", "r31",                                           \
+  /* Predicate registers.  */                                           \
+  "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",     \
+  /* Non-rotating fp registers.  */                                     \
+  "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",     \
+  /* Branch registers.  */                                              \
+  "b6", "b7"
+
+#define LOAD_ARGS_0()   do { } while (0)
+#define LOAD_ARGS_1(out0)                               \
+  register long _out0 asm ("out0") = (long) (out0);     \
+  LOAD_ARGS_0 ()
+#define LOAD_ARGS_2(out0, out1)                         \
+  register long _out1 asm ("out1") = (long) (out1);     \
+  LOAD_ARGS_1 (out0)
+#define LOAD_ARGS_3(out0, out1, out2)                   \
+  register long _out2 asm ("out2") = (long) (out2);     \
+  LOAD_ARGS_2 (out0, out1)
+#define LOAD_ARGS_4(out0, out1, out2, out3)             \
+  register long _out3 asm ("out3") = (long) (out3);     \
+  LOAD_ARGS_3 (out0, out1, out2)
+#define LOAD_ARGS_5(out0, out1, out2, out3, out4)       \
+  register long _out4 asm ("out4") = (long) (out4);     \
+  LOAD_ARGS_4 (out0, out1, out2, out3)
+#define LOAD_ARGS_6(out0, out1, out2, out3, out4, out5) \
+  register long _out5 asm ("out5") = (long) (out5);     \
+  LOAD_ARGS_5 (out0, out1, out2, out3, out4)
+
+// END OF GNU LIBC EXCERPT
diff -u -Nrua libselinux-1.24-1/debian/copyright 
libselinux-1.24-1.1/debian/copyright
--- libselinux-1.24-1/debian/copyright  2005-08-05 10:48:23.000000000 +0200
+++ libselinux-1.24-1.1/debian/copyright        2005-08-05 12:10:07.000000000 
+0200
@@ -27,6 +27,32 @@
 risk.
 
 
+The file utils/ia64-inline-syscall.h was taken from glibc sources:
+
+/* Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Jes Sorensen, <[EMAIL PROTECTED]>, April 1999.
+   Based on code originally written by David Mosberger-Tang
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+On Debian GNU/Linux systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'. 
+
+
 This package is maintained by Manoj Srivastava <[EMAIL PROTECTED]>.
 
  The debian specific changes are Copyright (c) 1995 Manoj Srivastava, and 

Reply via email to