patches/strace/4.5.15/190-undef-syscall.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
parent 746 b150d6f590fc
permissions -rw-r--r--
complibs/cloog: fix linking with libm

In Ubuntu 11.04 and 11.10, the default options for ld have changed.
--no-copy-dt-needed-entries and --as-needed are now enabled by default, which
causes errors like:

[EXTRA] Checking CLooG/ppl
[DEBUG] ==> Executing: 'make' '-j3' '-s' 'check'
[ALL ] Making check in .
[ALL ] config.status: creating include/cloog/cloog-config.h
[ALL ] config.status: include/cloog/cloog-config.h is unchanged
[ALL ] libtool: link: i686-build_pc-linux-gnu-gcc -Wall -fomit-frame-pointer
-pipe -o cloog cloog.o -L/<snip>/build/static/lib ./.libs/libcloog.a -lm
/<snip>/build/static/lib/libppl_c.a /<snip>/build/static/lib/libpwl.a
/<snip>/build/static/lib/libppl.a /<snip>/build/static/lib/libgmpxx.a
/<snip>/build/static/lib/libgmp.a -lstdc++
[ALL ] /usr/bin/ld: /<snip>/build/static/lib/libppl.a(MIP_Problem.o):
undefined reference to symbol 'sqrt@@GLIBC_2.0'
[ALL ] /usr/bin/ld: note: 'sqrt@@GLIBC_2.0' is defined in DSO
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so so try adding
it to the linker command line
[ALL ] /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so:
could not read symbols: Invalid operation
[ALL ] collect2: ld returned 1 exit status
[ERROR] make[2]: *** [cloog] Error 1
[ERROR] make[1]: *** [check-recursive] Error 1

See:
https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

This patch fixes these errors by placing '-lm' at the right place on the command
line as libppl requires libm when linking cloog.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
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: