Package: r-base
Version: 2.4.1-1
Severity: important
Tags: patch
Hi,
r-base currently FTBFS on hurd-i386 because that architecture doesn't
have SA_SIGINFO. Here is a patch.
Samuel
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
--
Samuel Thibault <[EMAIL PROTECTED]>
We are Pentium of Borg. Division is futile. You will be approximated.
(seen in someone's .signature)
--- r-base-2.4.1-orig/src/main/main.c 2006-12-03 22:37:45.000000000 +0100
+++ r-base-2.4.1/src/main/main.c 2007-01-17 21:10:30.000000000 +0100
@@ -440,10 +440,15 @@
static unsigned char ConsoleBuf[CONSOLE_BUFFER_SIZE];
extern void R_CleanTempDir();
+#ifdef SA_SIGINFO
static void sigactionSegv(int signum, siginfo_t *ip, void *context)
+#else
+static void sigactionSegv(int signum)
+#endif
{
char *s;
+#ifdef SA_SIGINFO
/* First check for stack overflow if we know the stack position.
We assume anything within 16Mb beyond the stack end is a stack overflow.
*/
@@ -459,6 +464,7 @@
jump_to_toplevel();
}
}
+#endif
/* need to take off stack checking as stack base has changed */
R_CStackLimit = (unsigned long)-1;
@@ -467,6 +473,7 @@
REprintf("\n *** caught %s ***\n",
signum == SIGILL ? "illegal operation" :
signum == SIGBUS ? "bus error" : "segfault");
+#ifdef SA_SIGINFO
if(ip != (siginfo_t *)0) {
if(signum == SIGILL) {
@@ -539,6 +546,7 @@
}
REprintf("address %p, cause '%s'\n", ip->si_addr, s);
}
+#endif
{ /* A simple customized print of the traceback */
SEXP trace, p, q;
int line = 1, i;
@@ -603,9 +611,17 @@
warning("failed to set alternate signal stack");
} else
warning("failed to allocate alternate signal stack");
+#ifdef SA_SIGINFO
sa.sa_sigaction = sigactionSegv;
+#else
+ sa.sa_handler = sigactionSegv;
+#endif
sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_ONSTACK | SA_SIGINFO;
+ sa.sa_flags = SA_ONSTACK
+#ifdef SA_SIGINFO
+ | SA_SIGINFO
+#endif
+ ;
sigaction(SIGSEGV, &sa, NULL);
sigaction(SIGILL, &sa, NULL);
#ifdef SIGBUS