<?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>S32KのトピックRe: Building the RTD with GCC Space Optimization</title>
    <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2297694#M56264</link>
    <description>&lt;P&gt;I encountered this exact issue after creating my own CMake project using "-O0" optimization for my Debug build, and wasted time figuring out what was wrong (thank you,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/251884"&gt;@greenwichmeanie&lt;/a&gt;&amp;nbsp;for posting this topic, which saved me some time in confirming that the issue lies in the optimization level!). It appears that the issue may be related to the implementation of the "#pragma GCC section" patches NXP applies to GCC and how they behave with different optimization levels.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201913"&gt;@VaneB&lt;/a&gt;: Above, you claim,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Additionally, each RTD release note specifies the optimization level used during development and testing; most RTD releases have been validated with -Os/-Osize.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;While I understand you can't feasibly test and validate every possible combination of compilation flags, I believe it is reasonable to expect to be able to build and debug with no optimization (-O0). Being forced to debug a binary compiled with -Os is challenging, as the compiler inlines many functions and reorders code. I would appreciate it if you could pass on a request to support compiling with the "-O0" optimization level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jan 2026 02:18:37 GMT</pubDate>
    <dc:creator>jleveque</dc:creator>
    <dc:date>2026-01-22T02:18:37Z</dc:date>
    <item>
      <title>Building the RTD with GCC Space Optimization</title>
      <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2204641#M54455</link>
      <description>&lt;P&gt;We're using the NXP GCC 11.4 compiler and have created our own CMake build. The compilation flags were lifted from the Design Studio project. It builds and runs but if we remove the `-Os` flag we see hard faults. I wouldn't expect the removal of an optimization to change the behavior of the code (let along cause it to crash). I'd like to understand why this is. We have a functional safety application and it'll be important to understand and document this.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 17:51:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2204641#M54455</guid>
      <dc:creator>greenwichmeanie</dc:creator>
      <dc:date>2025-11-13T17:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Building the RTD with GCC Space Optimization</title>
      <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2204697#M54460</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/251884"&gt;@greenwichmeanie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that none of the currently available RTD versions for S32K devices (S32K1 and S32K3) support NXP GCC 11.4. Additionally, each RTD release note specifies the optimization level used during development and testing; most RTD releases have been validated with -Os/-Osize.&lt;/P&gt;
&lt;P&gt;Therefore, we cannot guarantee the functionality of the drivers when using different optimization levels or toolchains than those originally tested. Furthermore, any modifications to the RTD fall outside the scope of our support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, VaneB&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 21:32:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2204697#M54460</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2025-11-13T21:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Building the RTD with GCC Space Optimization</title>
      <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2204743#M54464</link>
      <description>&lt;P&gt;Thanks VaneB. Point taken. We'll take a look at the release notes but I have no reason not to believe you.&lt;/P&gt;&lt;P&gt;For what it's worth we tracked this down. If a couple of specific optimization flags are removed (from the collection included when using -Os) then the variable below is not initialized by the C runtime initialization. It remains set to null by the time `main()` is reached (which is obviously a problem). Happens with GCC 10.2 and 11.4. If we halt the debugger and punch that address in then things are fine.&lt;/P&gt;&lt;P&gt;That assignment was happening before the definition of&amp;nbsp;&lt;SPAN&gt;Clock_Ip_CodeInRamSetFlashWaitStates. If we move the assignment after all is well.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;#ifdef&amp;nbsp;CLOCK_IP_HAS_FLASH_WAIT_STATES&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;static&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;SetFlashWaitStatesCallbackType&amp;nbsp;Clock_Ip_SetFlashWaitStatesCallback&amp;nbsp;=&amp;nbsp;&amp;amp;Clock_Ip_CodeInRamSetFlashWaitStates;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;/*&amp;nbsp;Set&amp;nbsp;Flash&amp;nbsp;Wait&amp;nbsp;States&amp;nbsp;callback&amp;nbsp;*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 14 Nov 2025 00:46:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2204743#M54464</guid>
      <dc:creator>greenwichmeanie</dc:creator>
      <dc:date>2025-11-14T00:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Building the RTD with GCC Space Optimization</title>
      <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2205346#M54506</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/251884"&gt;@greenwichmeanie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for sharing your findings.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 17:59:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2205346#M54506</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2025-11-14T17:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Building the RTD with GCC Space Optimization</title>
      <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2297694#M56264</link>
      <description>&lt;P&gt;I encountered this exact issue after creating my own CMake project using "-O0" optimization for my Debug build, and wasted time figuring out what was wrong (thank you,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/251884"&gt;@greenwichmeanie&lt;/a&gt;&amp;nbsp;for posting this topic, which saved me some time in confirming that the issue lies in the optimization level!). It appears that the issue may be related to the implementation of the "#pragma GCC section" patches NXP applies to GCC and how they behave with different optimization levels.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201913"&gt;@VaneB&lt;/a&gt;: Above, you claim,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Additionally, each RTD release note specifies the optimization level used during development and testing; most RTD releases have been validated with -Os/-Osize.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;While I understand you can't feasibly test and validate every possible combination of compilation flags, I believe it is reasonable to expect to be able to build and debug with no optimization (-O0). Being forced to debug a binary compiled with -Os is challenging, as the compiler inlines many functions and reorders code. I would appreciate it if you could pass on a request to support compiling with the "-O0" optimization level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2026 02:18:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2297694#M56264</guid>
      <dc:creator>jleveque</dc:creator>
      <dc:date>2026-01-22T02:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Building the RTD with GCC Space Optimization</title>
      <link>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2318572#M56829</link>
      <description>I second this. Building with -O0 is a default goto when debugging code issues to avoid getting confused by compiler artefacts, but not on S32K3.</description>
      <pubDate>Mon, 16 Feb 2026 12:24:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Building-the-RTD-with-GCC-Space-Optimization/m-p/2318572#M56829</guid>
      <dc:creator>Henrik-Wires</dc:creator>
      <dc:date>2026-02-16T12:24:37Z</dc:date>
    </item>
  </channel>
</rss>

