patches/strace/4.5.17/170-arm-syscalls.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
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>
     1 Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/170-arm-syscalls.patch
     2 -= BEGIN original header =-
     3 Author: Michael Abbott <michael.abbott@diamond.ac.uk>
     4 Date:   Wed Oct 22 08:53:42 2008 +0100
     5 
     6     Syscall patch for ARM
     7     Patch mailed to strace mailing list by Anderson Lizardo, work by
     8     Bruna Moreira, dated 2008-01-25.  Patch cleaned up against 4.5.17 release.
     9 
    10 diff --git a/linux/arm/errnoent1.h b/linux/arm/errnoent1.h
    11 new file mode 100644
    12 index 0000000..a894827
    13 -= END original header =-
    14 diff -durN b/linux/arm/errnoent1.h b/linux/arm/errnoent1.h
    15 --- b/linux/arm/errnoent1.h	1970-01-01 01:00:00.000000000 +0100
    16 +++ b/linux/arm/errnoent1.h	2008-10-24 21:30:13.000000000 +0200
    17 @@ -0,0 +1,2 @@
    18 +/* Our second set comes from the i386 files.  */
    19 +#include "../errnoent.h"
    20 diff -durN b/linux/arm/ioctlent1.h b/linux/arm/ioctlent1.h
    21 --- b/linux/arm/ioctlent1.h	1970-01-01 01:00:00.000000000 +0100
    22 +++ b/linux/arm/ioctlent1.h	2008-10-24 21:30:13.000000000 +0200
    23 @@ -0,0 +1,2 @@
    24 +/* Our second set comes from the i386 files.  */
    25 +#include "../ioctlent.h"
    26 diff -durN b/linux/arm/signalent1.h b/linux/arm/signalent1.h
    27 --- b/linux/arm/signalent1.h	1970-01-01 01:00:00.000000000 +0100
    28 +++ b/linux/arm/signalent1.h	2008-10-24 21:30:13.000000000 +0200
    29 @@ -0,0 +1,2 @@
    30 +/* Our second set comes from the i386 files.  */
    31 +#include "../signalent.h"
    32 diff -durN b/linux/arm/syscallent1.h b/linux/arm/syscallent1.h
    33 --- b/linux/arm/syscallent1.h	1970-01-01 01:00:00.000000000 +0100
    34 +++ b/linux/arm/syscallent1.h	2008-10-24 21:30:13.000000000 +0200
    35 @@ -0,0 +1,7 @@
    36 +/* ARM specific syscalls */
    37 +	{ 5,	0,	printargs,		"SYS_0"			}, /* 0 */
    38 +	{ 5,	0,	printargs,		"breakpoint"		}, /* 1 */
    39 +	{ 5,	0,	printargs,		"cacheflush"		}, /* 2 */
    40 +	{ 5,	0,	printargs,		"usr26"			}, /* 3 */
    41 +	{ 5,	0,	printargs,		"usr32"			}, /* 4 */
    42 +	{ 5,	0,	printargs,		"set_tls"		}, /* 5 */