Skip to contentSkip to conversation

openjdk-8: strip leading non digit chars from GCCVERSION

PATCH New Max Krummenacher 1 participant 1 message Jan 18, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

(cherry picked from commit 1fbdc60eaccaa29c2942d479f8068b722e7b5bf3)
---
 recipes-core/openjdk/openjdk-8-common.inc | 6 ++++++
 1 file changed, 6 insertions(+)

The patch applies cleanly to master, pyro and morty branches. I think it makes sense to add it to all supported OE versions.

Max

recipes-core/openjdk/openjdk-8-common.inc +6 -0
index def779d..b72c3c4 100644
@@ -231,6 +231,8 @@ FLAGS_GCC6 = "-fno-lifetime-dse -fno-delete-null-pointer-checks"
 # version.
 
 def version_specific_cflags(d):
+    import re
+
     extraflags = None
     version = None
 
@@ -249,6 +251,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 ''
Signature · 1 line
2.9.5