patches/glibc/ports-2.10.1/290-undefine-__i686.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Aug 23 14:32:16 2010 +0200 (2010-08-23)
changeset 2100 f9fcfc002c8a
permissions -rw-r--r--
debug/gdb: install dependable libs in a generic target static libs dir

For now, ncurses is the only dependable target library built for gdb.
But expat is coming, and there's no reason to install each library in
its own place.

So, install ncurses in a generic directory, where other dependable
libraries can be installed as well.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1625
     1
If gcc is configured to generate i686 code or better by default (like 
yann@1625
     2
when using the --with-arch=pentium3 configure option), then the __i686
yann@1625
     3
macro will always be defined automatically and thus screw up the
yann@1625
     4
compilation of some .S files.
yann@1625
     5
http://bugs.gentoo.org/131108
yann@1625
     6
http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
yann@1625
     7
yann@1625
     8
2006-04-25  Mike Frysinger  <vapier@gentoo.org>
yann@1625
     9
yann@1625
    10
	* sysdeps/i386/sysdep.h (__i686): Undefine.
yann@1625
    11
yann@1625
    12
diff -durN glibc-2.10.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c
yann@1625
    13
--- glibc-2.10.1.orig/nptl/sysdeps/pthread/pt-initfini.c	2007-06-17 20:02:01.000000000 +0200
yann@1625
    14
+++ glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c	2009-11-13 00:50:22.000000000 +0100
yann@1625
    15
@@ -45,6 +45,9 @@
yann@1625
    16
 /* Embed an #include to pull in the alignment and .end directives. */
yann@1625
    17
 asm ("\n#include \"defs.h\"");
yann@1625
    18
 
yann@1625
    19
+/* Embed an #include to pull in asm settings. */
yann@1625
    20
+asm ("\n#ifdef __i686__\n#include <sysdep.h>\n#endif");
yann@1625
    21
+
yann@1625
    22
 /* The initial common code ends here. */
yann@1625
    23
 asm ("\n/*@HEADER_ENDS*/");
yann@1625
    24
 
yann@1625
    25
diff -durN glibc-2.10.1.orig/sysdeps/i386/sysdep.h glibc-2.10.1/sysdeps/i386/sysdep.h
yann@1625
    26
--- glibc-2.10.1.orig/sysdeps/i386/sysdep.h	2006-10-28 08:44:03.000000000 +0200
yann@1625
    27
+++ glibc-2.10.1/sysdeps/i386/sysdep.h	2009-11-13 00:50:22.000000000 +0100
yann@1625
    28
@@ -18,6 +18,14 @@
yann@1625
    29
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
yann@1625
    30
    02111-1307 USA.  */
yann@1625
    31
 
yann@1625
    32
+/*
yann@1625
    33
+ * When building for i686 targets or better, gcc automatically defines
yann@1625
    34
+ * '__i686' to '1' for us which causes trouble when using section names
yann@1625
    35
+ * like '__i686.get_pc_thunk.reg'.  Since we check for __i686__ in the
yann@1625
    36
+ * code, killing '__i686' shouldn't be a problem.
yann@1625
    37
+ */
yann@1625
    38
+#undef __i686
yann@1625
    39
+
yann@1625
    40
 #include <sysdeps/generic/sysdep.h>
yann@1625
    41
 
yann@1625
    42
 #ifdef	__ASSEMBLER__