DENX . DULG . UBootDoesntRunAfterUpgradingMyCompiler

14.2.10. U-Boot Doesn't Run after Upgrading my Compiler

Question:
I encountered a big problem that u-boot 1.1.4 compiled by eldk 4.1 for mpc82xx crashed.

But if I build it using gcc-3.4.6 based cross tools, u-boot on my board boots correctly.

u-boot built by eldk 4.1 (gcc-4.0) failed, nothing occurs on the serial port.

Answer:
This is often a missing volatile attribute on shared variable references, particularly hardware registers. Newer compiler versions optimize more aggressively, making missing volatile attributes visible.

If you use -O0 (no optimization) does it fix the problem? If it does, it most likely is an optimization/volatile issue. The hard part figuring out where. Device handling and board-specific code is the place to start.

----- Revision r1.1 - 20 Mar 2007 - 18:14 - JerryVanBaren
Copyright © 2002-2020 by DENX Software Engineering