patches/glibc/ports-2.10.1/120-i386-x86_64-revert-clone-cfi.patch
author Johannes Stezenbach <js@sig21.net>
Thu Jul 29 19:47:16 2010 +0200 (2010-07-29)
changeset 2045 fdaa6c7f6dea
permissions -rw-r--r--
cc/gcc: add option to compile against static libstdc++, for gcc-4.4 and newer

Idea and know-how taken from CodeSourcery build script.

Normal build:
$ ldd arm-unknown-linux-uclibcgnueabi-gcc
linux-gate.so.1 => (0xb77f3000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb76e8000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb75a1000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb757a000)
/lib/ld-linux.so.2 (0xb77f4000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb755c000)

CC_STATIC_LIBSTDCXX=y:
$ ldd arm-unknown-linux-uclibcgnueabi-gcc
linux-gate.so.1 => (0xb7843000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb76e6000)
/lib/ld-linux.so.2 (0xb7844000)

I made CC_STATIC_LIBSTDCXX default=y since I think
it is always desirable.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
yann@1625
     1
revert cfi additions to clone on i386/x86_64 to workaround problems in
yann@1625
     2
gcc's unwinder code.  this is not a bug in glibc, it triggers problems
yann@1625
     3
elsewhere.  this cfi code does not gain us a whole lot anyways.
yann@1625
     4
yann@1625
     5
http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
yann@1625
     6
yann@1625
     7
Index: sysdeps/unix/sysv/linux/i386/clone.S
yann@1625
     8
===================================================================
yann@1625
     9
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/clone.S,v
yann@1625
    10
retrieving revision 1.27
yann@1625
    11
retrieving revision 1.26
yann@1625
    12
diff -u -p -r1.27 -r1.26
yann@1625
    13
yann@1625
    14
diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2.10.1/sysdeps/unix/sysv/linux/i386/clone.S
yann@1625
    15
--- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/clone.S	2006-12-04 00:12:36.000000000 +0100
yann@1625
    16
+++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/clone.S	2009-11-13 00:49:45.000000000 +0100
yann@1625
    17
@@ -120,9 +120,6 @@
yann@1625
    18
 	ret
yann@1625
    19
 
yann@1625
    20
 L(thread_start):
yann@1625
    21
-	cfi_startproc;
yann@1625
    22
-	/* Clearing frame pointer is insufficient, use CFI.  */
yann@1625
    23
-	cfi_undefined (eip);
yann@1625
    24
 	/* Note: %esi is zero.  */
yann@1625
    25
 	movl	%esi,%ebp	/* terminate the stack frame */
yann@1625
    26
 #ifdef RESET_PID
yann@1625
    27
@@ -155,7 +152,6 @@
yann@1625
    28
 	jmp	L(haspid)
yann@1625
    29
 	.previous
yann@1625
    30
 #endif
yann@1625
    31
-	cfi_endproc;
yann@1625
    32
 
yann@1625
    33
 	cfi_startproc
yann@1625
    34
 PSEUDO_END (BP_SYM (__clone))
yann@1625
    35
diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2.10.1/sysdeps/unix/sysv/linux/x86_64/clone.S
yann@1625
    36
--- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S	2006-12-04 00:12:36.000000000 +0100
yann@1625
    37
+++ glibc-2.10.1/sysdeps/unix/sysv/linux/x86_64/clone.S	2009-11-13 00:49:45.000000000 +0100
yann@1625
    38
@@ -89,9 +89,6 @@
yann@1625
    39
 	ret
yann@1625
    40
 
yann@1625
    41
 L(thread_start):
yann@1625
    42
-	cfi_startproc;
yann@1625
    43
-	/* Clearing frame pointer is insufficient, use CFI.  */
yann@1625
    44
-	cfi_undefined (rip);
yann@1625
    45
 	/* Clear the frame pointer.  The ABI suggests this be done, to mark
yann@1625
    46
 	   the outermost frame obviously.  */
yann@1625
    47
 	xorl	%ebp, %ebp
yann@1625
    48
@@ -116,7 +113,6 @@
yann@1625
    49
 	/* Call exit with return value from function call. */
yann@1625
    50
 	movq	%rax, %rdi
yann@1625
    51
 	call	HIDDEN_JUMPTARGET (_exit)
yann@1625
    52
-	cfi_endproc;
yann@1625
    53
 
yann@1625
    54
 	cfi_startproc;
yann@1625
    55
 PSEUDO_END (BP_SYM (__clone))