[poky] [PATCH 3/3] u-boot: compile with -O2 on PowerPC

Ilya Yanok yanok at emcraft.com
Wed Feb 9 15:21:17 PST 2011


Hi Darren,

09.02.2011 20:42, Darren Hart wrote:
> This is already disabled in u-boot.inc with the following line:
>
> # GCC 4.5.1 builds unusable binaries using -Os, remove it from OPTFLAGS
> EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS=''"

Yes, sorry, I've useed not up-to-date version of metadata and missed 
this fix. But it has to be '-O2' still.

> Resetting OPTFLAGS to '' removes the -Os from the variable in the
> Makefile. This isn't just a PowerPC problem, it also manifested on ARM,
> I believe it is a GCC 4.5.1 issue.

Well, the difference here is that on PowerPC we have -Os option disabled 
completely. Wolfgang tried to summarize know gcc bugs and seems like -Os 
bugs on ARM and PowerPC have different nature (it looks like bugs on ARM 
are already fixed while on the ones PowerPC are not).
Then I think it's a bad idea to remove -Os everywhere: U-Boot really 
wants to be built with -Os optimization so we might want to change 
optimization level to -O2 only for targets where it's absolutely 
required. Actually I was able to build and successfully run U-Boot on 
beagleboard with -Os so it doesn't look like it's completely broken on ARM.

Regards, Ilya.




More information about the poky mailing list