[PATCH] Fix cross-compiling to i686

Esben Haabendal eha@dev.doredevelopment.dk
Wed Mar 30 14:11:00 GMT 2011


(Hmm.... Gnus ate my comments before the attachment)

Hi

In OE-lite we use the attached patch for building i686 cross compilers.
Thanks to Khem Raj for original patch :-)

/Esben

On Wed, 2011-03-30 at 16:01 +0200, Esben Haabendal wrote:
> differences between files attachment (glibc-march-i686.patch),
> "crosstool-ng-1.10.0 glibc-march-i686.patch"
> diff -urN crosstool-ng-1.9.1.orig/patches/glibc/2.12.2/900-march-i686.patch crosstool-ng-1.9.1/patches/glibc/2.12.2/900-march-i686.patch
> --- crosstool-ng-1.9.1.orig/patches/glibc/2.12.2/900-march-i686.patch	1970-01-01 01:00:00.000000000 +0100
> +++ crosstool-ng-1.9.1/patches/glibc/2.12.2/900-march-i686.patch	2010-12-30 11:38:15.164087355 +0100
> @@ -0,0 +1,34 @@
> +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
> +
> +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
> +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
> +
> +diff -urN glibc-2.12.2.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.12.2/nptl/sysdeps/pthread/pt-initfini.c
> +--- glibc-2.12.2.orig/nptl/sysdeps/pthread/pt-initfini.c	2009-10-30 18:17:08.000000000 +0100
> ++++ glibc-2.12.2/nptl/sysdeps/pthread/pt-initfini.c	2010-12-30 11:36:19.858708534 +0100
> +@@ -45,6 +45,11 @@
> + /* Embed an #include to pull in the alignment and .end directives. */
> + asm ("\n#include \"defs.h\"");
> + 
> ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
> ++asm ("\n#undef __i686");
> ++asm ("\n#define __i686 __i686");
> ++asm ("\n#endif");
> ++
> + /* The initial common code ends here. */
> + asm ("\n/*@HEADER_ENDS*/");
> + 
> +diff -urN glibc-2.12.2.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.12.2/sysdeps/unix/sysv/linux/i386/sysdep.h
> +--- glibc-2.12.2.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-10-30 18:17:08.000000000 +0100
> ++++ glibc-2.12.2/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-12-30 11:36:19.858708534 +0100
> +@@ -29,6 +29,10 @@
> + #include <dl-sysdep.h>
> + #include <tls.h>
> + 
> ++#if defined __i686 && defined __ASSEMBLER__
> ++#undef __i686
> ++#define __i686 __i686
> ++#endif
> + 
> + /* For Linux we can use the system call table in the header file
> + 	/usr/include/asm/unistd.h
> diff -urN crosstool-ng-1.9.1.orig/patches/glibc/2.12.1/900-march-i686.patch crosstool-ng-1.9.1/patches/glibc/2.12.1/900-march-i686.patch
> --- crosstool-ng-1.9.1.orig/patches/glibc/2.12.1/900-march-i686.patch	1970-01-01 01:00:00.000000000 +0100
> +++ crosstool-ng-1.9.1/patches/glibc/2.12.1/900-march-i686.patch	2010-12-30 11:38:15.164087355 +0100
> @@ -0,0 +1,34 @@
> +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
> +
> +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
> +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
> +
> +diff -urN glibc-2.12.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.12.1/nptl/sysdeps/pthread/pt-initfini.c
> +--- glibc-2.12.1.orig/nptl/sysdeps/pthread/pt-initfini.c	2009-10-30 18:17:08.000000000 +0100
> ++++ glibc-2.12.1/nptl/sysdeps/pthread/pt-initfini.c	2010-12-30 11:36:19.858708534 +0100
> +@@ -45,6 +45,11 @@
> + /* Embed an #include to pull in the alignment and .end directives. */
> + asm ("\n#include \"defs.h\"");
> + 
> ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
> ++asm ("\n#undef __i686");
> ++asm ("\n#define __i686 __i686");
> ++asm ("\n#endif");
> ++
> + /* The initial common code ends here. */
> + asm ("\n/*@HEADER_ENDS*/");
> + 
> +diff -urN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.12.1/sysdeps/unix/sysv/linux/i386/sysdep.h
> +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-10-30 18:17:08.000000000 +0100
> ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-12-30 11:36:19.858708534 +0100
> +@@ -29,6 +29,10 @@
> + #include <dl-sysdep.h>
> + #include <tls.h>
> + 
> ++#if defined __i686 && defined __ASSEMBLER__
> ++#undef __i686
> ++#define __i686 __i686
> ++#endif
> + 
> + /* For Linux we can use the system call table in the header file
> + 	/usr/include/asm/unistd.h
> diff -urN crosstool-ng-1.9.1.orig/patches/glibc/2.11.1/900-march-i686.patch crosstool-ng-1.9.1/patches/glibc/2.11.1/900-march-i686.patch
> --- crosstool-ng-1.9.1.orig/patches/glibc/2.11.1/900-march-i686.patch	1970-01-01 01:00:00.000000000 +0100
> +++ crosstool-ng-1.9.1/patches/glibc/2.11.1/900-march-i686.patch	2010-12-30 11:38:22.794443287 +0100
> @@ -0,0 +1,34 @@
> +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
> +
> +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
> +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
> +
> +diff -urN glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
> +--- glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c	2010-12-30 11:33:31.520855595 +0100
> +@@ -45,6 +45,11 @@
> + /* Embed an #include to pull in the alignment and .end directives. */
> + asm ("\n#include \"defs.h\"");
> + 
> ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
> ++asm ("\n#undef __i686");
> ++asm ("\n#define __i686 __i686");
> ++asm ("\n#endif");
> ++
> + /* The initial common code ends here. */
> + asm ("\n/*@HEADER_ENDS*/");
> + 
> +diff -urN glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
> +--- glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-12-30 11:33:31.520855595 +0100
> +@@ -29,6 +29,10 @@
> + #include <dl-sysdep.h>
> + #include <tls.h>
> + 
> ++#if defined __i686 && defined __ASSEMBLER__
> ++#undef __i686
> ++#define __i686 __i686
> ++#endif
> + 
> + /* For Linux we can use the system call table in the header file
> + 	/usr/include/asm/unistd.h
> diff -urN crosstool-ng-1.9.1.orig/patches/glibc/2.11/900-march-i686.patch crosstool-ng-1.9.1/patches/glibc/2.11/900-march-i686.patch
> --- crosstool-ng-1.9.1.orig/patches/glibc/2.11/900-march-i686.patch	1970-01-01 01:00:00.000000000 +0100
> +++ crosstool-ng-1.9.1/patches/glibc/2.11/900-march-i686.patch	2010-12-30 11:38:22.794443287 +0100
> @@ -0,0 +1,34 @@
> +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
> +
> +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
> +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
> +
> +diff -urN glibc-2.11.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11/nptl/sysdeps/pthread/pt-initfini.c
> +--- glibc-2.11.orig/nptl/sysdeps/pthread/pt-initfini.c	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.11/nptl/sysdeps/pthread/pt-initfini.c	2010-12-30 11:33:31.520855595 +0100
> +@@ -45,6 +45,11 @@
> + /* Embed an #include to pull in the alignment and .end directives. */
> + asm ("\n#include \"defs.h\"");
> + 
> ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
> ++asm ("\n#undef __i686");
> ++asm ("\n#define __i686 __i686");
> ++asm ("\n#endif");
> ++
> + /* The initial common code ends here. */
> + asm ("\n/*@HEADER_ENDS*/");
> + 
> +diff -urN glibc-2.11.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11/sysdeps/unix/sysv/linux/i386/sysdep.h
> +--- glibc-2.11.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.11/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-12-30 11:33:31.520855595 +0100
> +@@ -29,6 +29,10 @@
> + #include <dl-sysdep.h>
> + #include <tls.h>
> + 
> ++#if defined __i686 && defined __ASSEMBLER__
> ++#undef __i686
> ++#define __i686 __i686
> ++#endif
> + 
> + /* For Linux we can use the system call table in the header file
> + 	/usr/include/asm/unistd.h
> diff -urN crosstool-ng-1.9.1.orig/patches/glibc/2.10.1/900-march-i686.patch crosstool-ng-1.9.1/patches/glibc/2.10.1/900-march-i686.patch
> --- crosstool-ng-1.9.1.orig/patches/glibc/2.10.1/900-march-i686.patch	1970-01-01 01:00:00.000000000 +0100
> +++ crosstool-ng-1.9.1/patches/glibc/2.10.1/900-march-i686.patch	2010-12-30 11:38:22.794443287 +0100
> @@ -0,0 +1,34 @@
> +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
> +
> +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
> +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
> +
> +diff -urN glibc-2.10.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c
> +--- glibc-2.10.1.orig/nptl/sysdeps/pthread/pt-initfini.c	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c	2010-12-30 11:33:31.520855595 +0100
> +@@ -45,6 +45,11 @@
> + /* Embed an #include to pull in the alignment and .end directives. */
> + asm ("\n#include \"defs.h\"");
> + 
> ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
> ++asm ("\n#undef __i686");
> ++asm ("\n#define __i686 __i686");
> ++asm ("\n#endif");
> ++
> + /* The initial common code ends here. */
> + asm ("\n/*@HEADER_ENDS*/");
> + 
> +diff -urN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.10.1/sysdeps/unix/sysv/linux/i386/sysdep.h
> +--- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-12-30 11:33:31.520855595 +0100
> +@@ -29,6 +29,10 @@
> + #include <dl-sysdep.h>
> + #include <tls.h>
> + 
> ++#if defined __i686 && defined __ASSEMBLER__
> ++#undef __i686
> ++#define __i686 __i686
> ++#endif
> + 
> + /* For Linux we can use the system call table in the header file
> + 	/usr/include/asm/unistd.h
> diff -urN crosstool-ng-1.9.1.orig/patches/glibc/2.9/900-march-i686.patch crosstool-ng-1.9.1/patches/glibc/2.9/900-march-i686.patch
> --- crosstool-ng-1.9.1.orig/patches/glibc/2.9/900-march-i686.patch	1970-01-01 01:00:00.000000000 +0100
> +++ crosstool-ng-1.9.1/patches/glibc/2.9/900-march-i686.patch	2010-12-30 11:38:22.794443287 +0100
> @@ -0,0 +1,34 @@
> +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
> +
> +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
> +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
> +
> +diff -urN glibc-2.9.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.9/nptl/sysdeps/pthread/pt-initfini.c
> +--- glibc-2.9.orig/nptl/sysdeps/pthread/pt-initfini.c	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.9/nptl/sysdeps/pthread/pt-initfini.c	2010-12-30 11:33:31.520855595 +0100
> +@@ -45,6 +45,11 @@
> + /* Embed an #include to pull in the alignment and .end directives. */
> + asm ("\n#include \"defs.h\"");
> + 
> ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
> ++asm ("\n#undef __i686");
> ++asm ("\n#define __i686 __i686");
> ++asm ("\n#endif");
> ++
> + /* The initial common code ends here. */
> + asm ("\n/*@HEADER_ENDS*/");
> + 
> +diff -urN glibc-2.9.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.9/sysdeps/unix/sysv/linux/i386/sysdep.h
> +--- glibc-2.9.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-12-08 21:10:20.000000000 +0100
> ++++ glibc-2.9/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-12-30 11:33:31.520855595 +0100
> +@@ -29,6 +29,10 @@
> + #include <dl-sysdep.h>
> + #include <tls.h>
> + 
> ++#if defined __i686 && defined __ASSEMBLER__
> ++#undef __i686
> ++#define __i686 __i686
> ++#endif
> + 
> + /* For Linux we can use the system call table in the header file
> + 	/usr/include/asm/unistd.h
> 
> 
> 
> YMMV.
> 
> /Esben
> 
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq



--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list