Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Cc: Linaro Dev <linaro-dev@lists.linaro.org>,
	Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: OE gcc-cross with builtin sysroot, BUG?
Date: Wed, 11 Sep 2013 13:00:52 +0100	[thread overview]
Message-ID: <1378900852.3484.179.camel@ted> (raw)
In-Reply-To: <CAP71Wjynkd=CGry-YKvEetsuGvoXmhwhVAF1rXuOuo-nh7V2CQ@mail.gmail.com>

On Wed, 2013-09-11 at 12:29 +0200, Nicolas Dechesne wrote:
> our bug appeared because we were 'wrongly' unsetting the CFLAGS from
> OE in one of our recipe, so we would loose the following from our
> compilation command line
>
> -march=armv7-a
> -marm
> -mthumb-interwork
> -mfloat-abi=hard
> -mfpu=neon
> --sysroot=/work/rdk/build-genericarmv7a/tmp/sysroots/genericarmv7a

>
> The compilation error was that stdlib.h was not found. 
> 
> 
> as a matter of fact, we build for several different machines (.conf
> file), *but* we share the same sstate and downloads for all machines.
> We don't do parallel builds, each machine is built sequentially in its
> own build folder (.../workspace/machines/<MACHINE>/build), and all
> build folder are deleted before each build (of course sstate and
> downloads aren't deleted).
> 
> 
> What we noticed is that we end up pulling the compiler (gcc-cross)
> from sstate as expected. However we pull the same 'blob' from sstate
> for gcc-cross for *all* machines we build. It does seem that the
> compiler does not use $MACHINE for the sstate checksum. 
> 
> 
> When the gcc-cross package was built and pushed in sstate, it was
> being built for a specific machine (let's say MACHINE-A), hence the
> compiler has the 'builtin' sysroot set to 'tmp/sysroots/MACHINE-A'. 
>
> Now when building our image for MACHINE-B, we pull gcc-cross from
> sstate, and we get the default builtin sysroot for MACHINE-A!! That's
> why our build failed, because we tried to build MACHINE-B before
> MACHINE-A, so stdlib.h wasn't there yet on Jenkins..
>
> To me the problem is that gcc-cross 'embedds' some $MACHINE data in
> its package, but it is not marked as 'machine specific, but arch
> specific.  So several machines will end up sharing the same gcc-cross
> package.
>
> So, of course we shouldn't ignore the CFLAGS from OE, and the CFLAGS
> would set the right sysroot, and of course we fixed our software so
> that we don't ignore CFLAGS anymore... but that still looks like a bug
> to me.
> 
Not really, its actually intentionally designed like this since its
pointless rebuilding gcc-cross multiple time just because we want to use
it with a different sysroot. We therefore just pass in the arguments to
the compiler to ensure it uses the right one. If you remove them, you
hit the problems you describe.

We should probably compile in a bogus sysroot so it never works and
makes this kind of issue more visible.

Cheers,

Richard




  parent reply	other threads:[~2013-09-11 12:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 10:29 OE gcc-cross with builtin sysroot, BUG? Nicolas Dechesne
2013-09-11 11:33 ` Tomas Frydrych
2013-09-11 12:03   ` Richard Purdie
2013-09-11 12:00 ` Richard Purdie [this message]
2013-09-11 13:01   ` Nicolas Dechesne
2013-09-11 13:06     ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378900852.3484.179.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=nicolas.dechesne@linaro.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox