aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro-toolchain/conf
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@linaro.org>2015-11-04 10:41:31 +0100
committerKoen Kooi <koen.kooi@linaro.org>2015-11-04 10:44:29 +0100
commit9f9edc0da27817229a90bdb85a5ca06fc20f6909 (patch)
tree92ff84341e7f8462a37d7d79d446c3ed7c405b6a /meta-linaro-toolchain/conf
parentc8e320957ececdcb70cd51fb9db2f19eb2e7e674 (diff)
external-toolchain: fix parsing for non-prerelease toolchains
The 'prerelease' bit is gone from the version string so the parser errors out. Add support for the new format and document the older formats as well. To aid debugging this problem print out the version string gcc returns before trying to parse it. This fixes https://bugs.linaro.org/show_bug.cgi?id=1850 Change-Id: Ifdaedccfa8772e72e126c16bd8c9e482cfdd3895 Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Diffstat (limited to 'meta-linaro-toolchain/conf')
-rw-r--r--meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc b/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc
index eb5a0f88..564a408f 100644
--- a/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc
+++ b/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc
@@ -23,16 +23,25 @@ def elt_get_version(d):
last_line = stderr.splitlines()[-1]
return last_line
+# Extract the YYYY.MM version
def elt_get_main_version(d):
version = elt_get_version(d)
+ bb.note('Trying for parse version info from: %s' % version)
if version != 'UNKNOWN':
- if version.split()[5] != '(crosstool-NG':
+ if version.split()[4] == '(Linaro':
+ # gcc version 5.1.1 20150608 (Linaro GCC 5.1-2015.08)
+ return version.split()[6].split('-')[1].split(')')[0]
+ if version.split()[5] == '(Linaro':
+ # gcc version 4.9.3 20141031 (prerelease) (Linaro GCC 2014.11)
return version.split()[7].split(')')[0]
- else:
+ if version.split()[5] == '(crosstool-NG':
+ # gcc version 4.9.1 20140529 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.08 - Linaro GCC 4.9-2014.08)
return version.split()[6].split('-')[3]
+ bb.error('Failed to parse external Linaro toolchain version from: %s' % version)
else:
return version
+# Extract the x.y.z version from 'gcc version 4.9.1'
def elt_get_gcc_version(d):
version = elt_get_version(d)
if version != 'UNKNOWN':