From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Robert Yang <liezhi.yang@windriver.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/1] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
Date: Tue, 4 Sep 2018 08:15:29 +0000 [thread overview]
Message-ID: <8db3e1637d3c4714aa90df95492b2f84@XBOX02.axis.com> (raw)
In-Reply-To: <ea8e96b3f2b09db17ecf9a28765b709433febe9b.1536042978.git.liezhi.yang@windriver.com>
> -----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
next prev parent reply other threads:[~2018-09-04 8:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2018-09-04 11:19 ` Richard Purdie
2018-09-05 6:12 ` Robert Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8db3e1637d3c4714aa90df95492b2f84@XBOX02.axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=liezhi.yang@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox