[OE-core] [master][dora][PATCH 1/2] perf: disallow debug optimization.

Mark Hatle mark.hatle at windriver.com
Thu Nov 21 14:48:10 UTC 2013


On 11/21/13, 8:35 AM, Richard Purdie wrote:
> On Thu, 2013-11-21 at 14:25 +0000, Phil Blundell wrote:
>> On Thu, 2013-11-21 at 01:33 -0600, Mark Hatle wrote:
>>> +def get_optimization(d):
>>> +    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
>>> +    if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
>>> +        bb.note("eglibc can't be built with -O0, -O2 will be used instead.")
>>
>> Although the text of that warning is correct, users might find the
>> reference to eglibc slightly confusing if it's perf that they're trying
>> to build.
>>
>> Also, as I mentioned in a different thread not all that long ago when
>> someone submitted a similar patch for gcc-runtime, the proliferation of
>> parse-time python functions to bash SELECTED_OPTIMIZATION around doesn't
>> seem like all that good a thing: this will cause extra overhead for
>> everyone, even those who are not using -O0 and have no interest in perf.
>>
>> And, finally, it remains slightly unclear to me that this is really a
>> problem that the metadata needs to be solving.  I haven't seen any
>> particularly convincing explanation of why this can't or shouldn't just
>> be fixed in the distro configuration.
>
> I have to admit at this point, this may look better as an include file
> along the lines of:
>
> SELECTED_OPTIMIZATION = "-O0"
> SELECTED_OPTIMIZATION_pn-eglibc = "-O2"
> SELECTED_OPTIMIZATION_pn-perf = "-O2"
>
> since clutter the recipes with anonymous python fragments isn't
> particular desirable.

Thats part of the problem.  We only need to set -O2, when someone sets -O0.  But 
if they set -O1 or -Os (or any other -O...) it appears to work properly...

So the python fragment is used to establish a known functional set for that item.

--Mark

> Cheers,
>
> Richard
>




More information about the Openembedded-core mailing list