summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-07-20 11:48:08 +0200
committerOtavio Salvador <otavio@ossystems.com.br>2016-07-22 11:46:04 -0300
commit065ee5a0160d7ad95861417a845c9e208499061e (patch)
treef14ecceb3e2283bffe1618a1757e6c389e251eb3
parent4f7fb37a87e7d63a7419e480ea403aa02a2ce900 (diff)
downloadmeta-java-065ee5a0160d7ad95861417a845c9e208499061e.tar.gz
openjdk-8: fix compiler detection
When GCC is at version 4 or 5, parsing the recipe fails with: ERROR: ExpansionError during parsing .../ostro-os/meta-java/recipes-core/openjdk/openjdk-8_72b05.bb ... bb.data_smart.ExpansionError: Failure expanding variable CFLAGS, expression was -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=.../ostro-os/build/tmp-glibc/work/corei7-64-ostro- linux/openjdk-8/72b05-r0=/usr/src/debug/openjdk-8/72b05-r0 -fdebug-prefix-map=.../ostro-os/build/tmp-glibc/sysroots/x86_64-linux= -fdebug-prefix-map=.../ostro-os/build/tmp-glibc/sysroots/intel-corei7-64= -fstack-protector-strong -D_FORTIFY_SOURCE=2 ${ <at> version_specific_cflags(d)} -Wno-error=deprecated-declarations which triggered exception TypeError: can only join an iterable That's because FLAGS_GCC<version> may be unset, thus leading to d.getVar() returning None and ''.join(extraflags) failing. The join() is also redundant: extraflags already is a string. It happened to work because Python treats a string as sequence of single-character strings, and thus ''.join() re-created the original string. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--recipes-core/openjdk/openjdk-8-common.inc6
1 files changed, 2 insertions, 4 deletions
diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index 089f907..7ad802a 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -271,10 +271,8 @@ def version_specific_cflags(d):
271 # doesn't work anyway. 271 # doesn't work anyway.
272 version = d.getVar('GCCVERSION', expand=True)[0] 272 version = d.getVar('GCCVERSION', expand=True)[0]
273 273
274 if int(version) >= 4: 274 extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) or ''
275 extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) 275 return extraflags
276
277 return ''.join(extraflags)
278 276
279CFLAGS_append = " ${@version_specific_cflags(d)}" 277CFLAGS_append = " ${@version_specific_cflags(d)}"
280CXXFLAGS_append = " ${@version_specific_cflags(d)}" 278CXXFLAGS_append = " ${@version_specific_cflags(d)}"