Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [master][dora][PATCH 1/2] perf: disallow debug optimization.
Date: Thu, 21 Nov 2013 01:33:17 -0600	[thread overview]
Message-ID: <1385019198-24458-2-git-send-email-mark.hatle@windriver.com> (raw)
In-Reply-To: <1385019198-24458-1-git-send-email-mark.hatle@windriver.com>

From: Randy MacLeod <Randy.MacLeod@windriver.com>

perf fails to compile if someone tries to compile an entire image as -O0
so in this case, force to use -O2 and give a note about it.

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
 meta/recipes-kernel/perf/perf.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 269069f..138595d 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -60,6 +60,17 @@ B = "${WORKDIR}/${BPN}-${PV}"
 SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
 TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
 
+# perf can't be built without optimization, if someone tries to compile an
+# entire image as -O0, we override it with -O2 here and give a note about it.
+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.")
+        return selected_optimization.replace("-O0", "-O2")
+    return selected_optimization
+
+SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
+
 # The LDFLAGS is required or some old kernels fails due missing
 # symbols and this is preferred than requiring patches to every old
 # supported kernel.
-- 
1.8.1.2.545.g2f19ada



  reply	other threads:[~2013-11-21  7:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  7:33 [master][dora][PATCH 0/2] Few perf fixes Mark Hatle
2013-11-21  7:33 ` Mark Hatle [this message]
2013-11-21 14:25   ` [master][dora][PATCH 1/2] perf: disallow debug optimization Phil Blundell
2013-11-21 14:35     ` Richard Purdie
2013-11-21 14:48       ` Mark Hatle
2013-11-21 17:43       ` Phil Blundell
2013-11-21 14:47     ` Mark Hatle
2013-11-21 15:57       ` Phil Blundell
2013-11-21 21:22         ` Phil Blundell
2013-11-21  7:33 ` [master][dora][PATCH 2/2] perf: Disable -Werror flag Mark Hatle
2013-11-21 15:26   ` Konrad Scherer

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=1385019198-24458-2-git-send-email-mark.hatle@windriver.com \
    --to=mark.hatle@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