[poky] [PATCH 05/25] u-boot: disable -Os option not supported by gcc

Richard Purdie richard.purdie at linuxfoundation.org
Thu Jan 20 15:24:14 PST 2011


On Fri, 2011-01-21 at 00:05 +0100, Wolfgang Denk wrote:
> Dear Darren Hart,
> 
> In message <4D3884A0.8030602 at linux.intel.com> you wrote:
> >
> > I ran into this in the recent u-boot_git.bb recipe I added. Rather than 
> > create a patch to the Makefile, I found it simpler to adding OPTFLAGS to 
> > the EXTRA_OEMAKE variable in the recipe:
> > 
> > EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS=''"
> > 
> > This negates the -Os in the Makefile.
> 
> What exactly is the reason that -Os is not supported?

Its not so much not supported, its that gcc 4.5 seems to have totally
broken it and for better or worse, we're on that gcc version. Until we
have a toolchain where the option works what do we do?

> Note that -Os makes is intentional in U-Boot, and omitting it may
> cause problems on a number of systems.
> 
> -O2 will create significantly larger code which does not fit into
> flash sectors on some systems; on other systems, the code will not
> fit any more in the size limitations given by the NAND loader.
> 
> In other works, -O2 breaks a number of systems.
> 
> I discourage doing this.

Well, its a case of "totally broken" or a risk of size issues on some
systems so I'm in favour of the latter. I agree the toolchain issues
need to be resolved and I'm sure they will sooner or later. I have
noticed upstream gcc don't seem to like the -Os option though and it
often seems to be the source of problems...

Cheers,

Richard




More information about the poky mailing list