[yocto] Adding debug output in recipe

Raymond Yeung rksyeung at hotmail.com
Fri Apr 6 15:31:48 PDT 2018


You're right on.  KERNEL_CC was used.  The 3rd party code actually has 3 components -


  1.  a kernel module
  2.  a shared library
  3.  2 demo binaries


Their top-level makefile builds everything.  From Yocto's perspective, it interfaces with this code as though the whole thing is a kernel module.  There may be adversed implication to the shared library if I were to use the KERNEL_CC variable.  So, I'm thinking of modifying the 3rd party makefile to support separate builds.


What documentation/section I should look into for patching the makefile (minimize changes to original vendor files)?


Thanks,

Raymond


________________________________
From: Anuj Mittal <anuj.mittal at intel.com>
Sent: Thursday, April 5, 2018 11:39 PM
To: Raymond Yeung; yocto at yoctoproject.org
Subject: Re: [yocto] Adding debug output in recipe

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
Yocto Project Linux Kernel Development Manual<https://www.yoctoproject.org/docs/latest/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules>
www.yoctoproject.org
Kernel modification involves changing the Yocto Project kernel, which could involve changing configuration options as well as adding new kernel recipes.




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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180406/3bd6b437/attachment.html>


More information about the yocto mailing list