[poky] about ${KERNEL_CC} and ${CC}

Tian, Kevin kevin.tian at intel.com
Wed Dec 22 22:11:17 PST 2010


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?)

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}
}

Before going with that fix, I'd like to understand the difference between {KERNEL_CC} and
${CC} first, e.g. another option Is to simply attach TOOLCHAIN_OPTIONS to KERNEL_CC..

Thanks
Kevin



More information about the poky mailing list