From: Bruce Ashfield <bruce.ashfield@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
openembedded-core <openembedded-core@lists.openembedded.org>
Cc: "Hart, Darren" <darren.hart@intel.com>
Subject: Re: [PATCH] perf: Fix sysroot option to CC handling
Date: Thu, 10 Apr 2014 09:22:52 -0400 [thread overview]
Message-ID: <53469B2C.5050407@windriver.com> (raw)
In-Reply-To: <1397120750.24597.238.camel@ted>
On 14-04-10 05:05 AM, Richard Purdie wrote:
> If you build perf in tree /xxx/treea, then cleansstate perf and build it
> in /xxx/treeb having deleted treea, the build will fail, unable to find libc.
>
> The problem is that the --sysroot option passed in through CC is missing.
> This works fine if the default sysroot is ok, if it isn't, things will fail.
> In 1.7 we'll start poisoning the default sysroot in gcc to catch this kind of
> issue however that doesn't fix the problem with perf.
>
> The problem is that various Makefiles set CC = $(CROSS_COMPILE)gcc. The
> easist fix for now is to sed out the problematic Makefile lines. Its worth
> noting the tools/lib/traceevent Makefile has a much more funky way of setting
> CC which works for us and may be the way we need to fix the other Makefiles
> upstream.
>
> This fixes build failures we're occasionally seen on the autobuilders.
I've bounced back and forth a few times with the way that CC is assigned
in the perf Makefiles versus it being taken from our environment
variables .. and of course the flags that are passed to gcc (as you well
know).
This looks simple enough and it'll work. The alternatives wouldn't have
been doable with replacements .. and hence we'd only be able to patch
and fix linux-yocto out of the box. So not a good idea.
We'll have to take the discussion to lkml to get this fixed in tree, but
this wouldn't be the first time :)
Tomz: did you want to try that ? Nothing immediate, but I wouldn't want
it to fall completely off the radar.
Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
> index 9dfccdf..ef21b6c 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -133,6 +133,18 @@ do_configure_prepend () {
> if [ -e "${S}/tools/perf/config/Makefile" ]; then
> sed -i 's,libdir = $(prefix)/$(lib),libdir = $(prefix)/${baselib},' ${S}/tools/perf/config/Makefile
> fi
> + # We need to ensure the --sysroot option in CC is preserved
> + if [ -e "${S}/tools/perf/Makefile.perf" ]; then
> + sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
> + sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
> + fi
> + if [ -e "${S}/tools/lib/api/Makefile" ]; then
> + sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
> + sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile
> + fi
> + if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then
> + sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile
> + fi
> }
>
> python do_package_prepend() {
>
>
prev parent reply other threads:[~2014-04-10 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 9:05 [PATCH] perf: Fix sysroot option to CC handling Richard Purdie
2014-04-10 13:22 ` Bruce Ashfield [this message]
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=53469B2C.5050407@windriver.com \
--to=bruce.ashfield@windriver.com \
--cc=darren.hart@intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.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