aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/uninative.bbclass16
1 files changed, 15 insertions, 1 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 9242320fee2..88344c0646a 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -84,11 +84,25 @@ python uninative_event_enable() {
enable_uninative(d)
}
+def gcc_version(d):
+ compiler = d.getVar("BUILD_CC", True)
+ retval, output = oe.utils.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 ""
+
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" % gcc_version(d))
d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")