[OE-core] why do we poison -Os?

Xu, Dongxiao dongxiao.xu at intel.com
Wed Aug 24 01:47:15 UTC 2011


> -----Original Message-----
> From: Kumar Gala [mailto:galak at kernel.crashing.org]
> 
> If tinylogin is the only issue why modify/patch gcc?  I see we have
> meta/recipes-core/tinylogin/tinylogin-1.4/use_O2_option.patch to deal with
> this?

Yes, patch for tinylogin is to deal with the issue.
Besides that, we added this poison detection mechanism and suppose it should not affect functionality.
My understanding is that, if GCC is not configured with the ability of code space optimization, target recipes will not have code size benefit even if adding "-Os" option.

> 
> Not allowing -Os at all, which is our current situation on PPC is problematic.
> So trying to see if this issue is really limited to gcc 4.5 or not.  How can I
> reproduce it with current poky.git?

Not allowing -Os for PPC is because --enable-target-optspace is not enabled for PPC GCC. This is a known issue for PPC GCC 4.5.x.

I wonder if GCC 4.6.x has fixed this issue. If so, we should add "--enable-target-optspace" for PPC GCC again, thus -Os will be allowed for recipes.

Thanks,
Dongxiao

> 
> - k
> 
> On Aug 23, 2011, at 8:16 PM, Xu, Dongxiao wrote:
> 
> > Hi Kumar,
> >
> > The background of this commit is, when I upgraded PowerPC gcc to 4.5,
> tinylogin would crash with certain GCC build parameters.
> >
> > The root cause for that bug is, if enabled both "-frename-registers" and "-Os"
> options to build tinylogin in powerpc architecture, the tinylogin/getty
> application will encounter segmentation fault. Other combinations like
> "-frename-registers and -O2" or only "-Os" will not trigger this issue.
> >
> > Poky cross environment provides the "-frename-registers" parameter,
> however it does not provide -Os option since "--enable-target-optspace" option
> is disabled for powerpc gcc. The "-Os" option in tinylogin is added by its own
> Makefile.
> >
> > This commit is to prevent the above case. If --enable-target-optspace is
> disabled for GCC, "-Os" should not be added by recipe.
> >
> > Thanks,
> > Dongxiao
> >
> >> -----Original Message-----
> >> From: Kumar Gala [mailto:galak at kernel.crashing.org]
> >> Sent: Wednesday, August 24, 2011 8:53 AM
> >> To: Xu, Dongxiao
> >> Cc: Patches and discussions about the oe-core layer; Khem Raj
> >> Subject: why do we poison -Os?
> >>
> >> Dongxiao,
> >>
> >> Can you explain why this was needed:
> >>
> >> commit ce456306dad3fdf42494830011dacae213c48edf
> >> Author: Dongxiao Xu <dongxiao.xu at intel.com>
> >> Date:   Sat Sep 25 10:16:26 2010 +0800
> >>
> >>    gcc: enable poison parameters detection
> >>
> >>    If not configured with --enable-target-optspace, gcc will report
> >>    errors if there is '-Os' optimization in parameters.
> >>
> >>    This fixes [BUGID #342]
> >>
> >>    Also add "--enable-target-optspace" option to arm gcc configuration.
> >>
> >>    Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
> >>
> >>
> >> - k





More information about the Openembedded-core mailing list