All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lei Liu <layliu@gmail.com>
To: Phil Blundell <pb@pbcl.net>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] Disable building libgcc with -O0
Date: Wed, 13 Nov 2013 11:02:36 +0800	[thread overview]
Message-ID: <5282EBCC.4020401@gmail.com> (raw)
In-Reply-To: <1384300735.3828.40.camel@x121e.pbcl.net>

On 2013年11月13日 07:58, Phil Blundell wrote:
> On Mon, 2013-11-11 at 12:30 +0800, Lei Liu wrote:
>> +def get_optimization(d):
>> +    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
>> +    if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
>> +        bb.note("libgcc can't be built with -O0, -O2 will be used instead.")
>> +        return selected_optimization.replace("-O0", "-O2")
>> +    return selected_optimization
>> +
>> +SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
> Do we really need a Python function for this?  It seems like a rather
> heavyweight mechanism to detect what is basically just a distro
> misconfiguration.

The python function is copied from eglibc recipe which does similar
job to force build the package with optimization enabled.  I think
it's not just a distro misconfiguration.  Sometimes it would be
convenient for user to select a global -O0 optimization level (to
create a more debug-friendly rootfs) for most packages, while
automatically switching to -O2 for those which can't be built without
optimizations.

>
> How about just patching the appropriate bit of libgcc to include:
>
> #if __OPTIMIZE__ == 0
> #error libgcc can't be built with -O0, please fix your distro to use at least -O1
> #endif

I think it would be more helpful if we can switch to -O1 or -O2 in
such case, instead of throwing out an error.

Lei

>
> or some such?  Even this seems slightly dubious, since it will prevent
> you from building an unoptimised libgcc even if you have no intention of
> running valgrind with it, but at least this doesn't add extra overhead
> within bitbake.
>
> p.
>
>



  reply	other threads:[~2013-11-13  3:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  4:30 [PATCH] Disable building libgcc with -O0 Lei Liu
2013-11-12 15:01 ` Saul Wold
2013-11-12 23:58 ` Phil Blundell
2013-11-13  3:02   ` Lei Liu [this message]
2013-11-13  7:44     ` Phil Blundell

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=5282EBCC.4020401@gmail.com \
    --to=layliu@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pb@pbcl.net \
    /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 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.