From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "poky@pokylinux.org" <poky@pokylinux.org>
Subject: Re: about ${KERNEL_CC} and ${CC}
Date: Thu, 23 Dec 2010 09:44:30 +0000 [thread overview]
Message-ID: <1293097470.1588.567.camel@rex> (raw)
In-Reply-To: <625BA99ED14B2D499DC4E29D8138F1504D5F6A48BD@shsmsx502.ccr.corp.intel.com>
On Thu, 2010-12-23 at 14:11 +0800, Tian, Kevin wrote:
> I'm a bit confused why a specific ${KERNEL_CC} is introduced instead of
> reusing ${CC}, especially when two are defined differently:
>
> <kernel.bbclass>
> KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}"
>
> <bitbake.conf>
> export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
> TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
>
> I'm not sure whether kernel build requires "--sysroot" option, but it looks that it works well
> so far even without that option (why?)
The kernel doesn't link against system libraries or use system header
files so it really doesn't matter whether it sees the sysroot or not.
We use a different CC for the kernel so the user has the option of using
a different compiler version for this. Whilst its a lot less common now,
there were once use cases where the kernel would be compiled with one
version of gcc and the userspace with a different version.
> However this causes one issue under sstate, if the whole toolchain is installed from sstate
> packages which are built from another machine. In such case the default path (decided at
> compilation time) of gcc also points to the path on another machine, which is missing in
> current machine doing build. Perf compilation is:
>
> do_compile_perf() {
> oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix}
> }
>
> Without an explicit "--sysroot" options, perf compilation is broken due to failing to check some
> header files like gnu/libc-version.h. I can workaround it by:
>
> do_compile_perf() {
> oe_runmake -C ${S}/tools/perf CC="${CC}" LD="${LD}" AR="${AR}" prefix=${prefix}
> }
Perf should be compiled with the userspace toolchain, not the kernel
one. I'd say this fix is therefore correct.
Adding TOOLCHAIN_OPTIONS to KERNEL_CC would also probably be a good idea
too.
Cheers,
Richard
next prev parent reply other threads:[~2010-12-23 9:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-23 6:11 about ${KERNEL_CC} and ${CC} Tian, Kevin
2010-12-23 9:44 ` Richard Purdie [this message]
2010-12-23 12:27 ` Gary Thomas
2010-12-24 1:01 ` Tian, Kevin
2010-12-30 10:21 ` Richard Purdie
2010-12-30 18:02 ` Gary Thomas
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=1293097470.1588.567.camel@rex \
--to=richard.purdie@linuxfoundation.org \
--cc=kevin.tian@intel.com \
--cc=poky@pokylinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.