Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-java][master-next][PATCH 4/4] openjdk-8: update to work with gcc v8
Date: Thu,  9 Aug 2018 01:26:44 +0100	[thread overview]
Message-ID: <20180809002644.18549-4-git@andred.net> (raw)
In-Reply-To: <20180809002644.18549-1-git@andred.net>

From: André Draszik <andre.draszik@jci.com>

Similar to the existing gcc-6 and gcc-7 support, we need to
add the same specific compiler flags to avoid miscompilation
on gcc-8:
  -fno-lifetime-dse
  -fno-delete-null-pointer-checks

In addition, gcc v8 introduces new warnings (which are
treated as errors), which we can just silence for the
time being:

| <<PKGBUILDDIR>>/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp:223:32: error: control reaches end of non-void function [-Werror=return-type]
|  #define BREAKPOINT ::breakpoint()
|                     ~~~~~~~~~~~~^~
| <<PKGBUILDDIR>>/hotspot/src/share/vm/utilities/debug.hpp:192:3: note: in expansion of macro 'BREAKPOINT'
|    BREAKPOINT;                                                                \
|    ^~~~~~~~~~
| <<PKGBUILDDIR>>/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp:197:2: note: in expansion of macro 'ShouldNotReachHere'
|   ShouldNotReachHere();
|   ^~~~~~~~~~~~~~~~~~
etc.

And
| <<PKGBUILDDIR>>/hotspot/src/share/vm/runtime/arguments.cpp:3811:14: error: 'char* strncat(char*, const char*, size_t)' specified bound 1 equals source length [-Werror=stringop-overflow=]
|        strncat(shared_archive_path, os::file_separator(), file_sep_len);
|        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| <<PKGBUILDDIR>>/hotspot/src/share/vm/runtime/arguments.cpp: In static member function 'static void Arguments::fix_appclasspath()':
| <<PKGBUILDDIR>>/hotspot/src/share/vm/runtime/arguments.cpp:3433:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
|      strncpy(copy, src, strlen(src) + 1);
|      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| <<PKGBUILDDIR>>/hotspot/src/share/vm/runtime/arguments.cpp:3433:30: note: length computed here
|      strncpy(copy, src, strlen(src) + 1);
|                         ~~~~~~^~~~~
| <<PKGBUILDDIR>>/hotspot/src/share/vm/runtime/arguments.cpp:3433:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
|      strncpy(copy, src, strlen(src) + 1);
|      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| <<PKGBUILDDIR>>/hotspot/src/share/vm/runtime/arguments.cpp:3433:30: note: length computed here
|      strncpy(copy, src, strlen(src) + 1);
|                         ~~~~~~^~~~~
etc.

With this,
    bitbake -c testimage openjdk-8-test-image
works again:
RESULTS:
RESULTS - ping.PingTest.test_ping - Testcase 964: PASSED (0.12s)
RESULTS - ssh.SSHTest.test_ssh - Testcase 224: PASSED (1.20s)
RESULTS - java.JavaTest.test_java_exists - Testcase -1: PASSED (0.15s)
RESULTS - java.JavaTest.test_java_jar_comp_mode - Testcase -1: PASSED (41.98s)
RESULTS - java.JavaTest.test_java_jar_int_mode - Testcase -1: PASSED (1.76s)
RESULTS - java.JavaTest.test_java_jar_works - Testcase -1: PASSED (2.13s)
RESULTS - java.JavaTest.test_java_version - Testcase -1: PASSED (1.51s)
RESULTS - javac.JavacTest.test_javac_exists - Testcase -1: PASSED (0.11s)
RESULTS - javac.JavacTest.test_javac_works - Testcase -1: PASSED (17.64s)
SUMMARY:
openjdk-8-test-image () - Ran 9 tests in 67.112s
openjdk-8-test-image - OK - All required tests passed

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 recipes-core/openjdk/openjdk-8-common.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index 3b328e9..79af54a 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -216,6 +216,7 @@ EXTRA_OECONF_append = "\
 # of these changes.
 FLAGS_GCC6 = "-fno-lifetime-dse -fno-delete-null-pointer-checks"
 FLAGS_GCC7 = "-fno-lifetime-dse -fno-delete-null-pointer-checks"
+FLAGS_GCC8 = "-fno-lifetime-dse -fno-delete-null-pointer-checks -Wno-error=stringop-overflow -Wno-error=return-type"
 
 # All supported cross compilers support the compiler flags that were
 # added to make compilation with gcc6 work. But the host compiler for
-- 
2.18.0



  parent reply	other threads:[~2018-08-09  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09  0:26 [meta-java][master-next][PATCH 1/4] gitignore: ignore new python byte-code files André Draszik
2018-08-09  0:26 ` [meta-java][master-next][PATCH 2/4] openjdk-8: speed-up do_install() (pack200) André Draszik
2018-08-09  0:26 ` [meta-java][master-next][PATCH 3/4] Revert "openjdk-8: fix build for gcc8.x" André Draszik
2018-08-09  0:26 ` André Draszik [this message]
2018-08-09 10:46   ` [meta-java][master-next][PATCH 4/4] openjdk-8: update to work with gcc v8 André Draszik
2018-08-13  7:44 ` [meta-java][master-next][PATCH 1/4] gitignore: ignore new python byte-code files André Draszik
2018-08-13  8:16   ` Richard Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180809002644.18549-4-git@andred.net \
    --to=git@andred.net \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox