summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-12-14 01:55:04 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-11 17:21:46 +0000
commit8108c477405071ae40710d94a1148be8dacff063 (patch)
treea65a4ddb291899c59e8608dd7285ea8c093dc836 /meta
parentc8f4fb15de070b7462eee66a5e0e0b63b704046b (diff)
downloadpoky-8108c477405071ae40710d94a1148be8dacff063.tar.gz
uninative: rebuild uninative for gcc 4.8 and 4.9
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] (From OE-Core rev: d36f41e5658bbbb6080ee833027879c119edf3e0) (From OE-Core rev: 3d39ca5c91dbb62fb43199f916bd390cd6212e3d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/populate_sdk_ext.bbclass5
-rw-r--r--meta/classes/uninative.bbclass2
-rw-r--r--meta/lib/oe/utils.py14
3 files changed, 18 insertions, 3 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 944fe5cd26..1904508af3 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -374,8 +374,9 @@ python copy_buildsystem () {
374 374
375 sstate_out = baseoutpath + '/sstate-cache' 375 sstate_out = baseoutpath + '/sstate-cache'
376 bb.utils.remove(sstate_out, True) 376 bb.utils.remove(sstate_out, True)
377 # uninative.bbclass sets NATIVELSBSTRING to 'universal' 377
378 fixedlsbstring = 'universal' 378 # uninative.bbclass sets NATIVELSBSTRING to 'universal%s' % oe.utils.host_gcc_version(d)
379 fixedlsbstring = "universal%s" % oe.utils.host_gcc_version(d)
379 380
380 sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN', True) == '1') 381 sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN', True) == '1')
381 sdk_ext_type = d.getVar('SDK_EXT_TYPE', True) 382 sdk_ext_type = d.getVar('SDK_EXT_TYPE', True)
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 9242320fee..11cbf9be80 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -88,7 +88,7 @@ def enable_uninative(d):
88 loader = d.getVar("UNINATIVE_LOADER", True) 88 loader = d.getVar("UNINATIVE_LOADER", True)
89 if os.path.exists(loader): 89 if os.path.exists(loader):
90 bb.debug(2, "Enabling uninative") 90 bb.debug(2, "Enabling uninative")
91 d.setVar("NATIVELSBSTRING", "universal") 91 d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d))
92 d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp") 92 d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
93 d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:") 93 d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
94 94
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index d6545b197d..2b095f1f0a 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):
230 230
231 return '\n'.join(output) 231 return '\n'.join(output)
232 232
233def host_gcc_version(d):
234 compiler = d.getVar("BUILD_CC", True)
235 retval, output = getstatusoutput("%s --version" % compiler)
236 if retval:
237 bb.fatal("Error running %s --version: %s" % (compiler, output))
238
239 import re
240 match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0])
241 if not match:
242 bb.fatal("Can't get compiler version from %s --version output" % compiler)
243
244 version = match.group(1)
245 return "-%s" % version if version in ("4.8", "4.9") else ""
246
233# 247#
234# Python 2.7 doesn't have threaded pools (just multiprocessing) 248# Python 2.7 doesn't have threaded pools (just multiprocessing)
235# so implement a version here 249# so implement a version here