All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
@ 2018-09-04  6:36 Robert Yang
  2018-09-04  6:36 ` [PATCH 1/1] " Robert Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Yang @ 2018-09-04  6:36 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 853e0499be449c71378c087e08b1926be8e2ac87:

  ruby: improve reproducibility (2018-08-29 10:40:08 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/debug
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/debug

Robert Yang (1):
  bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD

 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
  2018-09-04  6:36 [PATCH 0/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD Robert Yang
@ 2018-09-04  6:36 ` Robert Yang
  2018-09-04  8:15   ` Peter Kjellerstedt
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Yang @ 2018-09-04  6:36 UTC (permalink / raw)
  To: openembedded-core

We may also need debug native tools, so make BUILD_OPTIMIZATION respect to
DEBUG_BUILD, otherwise, we need set CFLAGS in the recipe which isn't
convenient.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 1941633..df62445 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -612,7 +612,7 @@ FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
 DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
 SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD') == '1'])}"
 SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
-BUILD_OPTIMIZATION = "-O2 -pipe"
+BUILD_OPTIMIZATION = "${@['-O2', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer'][d.getVar('DEBUG_BUILD') == '1']} -pipe"
 
 ##################################################################
 # Settings used by bitbake-layers.
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
  2018-09-04  6:36 ` [PATCH 1/1] " Robert Yang
@ 2018-09-04  8:15   ` Peter Kjellerstedt
  2018-09-04 11:19     ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Kjellerstedt @ 2018-09-04  8:15 UTC (permalink / raw)
  To: Robert Yang, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-bounces@lists.openembedded.org> On Behalf Of Robert Yang
> Sent: den 4 september 2018 08:37
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/1] bitbake.conf: Make BUILD_OPTIMIZATION
> respect to DEBUG_BUILD
> 
> We may also need debug native tools, so make BUILD_OPTIMIZATION respect to
> DEBUG_BUILD, otherwise, we need set CFLAGS in the recipe which isn't
> convenient.
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/conf/bitbake.conf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 1941633..df62445 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -612,7 +612,7 @@ FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
>  DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
>  SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD') == '1'])}"
>  SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
> -BUILD_OPTIMIZATION = "-O2 -pipe"
> +BUILD_OPTIMIZATION = "${@['-O2', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer'][d.getVar('DEBUG_BUILD') == '1']} -pipe"

Can we make that more readable:

BUILD_OPTIMIZATION = "${@'-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer' if d.getVar('DEBUG_BUILD') == '1' else '-O2'} -pipe"

Should probably do the same for SELECTED_OPTIMIZATION while at it:

SELECTED_OPTIMIZATION = "${@d.getVar('DEBUG_OPTIMIZATION' if d.getVar('DEBUG_BUILD') == '1' else 'FULL_OPTIMIZATION')}"

> 
>  ##################################################################
>  # Settings used by bitbake-layers.
> --
> 2.7.4

//Peter



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
  2018-09-04  8:15   ` Peter Kjellerstedt
@ 2018-09-04 11:19     ` Richard Purdie
  2018-09-05  6:12       ` Robert Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2018-09-04 11:19 UTC (permalink / raw)
  To: Peter Kjellerstedt, Robert Yang, openembedded-core

On Tue, 2018-09-04 at 08:15 +0000, Peter Kjellerstedt wrote:
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org
> > <openembedded-
> > core-bounces@lists.openembedded.org> On Behalf Of Robert Yang
> > Sent: den 4 september 2018 08:37
> > To: openembedded-core@lists.openembedded.org
> > Subject: [OE-core] [PATCH 1/1] bitbake.conf: Make
> > BUILD_OPTIMIZATION
> > respect to DEBUG_BUILD
> > 
> > We may also need debug native tools, so make BUILD_OPTIMIZATION
> > respect to
> > DEBUG_BUILD, otherwise, we need set CFLAGS in the recipe which
> > isn't
> > convenient.
> > 
> > Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> > ---
> >  meta/conf/bitbake.conf | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index 1941633..df62445 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -612,7 +612,7 @@ FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
> >  DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS}
> > -pipe"
> >  SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION',
> > 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD') == '1'])}"
> >  SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION
> > DEBUG_OPTIMIZATION"
> > -BUILD_OPTIMIZATION = "-O2 -pipe"
> > +BUILD_OPTIMIZATION = "${@['-O2', '-O -g -feliminate-unused-debug-
> > types -fno-omit-frame-pointer'][d.getVar('DEBUG_BUILD') == '1']}
> > -pipe"
> 
> Can we make that more readable:
> 
> BUILD_OPTIMIZATION = "${@'-O -g -feliminate-unused-debug-types -fno-
> omit-frame-pointer' if d.getVar('DEBUG_BUILD') == '1' else '-O2'}
> -pipe"
> 
> Should probably do the same for SELECTED_OPTIMIZATION while at it:
> 
> SELECTED_OPTIMIZATION = "${@d.getVar('DEBUG_OPTIMIZATION' if
> d.getVar('DEBUG_BUILD') == '1' else 'FULL_OPTIMIZATION')}"

If we're going to deal with readability and usability we could add
something like:

def vartrue(var, iftrue, iffalse, d):
    if oe.types.boolean(d.getVar(var)):
        return iftrue
    else:
        return iffalse

to lib/oe/utils and then:

BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)}"

Cheers,

Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
  2018-09-04 11:19     ` Richard Purdie
@ 2018-09-05  6:12       ` Robert Yang
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Yang @ 2018-09-05  6:12 UTC (permalink / raw)
  To: Richard Purdie, Peter Kjellerstedt, openembedded-core



On 09/04/2018 07:19 PM, Richard Purdie wrote:
> On Tue, 2018-09-04 at 08:15 +0000, Peter Kjellerstedt wrote:
>>> -----Original Message-----
>>> From: openembedded-core-bounces@lists.openembedded.org
>>> <openembedded-
>>> core-bounces@lists.openembedded.org> On Behalf Of Robert Yang
>>> Sent: den 4 september 2018 08:37
>>> To: openembedded-core@lists.openembedded.org
>>> Subject: [OE-core] [PATCH 1/1] bitbake.conf: Make
>>> BUILD_OPTIMIZATION
>>> respect to DEBUG_BUILD
>>>
>>> We may also need debug native tools, so make BUILD_OPTIMIZATION
>>> respect to
>>> DEBUG_BUILD, otherwise, we need set CFLAGS in the recipe which
>>> isn't
>>> convenient.
>>>
>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> ---
>>>   meta/conf/bitbake.conf | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>>> index 1941633..df62445 100644
>>> --- a/meta/conf/bitbake.conf
>>> +++ b/meta/conf/bitbake.conf
>>> @@ -612,7 +612,7 @@ FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
>>>   DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS}
>>> -pipe"
>>>   SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION',
>>> 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD') == '1'])}"
>>>   SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION
>>> DEBUG_OPTIMIZATION"
>>> -BUILD_OPTIMIZATION = "-O2 -pipe"
>>> +BUILD_OPTIMIZATION = "${@['-O2', '-O -g -feliminate-unused-debug-
>>> types -fno-omit-frame-pointer'][d.getVar('DEBUG_BUILD') == '1']}
>>> -pipe"
>>
>> Can we make that more readable:
>>
>> BUILD_OPTIMIZATION = "${@'-O -g -feliminate-unused-debug-types -fno-
>> omit-frame-pointer' if d.getVar('DEBUG_BUILD') == '1' else '-O2'}
>> -pipe"
>>
>> Should probably do the same for SELECTED_OPTIMIZATION while at it:
>>
>> SELECTED_OPTIMIZATION = "${@d.getVar('DEBUG_OPTIMIZATION' if
>> d.getVar('DEBUG_BUILD') == '1' else 'FULL_OPTIMIZATION')}"
> 
> If we're going to deal with readability and usability we could add
> something like:
> 
> def vartrue(var, iftrue, iffalse, d):
>      if oe.types.boolean(d.getVar(var)):
>          return iftrue
>      else:
>          return iffalse

Thanks, looks good, I will send a V2.

// Robert

> 
> to lib/oe/utils and then:
> 
> BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)}"
> 
> Cheers,
> 
> Richard
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-05  6:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04  6:36 [PATCH 0/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD Robert Yang
2018-09-04  6:36 ` [PATCH 1/1] " Robert Yang
2018-09-04  8:15   ` Peter Kjellerstedt
2018-09-04 11:19     ` Richard Purdie
2018-09-05  6:12       ` Robert Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.