diff options
Diffstat (limited to 'recipes-core/openjdk')
-rw-r--r-- | recipes-core/openjdk/openjdk-8-common.inc | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc index 74f686d..089f907 100644 --- a/recipes-core/openjdk/openjdk-8-common.inc +++ b/recipes-core/openjdk/openjdk-8-common.inc | |||
@@ -239,6 +239,43 @@ EXTRA_OECONF_append = "\ | |||
239 | --with-update-version=${OPENJDK_UPDATE_VERSION} \ | 239 | --with-update-version=${OPENJDK_UPDATE_VERSION} \ |
240 | " | 240 | " |
241 | 241 | ||
242 | CFLAGS_append = " -fno-lifetime-dse -fno-delete-null-pointer-checks" | 242 | # GCC 6 sets the default C++ standard to C++14 and introduces dead store |
243 | CXXFLAGS_append = " -fno-lifetime-dse -fno-delete-null-pointer-checks" | 243 | # elimination by default. OpenJDK 8 is not ready for either of these |
244 | # changes. | ||
245 | FLAGS_GCC6 = "-fno-lifetime-dse -fno-delete-null-pointer-checks" | ||
246 | |||
247 | # All supported cross compilers support the compiler flags that were | ||
248 | # added to make compilation with gcc6 work. But the host compiler for | ||
249 | # native compilation is a different story: it may be too old (for example, | ||
250 | # gcc 4.9.2 on Debian Wheezy). In that case we need to check what the | ||
251 | # version is and only add the flags that are appropriate for that GCC | ||
252 | # version. | ||
253 | |||
254 | def version_specific_cflags(d): | ||
255 | extraflags = None | ||
256 | version = None | ||
257 | |||
258 | if bb.data.inherits_class('native', d): | ||
259 | from subprocess import Popen, PIPE | ||
260 | |||
261 | cmd = d.expand('${CPP} -P -').split() | ||
262 | cc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) | ||
263 | # This check is GCC specific. Clang always returns 4. For Clang | ||
264 | # __clang_major__ and __clang_minor__ need to be checked. Ideally | ||
265 | # __GNUC_MINOR__ would be checked as well, but for this recipe | ||
266 | # GCC major is all we care about. | ||
267 | version = cc.communicate(b'__GNUC__')[0].decode('utf-8')[0] | ||
268 | else: | ||
269 | # in the cross case, trust that GCCVERSION is correct. This won't | ||
270 | # work if the native toolchain is Clang, but as of this writing that | ||
271 | # doesn't work anyway. | ||
272 | version = d.getVar('GCCVERSION', expand=True)[0] | ||
273 | |||
274 | if int(version) >= 4: | ||
275 | extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) | ||
276 | |||
277 | return ''.join(extraflags) | ||
278 | |||
279 | CFLAGS_append = " ${@version_specific_cflags(d)}" | ||
280 | CXXFLAGS_append = " ${@version_specific_cflags(d)}" | ||
244 | CXX_append = " -std=gnu++98" | 281 | CXX_append = " -std=gnu++98" |