patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

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