Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: Robert Yang <liezhi.yang@windriver.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/2 V2] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD
Date: Mon, 17 Sep 2018 07:50:55 +0200	[thread overview]
Message-ID: <20180917055055.GB3408@jama> (raw)
In-Reply-To: <CA+chaQccRwckqnoA601TNz-qr5QHLw+2uCigHKTS4D2b4DP_Yg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4210 bytes --]

On Fri, Sep 14, 2018 at 03:25:58PM +0200, Martin Jansa wrote:
> This seems to cause nativesdk-glibc failures when DEBUG_BUILD is used, it
> fails like this:
> 
> ../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_jnl':
> ../sysdeps/ieee754/ldbl-96/e_jnl.c:146:20: error: 'temp' may be used
> uninitialized in this function [-Werror=maybe-uninitialized]
>       b = invsqrtpi * temp / sqrtl (x);
>           ~~~~~~~~~~^~~~~~
> 
> the target build suffers from the same, that's why I was using this for a
> while:
> # glibc-2.21 fails to build with:
> # iso-2022-cn-ext.c:501:4: error: 'tmpbuf' may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
> # connections.c:1916:1: error: inlining failed in call to 'clear_db_cache':
> call is unlikely and code size would grow [-Werror=inline]
> # add few -Wno-error like meta/recipes-core/glibc/glibc.inc is trying to
> doin get_optimization function,
> # but fails because we append -Os at the end and -O2 is found first
> SELECTED_OPTIMIZATION_append_pn-glibc =
> "${@bb.utils.contains('TUNE_FEATURES', 'webos-minsize', '
> -Wno-error=maybe-uninitialized -Wno-error=inline', '', d)}"
> 
> 
> There is some logic in meta/recipes-core/glibc/glibc.inc to
> append -Wno-error to SELECTED_OPTIMIZATION when "-O", "-O1", "-Os" is used,
> but the same would be needed for BUILD_OPTIMIZATION now.
> 
> Or maybe it would be worth marking those uninitialized/unused variables
> with #pragma instead of injecting -Wno-error?
> 
> Then we can get rid of:
> python () {
>     opt_effective = "-O"
>     for opt in d.getVar('SELECTED_OPTIMIZATION').split():
>         if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
>             opt_effective = opt
>     if opt_effective == "-O0":
>         bb.fatal("%s can't be built with %s, try -O1 instead" %
> (d.getVar('PN'), opt_effective))
>     if opt_effective in ("-O", "-O1", "-Os"):
>         bb.note("%s doesn't build cleanly with %s, adding -Wno-error to
> SELECTED_OPTIMIZATION" % (d.getVar('PN'), opt_effective))
>         d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
> }
> from meta/recipes-core/glibc/glibc.inc (not use about -O0 case) and remove
> following notes:
> NOTE: glibc doesn't build cleanly with -O, adding -Wno-error to
> SELECTED_OPTIMIZATION
> NOTE: nativesdk-glibc doesn't build cleanly with -O, adding -Wno-error to
> SELECTED_OPTIMIZATION
> from every build with DEBUG_BUILD enabled.
> 
> What would be the preferred fix?

I've sent possible fix here:
http://lists.openembedded.org/pipermail/openembedded-core/2018-September/155744.html

> 
> On Wed, Sep 5, 2018 at 9:05 AM Robert Yang <liezhi.yang@windriver.com>
> wrote:
> 
> > 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 dbadeb3..93aee1a 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(oe.utils.vartrue('DEBUG_BUILD',
> > 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
> >  SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
> > -BUILD_OPTIMIZATION = "-O2 -pipe"
> > +BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g
> > -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"
> >
> >  ##################################################################
> >  # Settings used by bitbake-layers.
> > --
> > 2.7.4
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

  reply	other threads:[~2018-09-17  5:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05  7:16 [PATCH 0/2 V2] Add oe.utils.vartrue() and update BUILD_OPTIMIZATION Robert Yang
2018-09-05  7:16 ` [PATCH 1/2 V2] oe/utils.py: Add vartrue() Robert Yang
2018-09-05  7:33   ` Peter Kjellerstedt
2018-09-05  8:11     ` Robert Yang
2018-09-05 19:22       ` Peter Kjellerstedt
2018-09-05 19:31       ` Richard Purdie
2018-09-05 10:38   ` Martin Jansa
2018-09-05 10:56     ` Richard Purdie
2018-09-05  7:16 ` [PATCH 2/2 V2] bitbake.conf: Make BUILD_OPTIMIZATION respect to DEBUG_BUILD Robert Yang
2018-09-14 13:25   ` Martin Jansa
2018-09-17  5:50     ` Martin Jansa [this message]
2018-09-17  9:57       ` 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=20180917055055.GB3408@jama \
    --to=martin.jansa@gmail.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