patches/strace/4.5.15/190-undef-syscall.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Wed Jun 08 15:47:43 2011 +0200 (2011-06-08)
changeset 2508 9e2761e59a75
parent 746 b150d6f590fc
permissions -rw-r--r--
debug/cross-gdb: check host dependencies

Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.

Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"

Hence, expat should be considered mandatory.

On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.

This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@257
     1
diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h
yann@257
     2
--- strace-4.5.15.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
yann@257
     3
+++ strace-4.5.15/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
yann@270
     4
@@ -130,7 +130,11 @@
yann@257
     5
 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
yann@257
     6
 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
yann@257
     7
 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
yann@257
     8
-	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
yann@270
     9
+	{ 2,	TD,	sys_socketcall,		"socketcall"
yann@257
    10
+#ifdef __NR_socketcall
yann@270
    11
+	    , SYS_socketcall
yann@257
    12
+#endif
yann@270
    13
+								}, /* 102 */
yann@257
    14
 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
yann@257
    15
 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
yann@257
    16
 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
yann@270
    17
@@ -145,7 +149,11 @@
yann@257
    18
 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
yann@257
    19
 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
yann@257
    20
 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
yann@257
    21
-	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
yann@270
    22
+	{ 6,	0,	sys_ipc,		"ipc"
yann@257
    23
+#ifdef __NR_ipc
yann@270
    24
+	    , SYS_ipc
yann@257
    25
+#endif
yann@270
    26
+								}, /* 117 */
yann@257
    27
 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
yann@257
    28
 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
yann@257
    29
 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
yann@270
    30
@@ -282,7 +290,11 @@
yann@257
    31
 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
yann@257
    32
 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
yann@257
    33
 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
yann@257
    34
-	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
yann@257
    35
+	{ 1,	TP,	sys_exit,		"exit_group"
yann@257
    36
+#ifdef __NR_exit_group
yann@257
    37
+	    , __NR_exit_group
yann@257
    38
+#endif
yann@257
    39
+								}, /* 252 */
yann@257
    40
 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
yann@257
    41
 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
yann@257
    42
 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
yann@257
    43
diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
yann@257
    44
--- strace-4.5.15.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
yann@257
    45
+++ strace-4.5.15/syscall.c	2007-07-14 19:30:16.000000000 +0200
yann@257
    46
@@ -2404,14 +2404,18 @@
yann@257
    47
 	switch (known_scno(tcp)) {
yann@257
    48
 #ifdef LINUX
yann@257
    49
 #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
yann@257
    50
+#ifdef __NR_socketcall
yann@257
    51
 	case SYS_socketcall:
yann@257
    52
 		decode_subcall(tcp, SYS_socket_subcall,
yann@257
    53
 			SYS_socket_nsubcalls, deref_style);
yann@257
    54
 		break;
yann@257
    55
+#endif
yann@257
    56
+#ifdef __NR_ipc
yann@257
    57
 	case SYS_ipc:
yann@257
    58
 		decode_subcall(tcp, SYS_ipc_subcall,
yann@257
    59
 			SYS_ipc_nsubcalls, shift_style);
yann@257
    60
 		break;
yann@257
    61
+#endif
yann@257
    62
 #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
yann@257
    63
 #if defined (SPARC) || defined (SPARC64)
yann@257
    64
 	case SYS_socketcall: