[yocto] Adding debug output in recipe

Anuj Mittal anuj.mittal at intel.com
Thu Apr 5 23:39:09 PDT 2018


On 04/06/2018 02:05 PM, Raymond Yeung wrote:
> Hi Anuj,
> 
> 
> "bitbake -e" is very useful for debugging out-of-tree build issue.
>  However, looks like I have another issue.  From "devtool build" output,
> I could see variables passed into makefile.  Let's focus on "CC" for now:
> 
> 
> CC=x86_64-poky-linux-gcc  -fuse-ld=bfd

I think that is the value of KERNEL_CC if you're inheriting module.bbclass.

> 
> 
> If we compare this to "bitbake -e" dump:
> 
> 
> export CC="x86_64-poky-linux-gcc  -m64 -march=corei7 -mtune=corei7
> -mfpmath=sse -msse4.2
> --sysroot=/a/ryeung/dev/yocto-git/yocto_build/build/tmp/sysroots/intel-corei7-64"
> 
> 
> You can see somehow the variable is modified.  Let's focus on --sysroot
> portion.  Without it, there seems to be no way for me to control
> LIBRARY_PATH's value.  The result is that the linker couldn't find
> crti.o and a few other files.  By manually adding back --sysroot
> portion, I could now get past this failure, onto the next.
> 
> 
> I suppose, as a possible final solution, I could do:
> 
> 
> $(CC) --sysroot=$(KERNEL_SRC) ...

This looks like a problem with your source Makefile. Please check the
variable that points to kernel sources in your Makefile.

Use EXTRA_OEMAKE += "<varname>='${STAGING_KERNEL_DIR}'" if the variable
name used in your Makefile is different from KERNEL_PATH or KERNEL_SRC.

You can also check run.do_compile file to see the exact compile steps.

Please see:

https://www.yoctoproject.org/docs/latest/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules

> 
> 
> I'm really looking for simpler, more intuitive solution.  What about the
> missing "-m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2" in the
> export?
> 
> 
> Raymond
> 
> 
> 
> 
> ------------------------------------------------------------------------
> *From:* Anuj Mittal <anuj.mittal at intel.com>
> *Sent:* Thursday, April 5, 2018 9:52 PM
> *To:* Raymond Yeung; yocto at yoctoproject.org
> *Subject:* Re: [yocto] Adding debug output in recipe
>  
> On 04/05/2018 03:33 PM, Raymond Yeung wrote:
>> Is there a way to add simple debug output (ideally don't need to control
>> debug level) to echo out values of variables?  I tried the bb.xxx
>> variants, but couldn't get them to work.
>> 
> 
> To find out what a variable is being set to, you can try:
> 
> bitbake -e <recipename>
> 
> Please see:
> 
> https://wiki.yoctoproject.org/wiki/Technical_FAQ#I_set_a_variable_but_it_doesn.27t_seem_to_be_having_an_effect.2C_how_do_I_fix_this.3F
> 
> Is that what you were looking for?




More information about the yocto mailing list