<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change Yocto Project Kernel Compile Optimization Level in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770444#M119620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp; Please try to build k&lt;SPAN class=""&gt;ernel without Yocto:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;A href="https://community.nxp.com/docs/DOC-334814"&gt;https://community.nxp.com/docs/DOC-334814&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2017 04:06:26 GMT</pubDate>
    <dc:creator>Yuri</dc:creator>
    <dc:date>2017-12-07T04:06:26Z</dc:date>
    <item>
      <title>Change Yocto Project Kernel Compile Optimization Level</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770443#M119619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to debug a kernel module and as such, need to compile it without optimizations.&amp;nbsp; I'm using the Yocto Project and can't get the module to compile with a -O0 flag despite trying several things.&amp;nbsp; So far I've tried adding the following to my local.conf.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"&lt;/P&gt;&lt;P&gt;INHIBIT_PACKAGE_STRIP = "1"&lt;BR /&gt;DEBUG_BUILD = "1"&lt;/P&gt;&lt;P&gt;PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've also added the following to my kernel recipe in addition to the changes above.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;DEBUG_FLAGS += "-O0"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;None of this has worked.&amp;nbsp; If I run objdump -g on the .ko file in question I still find -O2 is being used.&amp;nbsp; This leads to the debugger jumping all around when I'm trying to step through source.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way to override the kernel compile optimization level in the Yocto Project?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For kernel module debugging I'm following this guide from DS-MDK and the imx_rpmsg_tty module.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www2.keil.com/docs/default-source/default-document-library/gs_ds-mdk_5_27_r1.pdf?sfvrsn=2" title="http://www2.keil.com/docs/default-source/default-document-library/gs_ds-mdk_5_27_r1.pdf?sfvrsn=2"&gt;http://www2.keil.com/docs/default-source/default-document-library/gs_ds-mdk_5_27_r1.pdf?sfvrsn=2&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with this SOM.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.compulab.com/products/computer-on-modules/cl-som-imx7-freescale-i-mx-7-system-on-module/#overview" title="http://www.compulab.com/products/computer-on-modules/cl-som-imx7-freescale-i-mx-7-system-on-module/#overview"&gt;CL-SOM-iMX7 | NXP (Freescale) i.MX 7 | System-on-Module | Computer-on-Module | CompuLab&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached my local.conf, my kernel recipe, and my kernel .config.&amp;nbsp; Let me know if you need any more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 00:04:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770443#M119619</guid>
      <dc:creator>jamesburnworth</dc:creator>
      <dc:date>2017-12-07T00:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Change Yocto Project Kernel Compile Optimization Level</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770444#M119620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp; Please try to build k&lt;SPAN class=""&gt;ernel without Yocto:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;A href="https://community.nxp.com/docs/DOC-334814"&gt;https://community.nxp.com/docs/DOC-334814&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 04:06:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770444#M119620</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2017-12-07T04:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change Yocto Project Kernel Compile Optimization Level</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770445#M119621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/YuriMuhin_ng"&gt;YuriMuhin_ng&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response.&amp;nbsp; I tried building the kernel outside of Yocto and was able to eventually get it working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made and installed two SDK's, one with debug options enable in the local.conf mentioned above and one without.&amp;nbsp; After running&amp;nbsp;the environment-setup script for the debug SDK I echo'd my CFLAGS variable.&amp;nbsp; It had a -O (which goes to a -O1) in it so I appended a -O0.&amp;nbsp; I copied over my .config and ran make.&amp;nbsp; This didn't work, the kernel object was still being compiled with -O2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eventually I added the following line to the Makefile in the directory with the kernel module.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;CFLAGS_imx_rpmsg_tty.o := -O0&lt;/BLOCKQUOTE&gt;&lt;P&gt;After adding that, the module compiled with -O0 and the debugging experience was fixed.&amp;nbsp; Interestingly it also worked when I used the environment-setup script for the regular SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point I guess I still have a few questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is this an appropriate way to modify a Makefile and was it the right Makefile to modify?&lt;/LI&gt;&lt;LI&gt;Could I make a similar change in Yocto so that we could trigger a system wide debug build?&amp;nbsp; This process involved quite a few manual steps that wouldn't be ideal for a development cycle.&lt;/LI&gt;&lt;LI&gt;And still the original question, is there a way to set the optimization level of a kernel module with Yocto variables or settings?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 23:32:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Change-Yocto-Project-Kernel-Compile-Optimization-Level/m-p/770445#M119621</guid>
      <dc:creator>jamesburnworth</dc:creator>
      <dc:date>2017-12-07T23:32:54Z</dc:date>
    </item>
  </channel>
</rss>

