From fbe0b0eb30d93f5fa2101fb015f20c1dc118b4a6 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Thu, 18 Jan 2018 14:46:56 +0100 Subject: openjdk-8: strip leading non digit chars from GCCVERSION When using the linaro cross toolchain GCCVERSION is set to "linaro-6.2%", i.e. the first char is not GCC's major version. Thus needed compiler options for GCC 6 are not set. Fix at least this case by stripping GCCVERSION up to the first numeric char. Signed-off-by: Max Krummenacher (cherry picked from commit 1fbdc60eaccaa29c2942d479f8068b722e7b5bf3) Signed-off-by: Maxin B. John --- recipes-core/openjdk/openjdk-8-common.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc index 83828e1..070ffaa 100644 --- a/recipes-core/openjdk/openjdk-8-common.inc +++ b/recipes-core/openjdk/openjdk-8-common.inc @@ -232,6 +232,8 @@ FLAGS_GCC7 = "-fno-lifetime-dse -fno-delete-null-pointer-checks" # version. def version_specific_cflags(d): + import re + extraflags = None version = None @@ -246,6 +248,10 @@ def version_specific_cflags(d): # work if the native toolchain is Clang, but as of this writing that # doesn't work anyway. version = d.getVar('GCCVERSION', expand=True)[0] + # skip non digit characters at the beginning, e.g. from "linaro-6.2%" + match = re.search("\d", version) + if match: + version = version[match.start():] if version.isdigit(): extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) or '' -- cgit v1.2.3-54-g00ecf