[oe-commits] org.oe.oz354x gcc-cross: add patch to BUG on using host includes. Thx goes to Holger 'zecke' Freyther.

hrw commit openembedded-commits at lists.openembedded.org
Thu Nov 30 21:23:47 UTC 2006


gcc-cross: add patch to BUG on using host includes. Thx goes to Holger 'zecke' Freyther.

Author: hrw at openembedded.org
Branch: org.openembedded.oz354x
Revision: 97503cc2a7444e2a3cc29483934ea91acb54086b
ViewMTN: http://monotone.openembedded.org/revision.psp?id=97503cc2a7444e2a3cc29483934ea91acb54086b
Files:
1
packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch
packages/gcc/gcc_3.4.4.bb
Diffs:

#
# mt diff -r165d86fabc82365edb04456330bd3036fe44b9b7 -r97503cc2a7444e2a3cc29483934ea91acb54086b
#
# 
# 
# add_file "packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch"
#  content [f9bb092bee233fef27c916b5e818392a88e158a4]
# 
# patch "packages/gcc/gcc_3.4.4.bb"
#  from [8aa3c657c0e4cfc7c37d63bfd2a1c2128e1a8ebe]
#    to [ce1826b035c4c731766ccd2682654ecabc7f3239]
# 
============================================================
--- packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch	f9bb092bee233fef27c916b5e818392a88e158a4
+++ packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch	f9bb092bee233fef27c916b5e818392a88e158a4
@@ -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
============================================================
--- packages/gcc/gcc_3.4.4.bb	8aa3c657c0e4cfc7c37d63bfd2a1c2128e1a8ebe
+++ packages/gcc/gcc_3.4.4.bb	ce1826b035c4c731766ccd2682654ecabc7f3239
@@ -1,4 +1,4 @@
-PR = "r5"
+PR = "r6"
 DESCRIPTION = "The GNU cc and gcc C compilers."
 HOMEPAGE = "http://www.gnu.org/software/gcc/"
 SECTION = "devel"
@@ -26,5 +26,6 @@ SRC_URI += "file://gcc34-thumb-support.p
 
 SRC_URI += "file://gcc34-configure.in.patch;patch=1"
 SRC_URI += "file://gcc34-thumb-support.patch;patch=1"
+SRC_URI += " file://zecke-no-host-includes.patch;patch=1 "
 
 include gcc3-build.inc






More information about the Openembedded-commits mailing list