packages/gcc:
authorHolger Freyther <zecke@selfish.org>
Tue, 16 May 2006 21:36:28 +0000 (21:36 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Tue, 16 May 2006 21:36:28 +0000 (21:36 +0000)
    Hack to make me rich and famous. Patch versions 3.4.4,
    4.0.0, 4.0.2, 4.1.0, 4.1.0-snapshot, 4.2-snapshot and
    activate the hack when cross compiling.
    gcc will abort if you call it with -I/usr/include or
    -I/opt/include or -I/sw/include.
    Apply the patch when fail-fast is in the OVERRIDES

12 files changed:
packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch [new file with mode: 0644]
packages/gcc/gcc-4.0.0/zecke-no-host-includes.patch [new file with mode: 0644]
packages/gcc/gcc-4.0.2/zecke-no-host-includes.patch [new file with mode: 0644]
packages/gcc/gcc-4.1-20060217/zecke-no-host-includes.patch [new file with mode: 0644]
packages/gcc/gcc-4.1.0/zecke-no-host-includes.patch [new file with mode: 0644]
packages/gcc/gcc-4.2-20060513/zecke-no-host-includes.patch [new file with mode: 0644]
packages/gcc/gcc_3.4.4.bb
packages/gcc/gcc_4.0.0.bb
packages/gcc/gcc_4.0.2.bb
packages/gcc/gcc_4.1-20060217.bb
packages/gcc/gcc_4.1.0.bb
packages/gcc/gcc_4.2-20060513.bb

diff --git a/packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch b/packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..069a965
--- /dev/null
@@ -0,0 +1,32 @@
+Index: gcc-3.4.4/gcc/c-incpath.c
+===================================================================
+--- gcc-3.4.4.orig/gcc/c-incpath.c     2004-05-31 12:37:47.000000000 +0200
++++ gcc-3.4.4/gcc/c-incpath.c  2006-05-15 20:07:31.000000000 +0200
+@@ -328,6 +328,27 @@
+   else
+     heads[chain] = p;
+   tails[chain] = p;
++
++
++#ifdef CROSS_COMPILE
++    /* A common error when cross compiling is including
++    host headers. This code below will try to fail fast
++    for cross compiling. Currently we consider /usr/include,
++    /opt/include and /sw/include as harmful.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              }
++      }
++#endif
+ }
+ /* Exported function to handle include chain merging, duplicate
diff --git a/packages/gcc/gcc-4.0.0/zecke-no-host-includes.patch b/packages/gcc/gcc-4.0.0/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..6afb10d
--- /dev/null
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c     2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c  2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+   p->construct = 0;
+   p->user_supplied_p = user_supplied_p;
++#ifdef CROSS_COMPILE
++    /* A common error when cross compiling is including
++    host headers. This code below will try to fail fast
++    for cross compiling. Currently we consider /usr/include,
++    /opt/include and /sw/include as harmful.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++               }
++      }
++#endif
++
+   add_cpp_dir_path (p, chain);
+ }
diff --git a/packages/gcc/gcc-4.0.2/zecke-no-host-includes.patch b/packages/gcc/gcc-4.0.2/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..6afb10d
--- /dev/null
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c     2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c  2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+   p->construct = 0;
+   p->user_supplied_p = user_supplied_p;
++#ifdef CROSS_COMPILE
++    /* A common error when cross compiling is including
++    host headers. This code below will try to fail fast
++    for cross compiling. Currently we consider /usr/include,
++    /opt/include and /sw/include as harmful.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++               }
++      }
++#endif
++
+   add_cpp_dir_path (p, chain);
+ }
diff --git a/packages/gcc/gcc-4.1-20060217/zecke-no-host-includes.patch b/packages/gcc/gcc-4.1-20060217/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..6afb10d
--- /dev/null
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c     2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c  2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+   p->construct = 0;
+   p->user_supplied_p = user_supplied_p;
++#ifdef CROSS_COMPILE
++    /* A common error when cross compiling is including
++    host headers. This code below will try to fail fast
++    for cross compiling. Currently we consider /usr/include,
++    /opt/include and /sw/include as harmful.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++               }
++      }
++#endif
++
+   add_cpp_dir_path (p, chain);
+ }
diff --git a/packages/gcc/gcc-4.1.0/zecke-no-host-includes.patch b/packages/gcc/gcc-4.1.0/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..6afb10d
--- /dev/null
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c     2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c  2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+   p->construct = 0;
+   p->user_supplied_p = user_supplied_p;
++#ifdef CROSS_COMPILE
++    /* A common error when cross compiling is including
++    host headers. This code below will try to fail fast
++    for cross compiling. Currently we consider /usr/include,
++    /opt/include and /sw/include as harmful.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++               }
++      }
++#endif
++
+   add_cpp_dir_path (p, chain);
+ }
diff --git a/packages/gcc/gcc-4.2-20060513/zecke-no-host-includes.patch b/packages/gcc/gcc-4.2-20060513/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..6afb10d
--- /dev/null
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c     2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c  2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+   p->construct = 0;
+   p->user_supplied_p = user_supplied_p;
++#ifdef CROSS_COMPILE
++    /* A common error when cross compiling is including
++    host headers. This code below will try to fail fast
++    for cross compiling. Currently we consider /usr/include,
++    /opt/include and /sw/include as harmful.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++               }
++      }
++#endif
++
+   add_cpp_dir_path (p, chain);
+ }
index 5be603f..2d04b0e 100644 (file)
@@ -26,5 +26,6 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
 
 SRC_URI += "file://gcc34-configure.in.patch;patch=1"
 SRC_URI += "file://gcc34-thumb-support.patch;patch=1"
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
 
 include gcc3-build.inc
index cb7bfea..af54c17 100644 (file)
@@ -11,5 +11,6 @@ include gcc-package.inc
 
 SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
        file://ldflags.patch;patch=1"
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
 
 include gcc4-build.inc
index 540af1c..7a8eba4 100644 (file)
@@ -23,5 +23,7 @@ SRC_URI_append = " file://100-uclibc-conf.patch;patch=1   \
                    file://800-arm-bigendian.patch;patch=1 \
                    file://zecke-host-cpp-ac-hack.patch;patch=1 "
 
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+
 
 include gcc4-build.inc
index da2c807..66880d7 100644 (file)
@@ -14,4 +14,6 @@ SRC_URI = "http://ftp.nluug.nl/languages/gcc/snapshots/4.1-20060217/gcc-4.1-2006
        file://arm-softfloat.patch;patch=1 \
        file://ldflags.patch;patch=1"
 
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+
 include gcc4-build.inc
index 27f6870..4d44978 100644 (file)
@@ -14,6 +14,8 @@ SRC_URI = "http://ftp.gnu.org/pub/gnu/gcc/gcc-4.1.0/gcc-4.1.0.tar.bz2 \
        file://arm-softfloat.patch;patch=1 \
        file://ldflags.patch;patch=1"
 
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+
 include gcc4-build.inc
 EXTRA_OECONF += "--disable-libssp"
 
index 9eb5465..68fa6d8 100644 (file)
@@ -14,6 +14,8 @@ SRC_URI = "http://ftp.nluug.nl/languages/gcc/snapshots/${PV}/gcc-${PV}.tar.bz2 \
        file://arm-softfloat.patch;patch=1 \
        file://ldflags.patch;patch=1"
 
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+
 include gcc4-build.inc
 EXTRA_OECONF += "--disable-libssp"