* [PATCH] gcc-configure-target: Set native-system-header-dir for target gcc
@ 2012-08-01 8:07 Richard Purdie
2012-08-01 15:09 ` Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2012-08-01 8:07 UTC (permalink / raw)
To: openembedded-core
Without this set, in the case host=target (which it does for on-target
gcc), the native header directory is set to the target sysroot with
no prefix. This means it would look for sdt.h on the build system
instead of in the target headers and this can lead to build failures
and is host contamination of the build.
The correct fix is to explicitly set the native header directory to
the correct location and then the headers get detected correctly.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/recipes-devtools/gcc/gcc-configure-target.inc b/meta/recipes-devtools/gcc/gcc-configure-target.inc
index b2f91b7..f41301f 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-target.inc
@@ -3,4 +3,5 @@ require gcc-configure-common.inc
EXTRA_OECONF_PATHS = " \
--with-sysroot=/ \
--with-build-sysroot=${STAGING_DIR_TARGET} \
+ --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
--with-gxx-include-dir=${includedir}/c++/"
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] gcc-configure-target: Set native-system-header-dir for target gcc
2012-08-01 8:07 [PATCH] gcc-configure-target: Set native-system-header-dir for target gcc Richard Purdie
@ 2012-08-01 15:09 ` Khem Raj
2012-08-02 20:01 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2012-08-01 15:09 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, Aug 1, 2012 at 1:07 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Without this set, in the case host=target (which it does for on-target
> gcc), the native header directory is set to the target sysroot with
> no prefix. This means it would look for sdt.h on the build system
> instead of in the target headers and this can lead to build failures
> and is host contamination of the build.
>
> The correct fix is to explicitly set the native header directory to
> the correct location and then the headers get detected correctly.
one concern I think is what will happen to gxxinclude dir if this is
set. if it will become relative to native headers dir as well
I think you have to try it out the compiler on target
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> diff --git a/meta/recipes-devtools/gcc/gcc-configure-target.inc b/meta/recipes-devtools/gcc/gcc-configure-target.inc
> index b2f91b7..f41301f 100644
> --- a/meta/recipes-devtools/gcc/gcc-configure-target.inc
> +++ b/meta/recipes-devtools/gcc/gcc-configure-target.inc
> @@ -3,4 +3,5 @@ require gcc-configure-common.inc
> EXTRA_OECONF_PATHS = " \
> --with-sysroot=/ \
> --with-build-sysroot=${STAGING_DIR_TARGET} \
> + --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
> --with-gxx-include-dir=${includedir}/c++/"
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] gcc-configure-target: Set native-system-header-dir for target gcc
2012-08-01 15:09 ` Khem Raj
@ 2012-08-02 20:01 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-08-02 20:01 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, 2012-08-01 at 08:09 -0700, Khem Raj wrote:
> On Wed, Aug 1, 2012 at 1:07 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > Without this set, in the case host=target (which it does for on-target
> > gcc), the native header directory is set to the target sysroot with
> > no prefix. This means it would look for sdt.h on the build system
> > instead of in the target headers and this can lead to build failures
> > and is host contamination of the build.
> >
> > The correct fix is to explicitly set the native header directory to
> > the correct location and then the headers get detected correctly.
>
> one concern I think is what will happen to gxxinclude dir if this is
> set. if it will become relative to native headers dir as well
> I think you have to try it out the compiler on target
I tested the target compiler and couldn't find any problem. I also
checked the output of strings on the gcc binaries/libs/headers and
couldn't spot anything nasty. I've therefore merged this but we should
keep it in mind in case of problems.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-02 20:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-01 8:07 [PATCH] gcc-configure-target: Set native-system-header-dir for target gcc Richard Purdie
2012-08-01 15:09 ` Khem Raj
2012-08-02 20:01 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox