patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

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