U-boot is broken with -O0?

Tom Rini trini at konsulko.com
Tue Nov 9 20:37:33 CET 2021

On Tue, Nov 09, 2021 at 02:34:41PM -0500, Sean Anderson wrote:
> Hi Oleh,
> On 11/9/21 2:31 PM, Oleh Kravchenko wrote:
> > Hello Tom,
> > for what reason it's not supported?
> > 
> > I'm finding that very useful for debugging.
> Perhaps try -Og

Yes.  There are several places where we rely on the code being optimized
at run time, if memory serves me correctly.  And unless you're debugging
a compiler problem, disabling optimization is the wrong way to go,
modern debuggers (with debug symbols available of course) will see
what's going on and tell you so just fine.  If you have some specific
area of code / file, you might be able to get away with disabling
optimization there alone.  But no, in these times "disable optimization,
fire up the debugger" just isn't the right path.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20211109/a3bebd36/attachment.sig>

More information about the U-Boot mailing list