Patchwork gcc: add build directory to include directories

login
register
mail settings
Submitter Mark Hatle
Date May 31, 2013, 3:54 p.m.
Message ID <1370015692-22428-2-git-send-email-mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/51013/
State Accepted
Commit 2b47bce78536a800205b2385bba69038351545e5
Headers show

Comments

Mark Hatle - May 31, 2013, 3:54 p.m.
From: "Roy.Li" <rongqing.li@windriver.com>

[ CQID: WIND00386962 ]

Add build directory to include directories by -I${B}/include which will
be searched before standard system include directories.

Both libunwind and gcc supply unwind.h, once gcc use libunwind's unwind.h,
the compiling will fail.

This patch is generally not applicable to the upstream as they do not
use libunwind.

(LOCAL REV: NOT UPSTREAM)

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-devtools/gcc/gcc_4.7.bb | 2 +-
 meta/recipes-devtools/gcc/gcc_4.8.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Marcin Juszkiewicz - May 31, 2013, 4:02 p.m.
W dniu 31.05.2013 17:54, Mark Hatle pisze:
> From: "Roy.Li" <rongqing.li@windriver.com>
> 
> [ CQID: WIND00386962 ]
> 
> Add build directory to include directories by -I${B}/include which will
> be searched before standard system include directories.
> 
> Both libunwind and gcc supply unwind.h, once gcc use libunwind's unwind.h,
> the compiling will fail.
> 
> This patch is generally not applicable to the upstream as they do not
> use libunwind.
> 
> (LOCAL REV: NOT UPSTREAM)
> 
> Signed-off-by: Roy.Li <rongqing.li@windriver.com>
> Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>

Acked-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>

It works! Thanks a lot guys.

Patch

diff --git a/meta/recipes-devtools/gcc/gcc_4.7.bb b/meta/recipes-devtools/gcc/gcc_4.7.bb
index 9954375..f68c67a 100644
--- a/meta/recipes-devtools/gcc/gcc_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.7.bb
@@ -2,4 +2,4 @@  require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-configure-target.inc
 require gcc-package-target.inc
 
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ "
diff --git a/meta/recipes-devtools/gcc/gcc_4.8.bb b/meta/recipes-devtools/gcc/gcc_4.8.bb
index 9954375..f68c67a 100644
--- a/meta/recipes-devtools/gcc/gcc_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.8.bb
@@ -2,4 +2,4 @@  require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-configure-target.inc
 require gcc-package-target.inc
 
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ "