From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Subject: [PATCH v3] uninative: rebuild uninative for gcc 4.8 and 4.9
Date: Wed, 14 Dec 2016 01:55:04 +0200 [thread overview]
Message-ID: <1481673304-2956-1-git-send-email-ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <1976647.jAKzAtoRFl@peggleto-mobl.ger.corp.intel.com>
Some c++ libraries fail to build if uninative is built
with gcc 5.x and host gcc version is either 4.8 or 4.9.
The issue should be solved by making separate uninative sstate
directory structure sstate-cache/universal-<gcc version> for host gcc
versions 4.8 and 4.9. This causes rebuilds of uninative if host gcc
is either 4.8 or 4.9 and it doesn't match gcc version used to build
uninative.
[YOCTO #10441]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
meta/classes/populate_sdk_ext.bbclass | 5 +++--
meta/classes/uninative.bbclass | 2 +-
meta/lib/oe/utils.py | 14 ++++++++++++++
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 3c3a73c..1affa9d 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -374,8 +374,9 @@ python copy_buildsystem () {
sstate_out = baseoutpath + '/sstate-cache'
bb.utils.remove(sstate_out, True)
- # uninative.bbclass sets NATIVELSBSTRING to 'universal'
- fixedlsbstring = 'universal'
+
+ # uninative.bbclass sets NATIVELSBSTRING to 'universal%s' % oe.utils.host_gcc_version(d)
+ fixedlsbstring = "universal%s" % oe.utils.host_gcc_version(d)
sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN', True) == '1')
sdk_ext_type = d.getVar('SDK_EXT_TYPE', True)
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 9242320..11cbf9b 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -88,7 +88,7 @@ def enable_uninative(d):
loader = d.getVar("UNINATIVE_LOADER", True)
if os.path.exists(loader):
bb.debug(2, "Enabling uninative")
- d.setVar("NATIVELSBSTRING", "universal")
+ d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d))
d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index d6545b1..2b095f1 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -230,6 +230,20 @@ def format_pkg_list(pkg_dict, ret_format=None):
return '\n'.join(output)
+def host_gcc_version(d):
+ compiler = d.getVar("BUILD_CC", True)
+ retval, output = getstatusoutput("%s --version" % compiler)
+ if retval:
+ bb.fatal("Error running %s --version: %s" % (compiler, output))
+
+ import re
+ match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0])
+ if not match:
+ bb.fatal("Can't get compiler version from %s --version output" % compiler)
+
+ version = match.group(1)
+ return "-%s" % version if version in ("4.8", "4.9") else ""
+
#
# Python 2.7 doesn't have threaded pools (just multiprocessing)
# so implement a version here
--
2.1.4
prev parent reply other threads:[~2016-12-13 23:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 7:10 [PATCH v2] uninative: rebuild uninative for gcc 4.8 and 4.9 Ed Bartosh
2016-10-31 20:11 ` Burton, Ross
2016-11-08 8:11 ` Ed Bartosh
2016-12-05 10:56 ` Burton, Ross
2016-12-13 17:05 ` [PATCH] populate_sdk_ext: get NATIVELSBSTRING variable Ed Bartosh
2016-12-13 19:44 ` Paul Eggleton
2016-12-13 23:55 ` Ed Bartosh [this message]
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=1481673304-2956-1-git-send-email-ed.bartosh@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
/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