patches/glibc/2.7/130-i686-assembler.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:46:47 2011 +0200 (2011-07-17)
changeset 2892 aa934ec4b4ee
parent 744 4bf8448536d5
permissions -rw-r--r--
cc/gcc: add the backend/frontend infra for final gcc

Currently, we issue the bare-metal compiler from the pass_1 & pass_2
core compilers, because the final gcc breaks while doing so.

This implies we have to build some libces during the start_files step,
instead of the standard libc step. This is the case for newlib.

By adding a backend/frontend infra to the final gcc, we can abstract
what backend to call: the standard backend for non-bare-metal gcc,
and the core backend for bare-metal.

This patch is just an no-op, it just adds the final backend and
frontend without changing the way bare-metal is built, to come in a
subsequent patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@434
     1
If gcc is configured to generate i686 code or better by default (like
yann@434
     2
when using the --with-arch=pentium3 configure option), then the __i686
yann@434
     3
macro will always be defined automatically and thus screw up the
yann@434
     4
compilation of some .S files.
yann@434
     5
yann@434
     6
http://bugs.gentoo.org/131108
yann@434
     7
http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
yann@434
     8
yann@434
     9
2006-04-25  Mike Frysinger  <vapier@gentoo.org>
yann@434
    10
yann@434
    11
	* sysdeps/i386/sysdep.h (__i686): Undefine.
yann@434
    12
yann@434
    13
Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
yann@434
    14
===================================================================
yann@434
    15
--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
yann@434
    16
+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
yann@434
    17
@@ -29,6 +29,10 @@
yann@434
    18
 #include <dl-sysdep.h>
yann@434
    19
 #include <tls.h>
yann@434
    20
yann@434
    21
+#if defined __i686 && defined __ASSEMBLER__
yann@434
    22
+#undef __i686
yann@434
    23
+#define __i686 __i686
yann@434
    24
+#endif
yann@434
    25
yann@434
    26
 /* For Linux we can use the system call table in the header file
yann@434
    27
 	/usr/include/asm/unistd.h
yann@434
    28
Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
yann@434
    29
===================================================================
yann@434
    30
--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
yann@434
    31
+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
yann@434
    32
@@ -45,6 +45,11 @@
yann@434
    33
 /* Embed an #include to pull in the alignment and .end directives. */
yann@434
    34
 asm ("\n#include \"defs.h\"");
yann@434
    35
yann@434
    36
+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
yann@434
    37
+asm ("\n#undef __i686");
yann@434
    38
+asm ("\n#define __i686 __i686");
yann@434
    39
+asm ("\n#endif");
yann@434
    40
+
yann@434
    41
 /* The initial common code ends here. */
yann@434
    42
 asm ("\n/*@HEADER_ENDS*/");
yann@434
    43