Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH V2 2/5] glibc: Disable Werror when building with debug options
Date: Thu, 28 Feb 2019 19:21:09 -0800	[thread overview]
Message-ID: <20190301032112.38191-2-raj.khem@gmail.com> (raw)
In-Reply-To: <20190301032112.38191-1-raj.khem@gmail.com>

Since compiler does not optimize away a lot of stuff we end up with
Werrors e.g.

./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  114 |        + (k * ln2_lo + c))) - f);
      |          ~~~~~~~~~~~~^~~~

which otherwise wont happen, so lets build with warnings-as-errors
disabled in debug mode

given we disable werror, now we don't have to restrict user to compile
without -O0

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased

 meta/recipes-core/glibc/glibc.inc     | 9 ---------
 meta/recipes-core/glibc/glibc_2.29.bb | 1 +
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index b550abd877..252fd56c13 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -2,15 +2,6 @@ require glibc-common.inc
 require glibc-ld.inc
 require glibc-testing.inc
 
-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))
-}
-
 DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
 
 PROVIDES = "virtual/libc"
diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
index c3e969d2f8..4577350eae 100644
--- a/meta/recipes-core/glibc/glibc_2.29.bb
+++ b/meta/recipes-core/glibc/glibc_2.29.bb
@@ -85,6 +85,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
                 --disable-crypt \
                 --with-default-link \
                 --enable-nscd \
+                ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
                 ${GLIBCPIE} \
                 ${GLIBC_EXTRA_OECONF}"
 
-- 
2.21.0



  reply	other threads:[~2019-03-01  3:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01  3:21 [PATCH V3 1/5] bitbake.conf: Use -Og in DEBUG_OPTIMIZATION Khem Raj
2019-03-01  3:21 ` Khem Raj [this message]
2019-03-01  3:21 ` [PATCH 3/5] bitbake.conf: Drop -fno-omit-frame-pointer Khem Raj
2019-03-01  3:21 ` [PATCH 4/5] perf: Set libunwind dir explicitly to point into staging sysroot Khem Raj
2019-03-01  3:21 ` [PATCH 5/5] musl: Fix out of bounds data access in dlopen Khem Raj

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=20190301032112.38191-2-raj.khem@gmail.com \
    --to=raj.khem@gmail.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