All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-java] OpenJDK-8 fixes and updates
@ 2018-08-13 10:09 André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 1/9] gitignore: ignore new python byte-code files André Draszik
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

Hi,

This series addresses a few OpenJDK-8 issues:

Highlights are:
* compilation on gcc < v7 host compilers was broken
* compilation on gcc v8 (cross) compilers produced non-working binaries
* update  to the latest 8u172b11 release

This series was tested on:
* qemux86-64 (with & without security flags, host gcc 6.3.0, target gcc 8)
* qemuarm64 (with & without security flags, host gcc 4.8.4 & 6.3.0, target gcc 8)
* qemuarm64 (host gcc 7.3.0, target gcc 7.3.0)

Note that yocto's gcc 8 update completely broke qemuarm support, but I'll
hopefully address this by importing the aarch32 openjdk port into this layer.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 1/9] gitignore: ignore new python byte-code files
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 2/9] openjdk-8: speed-up do_install() (pack200) André Draszik
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

Since we run oeqa tests, we get python byte-code in
the source tree here.

Ignore them to clean-up the git status

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 51a512c..8e5c599 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 *.bak
 *.orig
+*.pyc
 *.rej
 *.swp
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 2/9] openjdk-8: speed-up do_install() (pack200)
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 1/9] gitignore: ignore new python byte-code files André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 3/9] openjdk-8: remove superfluous compiler flag (-std=gnu++98) André Draszik
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

We run pack200 sequentially on all found archives, but there
doesn't seem to be a reason to do so, the
java_get_parallel_make() apperas to be related to compiling
java itself, running multiple java applications (pack200)
at the same time on the same machine should be possible,
otherwise we have a big problem...

Just run up to BB_NUMBER_THREADS pack200 processes at the same
time to speed up the build.

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

diff --git a/recipes-core/openjdk/openjdk-8-cross.inc b/recipes-core/openjdk/openjdk-8-cross.inc
index 03cab11..d0b2ec8 100644
--- a/recipes-core/openjdk/openjdk-8-cross.inc
+++ b/recipes-core/openjdk/openjdk-8-cross.inc
@@ -77,13 +77,13 @@ do_install_append() {
     if ${@bb.utils.contains('PACKAGECONFIG', 'repack', 'true', 'false', d)} ; then
       if [ -d ${D}${JDK_HOME} ] ; then
         find ${D}${JDK_HOME} -name "*.jar" -print0 | \
-          xargs -0 -n1 -P ${@java_get_parallel_make(d)} sh -c ' \
+          xargs -0 -n1 -P ${BB_NUMBER_THREADS} sh -c ' \
               echo "Repacking" "$0" ; \
               pack200 --repack --effort=9 --segment-limit=-1 --modification-time=latest --strip-debug "$0"'
       fi
       if [ -d ${D}${JRE_HOME} ] ; then
         find ${D}${JRE_HOME} -name "*.jar" -print0 | \
-          xargs -0 -n1 -P ${@java_get_parallel_make(d)} sh -c ' \
+          xargs -0 -n1 -P ${BB_NUMBER_THREADS} sh -c ' \
               echo "Repacking" "$0" ; \
               pack200 --repack --effort=9 --segment-limit=-1 --modification-time=latest --strip-debug "$0"'
       fi
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 3/9] openjdk-8: remove superfluous compiler flag (-std=gnu++98)
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 1/9] gitignore: ignore new python byte-code files André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 2/9] openjdk-8: speed-up do_install() (pack200) André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 4/9] openjdk-8: fix infrastructure for version host gcc != cross gcc (again) André Draszik
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

These days, OpenJDK-8 adds this to the build itself, no need to do it
again here in the recipe.

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

diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index 0af320d..4e52448 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -253,4 +253,3 @@ def version_specific_cflags(d):
 
 CFLAGS_append = " ${@version_specific_cflags(d)}"
 CXXFLAGS_append = " ${@version_specific_cflags(d)}"
-CXX_append = " -std=gnu++98"
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 4/9] openjdk-8: fix infrastructure for version host gcc != cross gcc (again)
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (2 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 3/9] openjdk-8: remove superfluous compiler flag (-std=gnu++98) André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 13:53   ` Richard Leitner
  2018-08-13 10:09 ` [meta-java][PATCH 5/9] openjdk-8: gcc-8 fix #1: backport patch to fix misuses of strncpy/strncat André Draszik
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

Building OpenJDK-8 (target) with an older host compiler (gcc < 6) does
not work as the build errors with error messages regarding unrecognized
gcc command line options.

As part of the (cross) build particularly, OpenJDK-8 builds a host tool
(adlc) using the host gcc. We have a patch, openjdk8-fix-adlc-flags.patch,
that tries to make the adlc build use the correct / intended compiler
flags.

This doesn't work right now, as that build still sees compiler flags
intended for / understood by the gcc version used for the actual cross
compile only.

The reason is that while we have infrastructure in place to add compiler
flags based on the compiler version, we add all of them unconditionally to
CFLAGS / CXXFLAGS directly but above patch uses TARGET_CFLAGS /
TARGET_CXXFLAGS to  filter out unwanted BUILD_CFLAGS / BUILD_CXXFLAGS from
CFLAGS / CXXFLAGS, In other words above patch cannot do what it intends to
do and all compiler version specific flags (-fno-lifetime-dse &
-fno-delete-null-pointer-checks) end up in CFLAGS / CXXFLAGS.

So far, this was only affecting people using host gcc < 6, but upcoming
patches adding support for gcc >= 8 will add even more compiler flags that
even gcc < 7 don't support - it's time to finally address this.

We fix the issue by adding the compiler version specific flags to
BUILD_CFLAGS / BUILD_CXXFLAGS and TARGET_CFLAGS / TARGET_CXXFLAGS as
necessary, so that above patch can work as intended.

We now support all necessary combinations:
* -native builds
* -target builds
* host tools built using the native compiler during the -target build

A similar but different patch existed here before as
commit 6801f6d4e19c ("openjdk-8-common: Fix the issue of building
failed adlc on host with gcc < 6") but was reverted subsequently
due to reportedly still(?) having (new?) issues with older compilers.
This patch here is different from the older patch in that it
*doesn't* set the cflags during a python_anonymous() function, and
thus it guarantees deterministic execution order.

This change here was tested to work using host gcc versions 4.8.4 and
6.3.0 and 7.3.0

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 recipes-core/openjdk/openjdk-8-common.inc     | 55 +++++++++++--------
 .../openjdk/openjdk-8-release-16xbyy.inc      |  3 +-
 2 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index 4e52448..fb97e97 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -224,32 +224,39 @@ FLAGS_GCC7 = "-fno-lifetime-dse -fno-delete-null-pointer-checks"
 # version is and only add the flags that are appropriate for that GCC
 # version.
 
-def version_specific_cflags(d):
-    import re
-
-    extraflags = None
-    version = None
+def get_cflags_by_cc_version(d, version):
+    if version.isdigit():
+        return d.getVar('FLAGS_GCC%d' % int(version)) or ''
+    return ''
 
-    if bb.data.inherits_class('native', d):
+def get_build_cflags(d):
+    def get_build_cc_version(build_cc):
         from subprocess import Popen, PIPE
-
-        cmd = d.expand('${CC} -dumpversion').split()
+        cmd = d.expand('%s -dumpversion' % build_cc).split()
         cc = Popen(cmd, stdout=PIPE, stderr=PIPE)
-        version = cc.communicate()[0].decode('utf-8')[0]
-    else:
-        # in the cross case, trust that GCCVERSION is correct. This won't
-        # 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():]
+        return cc.communicate()[0].decode('utf-8')[0]
 
-    if version.isdigit():
-        extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) or ''
-        return extraflags
-    return ''
+    build_cc = d.getVar('BUILD_CC')
+    version = get_build_cc_version(build_cc)
+    return get_cflags_by_cc_version(d, version)
+
+def get_target_cflags(d):
+    import re
 
-CFLAGS_append = " ${@version_specific_cflags(d)}"
-CXXFLAGS_append = " ${@version_specific_cflags(d)}"
+    # in the cross case, trust that GCCVERSION is correct. This won't
+    # work if the native toolchain is Clang, but as of this writing that
+    # doesn't work anyway.
+    version = d.getVar('GCCVERSION')[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():]
+    return get_cflags_by_cc_version(d, version)
+
+
+# flags for -native, and for bits that need a host-tool during -cross
+BUILD_CFLAGS_append = " ${@get_build_cflags(d)}"
+BUILD_CXXFLAGS_append = " ${@get_build_cflags(d)}"
+# flags for -cross
+TARGET_CFLAGS_append = " ${@get_target_cflags(d)}"
+TARGET_CXXFLAGS_append = " ${@get_target_cflags(d)}"
diff --git a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
index fd95e95..36ce073 100644
--- a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
+++ b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
@@ -54,7 +54,8 @@ ARM_INSTRUCTION_SET_armv4t = "ARM"
 
 # readdir_r was deprecated in glibc-2.24. Ignore the error for now
 # NOTE: When updating the recipe, please check if this is still needed
-CFLAGS_append = " -Wno-error=deprecated-declarations"
+BUILD_CFLAGS_append = " -Wno-error=deprecated-declarations"
+TARGET_CFLAGS_append = " -Wno-error=deprecated-declarations"
 
 # Enable zero mode for arm based builds, as normal hotspot fails to build
 PACKAGECONFIG_append_arm = " zero"
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 5/9] openjdk-8: gcc-8 fix #1: backport patch to fix misuses of strncpy/strncat
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (3 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 4/9] openjdk-8: fix infrastructure for version host gcc != cross gcc (again) André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type) André Draszik
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

The original approach doesn't work with all compilers, as
not all compilers support the flag used to suppress the
warnings / errors.

This patch here avoids passing unsupported compiler options
into older compilers, and at the same time fixes the bugs,
rather than just silencing the compiler.

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 .../openjdk/openjdk-8-release-16xbyy.inc      |   1 +
 ...-patch-to-fix-misuses-of-strncpy-str.patch | 181 ++++++++++++++++++
 2 files changed, 182 insertions(+)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/0011-hotspot-backport-patch-to-fix-misuses-of-strncpy-str.patch

diff --git a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
index 36ce073..bd440c6 100644
--- a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
+++ b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
@@ -17,6 +17,7 @@ PATCHES_URI = "\
     file://0009-jdk-disable-backtrace-musl-build-fix.patch \
     file://0010-build-fix-build-on-as-needed-toolchains-generic.patch \
     file://hotspot_fix_gcc8x_build.patch \
+    file://0011-hotspot-backport-patch-to-fix-misuses-of-strncpy-str.patch \
 "
 # some patches extracted from http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
 # reported via http://mail.openjdk.java.net/pipermail/build-dev/2015-January/013972.html
diff --git a/recipes-core/openjdk/patches-openjdk-8/0011-hotspot-backport-patch-to-fix-misuses-of-strncpy-str.patch b/recipes-core/openjdk/patches-openjdk-8/0011-hotspot-backport-patch-to-fix-misuses-of-strncpy-str.patch
new file mode 100644
index 0000000..4ab0d7a
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/0011-hotspot-backport-patch-to-fix-misuses-of-strncpy-str.patch
@@ -0,0 +1,181 @@
+From cc8fb308b36d323ee8a1e3a60e4c2ac006f710ab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
+Date: Fri, 10 Aug 2018 14:54:45 +0100
+Subject: [PATCH] hotspot: backport patch to fix misuses of strncpy/strncat
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Various small fixes around strncpy and strncat
+
+Compilation using gcc >= 8 fails because of errors regarding
+misuse of string functions.
+Fix them using a backport from openjdk-10
+
+Modelled after http://hg.openjdk.java.net/jdk-updates/jdk10u/rev/b1608535e50f
+
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+
+---
+Upstream-Status: Backport [http://hg.openjdk.java.net/jdk-updates/jdk10u/rev/b1608535e50f]
+ hotspot/agent/src/os/linux/libproc_impl.c       |  7 ++++++-
+ hotspot/src/share/tools/hsdis/hsdis.c           |  1 +
+ hotspot/src/share/vm/compiler/compileBroker.hpp |  3 ++-
+ hotspot/src/share/vm/compiler/disassembler.cpp  |  1 +
+ hotspot/src/share/vm/runtime/arguments.cpp      | 13 ++++++-------
+ hotspot/src/share/vm/utilities/ostream.cpp      | 14 +++++++++-----
+ hotspot/src/share/vm/utilities/vmError.cpp      |  9 +--------
+ 7 files changed, 26 insertions(+), 22 deletions(-)
+
+diff --git a/hotspot/agent/src/os/linux/libproc_impl.c b/hotspot/agent/src/os/linux/libproc_impl.c
+index 2ea0d0f8..ab23fb16 100644
+--- a/hotspot/agent/src/os/linux/libproc_impl.c
++++ b/hotspot/agent/src/os/linux/libproc_impl.c
+@@ -162,7 +162,12 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd,
+       return NULL;
+    }
+ 
+-   strncpy(newlib->name, libname, sizeof(newlib->name));
++   if (strlen(libname) >= sizeof(newlib->name)) {
++     print_debug("libname %s too long\n", libname);
++     return NULL;
++   }
++   strcpy(newlib->name, libname);
++
+    newlib->base = base;
+ 
+    if (fd == -1) {
+diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c
+index b56330e4..4e6fd9af 100644
+--- a/hotspot/src/share/tools/hsdis/hsdis.c
++++ b/hotspot/src/share/tools/hsdis/hsdis.c
+@@ -410,6 +410,7 @@ static void parse_caller_options(struct hsdis_app_data* app_data, const char* ca
+     }
+     p = q;
+   }
++  *iop = '\0';
+ }
+ 
+ static void print_help(struct hsdis_app_data* app_data,
+diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp
+index 7a381cd3..2aea6dd1 100644
+--- a/hotspot/src/share/vm/compiler/compileBroker.hpp
++++ b/hotspot/src/share/vm/compiler/compileBroker.hpp
+@@ -173,7 +173,8 @@ class CompilerCounters : public CHeapObj<mtCompiler> {
+     // these methods should be called in a thread safe context
+ 
+     void set_current_method(const char* method) {
+-      strncpy(_current_method, method, (size_t)cmname_buffer_length);
++      strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
++      _current_method[cmname_buffer_length-1] = '\0';
+       if (UsePerfData) _perf_current_method->set_value(method);
+     }
+ 
+diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp
+index 69974763..111214a9 100644
+--- a/hotspot/src/share/vm/compiler/disassembler.cpp
++++ b/hotspot/src/share/vm/compiler/disassembler.cpp
+@@ -298,6 +298,7 @@ address decode_env::handle_event(const char* event, address arg) {
+         strlen((const char*)arg) > sizeof(buffer) - 1) {
+       // Only print this when the mach changes
+       strncpy(buffer, (const char*)arg, sizeof(buffer) - 1);
++      buffer[sizeof(buffer) - 1] = '\0';
+       output()->print_cr("[Disassembling for mach='%s']", arg);
+     }
+   } else if (match(event, "format bytes-per-line")) {
+diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
+index cccff7a8..7589b443 100644
+--- a/hotspot/src/share/vm/runtime/arguments.cpp
++++ b/hotspot/src/share/vm/runtime/arguments.cpp
+@@ -3430,7 +3430,7 @@ void Arguments::fix_appclasspath() {
+     }
+ 
+     char* copy = AllocateHeap(strlen(src) + 1, mtInternal);
+-    strncpy(copy, src, strlen(src) + 1);
++    strcpy(copy, src);
+ 
+     // trim all trailing empty paths
+     for (char* tail = copy + strlen(copy) - 1; tail >= copy && *tail == separator; tail--) {
+@@ -3804,17 +3804,16 @@ static char* get_shared_archive_path() {
+     if (end != NULL) *end = '\0';
+     size_t jvm_path_len = strlen(jvm_path);
+     size_t file_sep_len = strlen(os::file_separator());
+-    shared_archive_path = NEW_C_HEAP_ARRAY(char, jvm_path_len +
+-        file_sep_len + 20, mtInternal);
++    const size_t len = jvm_path_len + file_sep_len + 20;
++    shared_archive_path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
+     if (shared_archive_path != NULL) {
+-      strncpy(shared_archive_path, jvm_path, jvm_path_len + 1);
+-      strncat(shared_archive_path, os::file_separator(), file_sep_len);
+-      strncat(shared_archive_path, "classes.jsa", 11);
++      jio_snprintf(shared_archive_path, len, "%s%sclasses.jsa",
++        jvm_path, os::file_separator());
+     }
+   } else {
+     shared_archive_path = NEW_C_HEAP_ARRAY(char, strlen(SharedArchiveFile) + 1, mtInternal);
+     if (shared_archive_path != NULL) {
+-      strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
++      strcpy(shared_archive_path, SharedArchiveFile);
+     }
+   }
+   return shared_archive_path;
+diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp
+index 44ce683d..bc3773fe 100644
+--- a/hotspot/src/share/vm/utilities/ostream.cpp
++++ b/hotspot/src/share/vm/utilities/ostream.cpp
+@@ -112,7 +112,7 @@ const char* outputStream::do_vsnprintf(char* buffer, size_t buflen,
+   }
+   if (add_cr) {
+     if (result != buffer) {
+-      strncpy(buffer, result, buflen);
++      memcpy(buffer, result, result_len);
+       result = buffer;
+     }
+     buffer[result_len++] = '\n';
+@@ -337,15 +337,19 @@ void stringStream::write(const char* s, size_t len) {
+       assert(rm == NULL || Thread::current()->current_resource_mark() == rm,
+              "stringStream is re-allocated with a different ResourceMark");
+       buffer = NEW_RESOURCE_ARRAY(char, end);
+-      strncpy(buffer, oldbuf, buffer_pos);
++      if (buffer_pos > 0) {
++        memcpy(buffer, oldbuf, buffer_pos);
++      }
+       buffer_length = end;
+     }
+   }
+   // invariant: buffer is always null-terminated
+   guarantee(buffer_pos + write_len + 1 <= buffer_length, "stringStream oob");
+-  buffer[buffer_pos + write_len] = 0;
+-  strncpy(buffer + buffer_pos, s, write_len);
+-  buffer_pos += write_len;
++  if (write_len > 0) {
++    buffer[buffer_pos + write_len] = 0;
++    memcpy(buffer + buffer_pos, s, write_len);
++    buffer_pos += write_len;
++  }
+ 
+   // Note that the following does not depend on write_len.
+   // This means that position and count get updated
+diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp
+index 15f6bf48..4ab85f5d 100644
+--- a/hotspot/src/share/vm/utilities/vmError.cpp
++++ b/hotspot/src/share/vm/utilities/vmError.cpp
+@@ -421,14 +421,7 @@ void VMError::report(outputStream* st) {
+ #else
+          const char *file = _filename;
+ #endif
+-         size_t len = strlen(file);
+-         size_t buflen = sizeof(buf);
+-
+-         strncpy(buf, file, buflen);
+-         if (len + 10 < buflen) {
+-           sprintf(buf + len, ":%d", _lineno);
+-         }
+-         st->print(" (%s)", buf);
++         st->print(" (%s:%d)", file, _lineno);
+        } else {
+          st->print(" (0x%x)", _id);
+        }
+-- 
+2.18.0
+
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type)
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (4 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 5/9] openjdk-8: gcc-8 fix #1: backport patch to fix misuses of strncpy/strncat André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 13:03   ` Richard Leitner
  2018-08-13 10:09 ` [meta-java][PATCH 7/9] Revert "openjdk-8: fix build for gcc8.x" André Draszik
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

Similar to the patch just reverted, we wilence the build warnings
regarding return type of functions, but we only do this for gcc versions
where it matters, now that our infrastructure for doing so works again:

    | <<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.

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 fb97e97..77d905d 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 = "-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



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 7/9] Revert "openjdk-8: fix build for gcc8.x"
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (5 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type) André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 8/9] openjdk-8: gcc-8 fix #3: working binaries André Draszik
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

This reverts commit 52fb41cec7d5125bb11c718705158696ffef11f8.

The change being reverted has two problems:
- it still doesn't produce working binaries
- compilation on pre-gcc v7 compilers fails (which is
  relevant for compiling openjdk-8-native, as that
  uses the build machine's gcc, not yocto's gcc):
  | At global scope:
  | cc1plus: error: unrecognized command line option ‘-Wno-stringop-overflow’ [-Werror]
  | cc1plus: all warnings being treated as errors

We now use a different approach to address the issues
than that patch, and it is thusly not needed anymore.

We fully support gcc < 7 again.

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 .../openjdk/openjdk-8-release-16xbyy.inc      |  1 -
 .../hotspot_fix_gcc8x_build.patch             | 21 -------------------
 2 files changed, 22 deletions(-)
 delete mode 100644 recipes-core/openjdk/patches-openjdk-8/hotspot_fix_gcc8x_build.patch

diff --git a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
index bd440c6..8b30c37 100644
--- a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
+++ b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
@@ -16,7 +16,6 @@ PATCHES_URI = "\
     file://0008-jdk-use-correct-include-for-signal.patch \
     file://0009-jdk-disable-backtrace-musl-build-fix.patch \
     file://0010-build-fix-build-on-as-needed-toolchains-generic.patch \
-    file://hotspot_fix_gcc8x_build.patch \
     file://0011-hotspot-backport-patch-to-fix-misuses-of-strncpy-str.patch \
 "
 # some patches extracted from http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
diff --git a/recipes-core/openjdk/patches-openjdk-8/hotspot_fix_gcc8x_build.patch b/recipes-core/openjdk/patches-openjdk-8/hotspot_fix_gcc8x_build.patch
deleted file mode 100644
index 1a406f2..0000000
--- a/recipes-core/openjdk/patches-openjdk-8/hotspot_fix_gcc8x_build.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Richard Leitner <richard.leitner@skidata.com>
-Date: Thu, 14 Jun 2018 23:42:11 +0200
-Subject: [PATCH] openjdk-8: hotspot: fix gcc8 compilation
-
-As oe-core/yocto-project master migrated to gcc8.x we need to support this.
-Therefore disable following gcc warnings/errors which caused the build to fail:
-  + stringop-overflow
-  + return-type
----
-
---- a/hotspot/make/linux/makefiles/gcc.make
-+++ b/hotspot/make/linux/makefiles/gcc.make
-@@ -197,7 +197,7 @@
- endif
- 
- # Compiler warnings are treated as errors
--WARNINGS_ARE_ERRORS = -Werror
-+WARNINGS_ARE_ERRORS = -Werror -Wno-stringop-overflow -Wno-error=return-type
- 
- ifeq ($(USE_CLANG), true)
-   # However we need to clean the code up before we can unrestrictedly enable this option with Clang
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 8/9] openjdk-8: gcc-8 fix #3: working binaries
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (6 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 7/9] Revert "openjdk-8: fix build for gcc8.x" André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:09 ` [meta-java][PATCH 9/9] openjdk-8: update to 8u172b11 André Draszik
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

With this,
    bitbake -c testimage openjdk-8-test-image
works again for x86_64 and aarch64:
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

NOTE: armv5e still doesn't work with gcc v8, and other arches
weren't tested.

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

diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index 77d905d..aaa4483 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -216,7 +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 = "-Wno-error=return-type"
+FLAGS_GCC8 = "-fno-lifetime-dse -fno-delete-null-pointer-checks -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



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [meta-java][PATCH 9/9] openjdk-8: update to 8u172b11
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (7 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 8/9] openjdk-8: gcc-8 fix #3: working binaries André Draszik
@ 2018-08-13 10:09 ` André Draszik
  2018-08-13 10:41 ` [meta-java] OpenJDK-8 fixes and updates Richard Leitner
  2018-08-13 14:53 ` Richard Leitner
  10 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 10:09 UTC (permalink / raw)
  To: openembedded-devel

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

Signed-off-by: André Draszik <andre.draszik@jci.com>

---
v3:
* rebased

v2:
* file checksums for aarch64 updated because archives were
  regenerated server-side
---
 ...e_162b12.bb => openjdk-8-native_172b11.bb} |  0
 .../openjdk/openjdk-8-release-161b15.inc      | 33 -------------
 .../openjdk/openjdk-8-release-162b12.inc      | 49 -------------------
 .../openjdk-8-release-172b11-aarch64.inc      | 33 +++++++++++++
 ...nc => openjdk-8-release-172b11-common.inc} |  0
 .../openjdk/openjdk-8-release-172b11.inc      | 36 ++++++++++++++
 ...penjdk-8_16xbyy.bb => openjdk-8_172b11.bb} |  7 ++-
 ...penjre-8_16xbyy.bb => openjre-8_172b11.bb} |  7 ++-
 8 files changed, 75 insertions(+), 90 deletions(-)
 rename recipes-core/openjdk/{openjdk-8-native_162b12.bb => openjdk-8-native_172b11.bb} (100%)
 delete mode 100644 recipes-core/openjdk/openjdk-8-release-161b15.inc
 delete mode 100644 recipes-core/openjdk/openjdk-8-release-162b12.inc
 create mode 100644 recipes-core/openjdk/openjdk-8-release-172b11-aarch64.inc
 rename recipes-core/openjdk/{openjdk-8-release-16xbyy.inc => openjdk-8-release-172b11-common.inc} (100%)
 create mode 100644 recipes-core/openjdk/openjdk-8-release-172b11.inc
 rename recipes-core/openjdk/{openjdk-8_16xbyy.bb => openjdk-8_172b11.bb} (92%)
 rename recipes-core/openjdk/{openjre-8_16xbyy.bb => openjre-8_172b11.bb} (91%)

diff --git a/recipes-core/openjdk/openjdk-8-native_162b12.bb b/recipes-core/openjdk/openjdk-8-native_172b11.bb
similarity index 100%
rename from recipes-core/openjdk/openjdk-8-native_162b12.bb
rename to recipes-core/openjdk/openjdk-8-native_172b11.bb
diff --git a/recipes-core/openjdk/openjdk-8-release-161b15.inc b/recipes-core/openjdk/openjdk-8-release-161b15.inc
deleted file mode 100644
index 0a4434c..0000000
--- a/recipes-core/openjdk/openjdk-8-release-161b15.inc
+++ /dev/null
@@ -1,33 +0,0 @@
-require openjdk-8-release-16xbyy.inc
-
-CORBA_CHANGESET_aarch64 = "f73da600c483"
-SRC_URI[corba.md5sum] = "bf884b82fcc6de466946fcb87d24ebf3"
-SRC_URI[corba.sha256sum] = "ebf73d96185fc05e502088ae89a8d6494c3971dd220458deeff3876f72396b6c"
-
-HOTSPOT_CHANGESET_aarch64 = "a600839824fa"
-SRC_URI[hotspot.md5sum] = "20c88ba26f8f45a2769f4edf32afd593"
-SRC_URI[hotspot.sha256sum] = "6d0d1b9c2df3392ad6e21ca3eae39d06b50632a4a419da3d4363248943ea8b97"
-
-JAXP_CHANGESET_aarch64 = "b1e2af899046"
-SRC_URI[jaxp.md5sum] = "219582b26d7de2973b75f4329b53ec7d"
-SRC_URI[jaxp.sha256sum] = "907cc4dfb01a3a2a6d74dfa90fa6fcb5b3df55600f41ba44dcdc94b47e85a382"
-
-JAXWS_CHANGESET_aarch64 = "0002ed323fe5"
-SRC_URI[jaxws.md5sum] = "44935b81e3405fcaef675d5d08c2149e"
-SRC_URI[jaxws.sha256sum] = "0d1d52f1cf254a643ece1bd6cd8628fae1a4d56e8b59388cc9ad73b3caf151a1"
-
-JDK_CHANGESET_aarch64 = "c2ba2ed87d18"
-SRC_URI[jdk.md5sum] = "f4c0393a157dcb8b90ee7c7d80cbdfbf"
-SRC_URI[jdk.sha256sum] = "c84a17451b47242f9d96bf431011607afc3776f285a6ad9a60190fba2d434c49"
-
-LANGTOOLS_CHANGESET_aarch64 = "cdb217c578cb"
-SRC_URI[langtools.md5sum] = "608cf07781259d916d1663d6a5ced26d"
-SRC_URI[langtools.sha256sum] = "ad28e75bfaba1b64fdd02ea316db3ba3cba68007f90c5fa2be2418ce8bc0074d"
-
-NASHORN_CHANGESET_aarch64 = "505d0eb2fafe"
-SRC_URI[nashorn.md5sum] = "be981a6c55f9e602ff129fed65505a8c"
-SRC_URI[nashorn.sha256sum] = "14419ccd773e1db83b600d05aca3cbac9f24be77abda9a132d12305d8821d6d7"
-
-OPENJDK_CHANGESET_aarch64 = "917454da25c1"
-SRC_URI[openjdk.md5sum] = "1e4b3eca032742b7448731f9b8fcb426"
-SRC_URI[openjdk.sha256sum] = "1e17e2d8384a7b808a89b982e7c09c4feb8598b7a66b93697bfb8759c1005974"
diff --git a/recipes-core/openjdk/openjdk-8-release-162b12.inc b/recipes-core/openjdk/openjdk-8-release-162b12.inc
deleted file mode 100644
index bc2b342..0000000
--- a/recipes-core/openjdk/openjdk-8-release-162b12.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-require openjdk-8-release-16xbyy.inc
-
-# We do not yet work for aarch64.
-COMPATIBLE_HOST = "^(?!aarch64).*"
-
-CORBA_CHANGESET = "f6b6ad6feb6e"
-SRC_URI[corba.md5sum] = "0358300224b63f3deeba63d3de7d765c"
-SRC_URI[corba.sha256sum] = "54da09fd0c76834094d9f167c03ff1ac2373f5e46fb26d24d0d018cdc59a2842"
-
-HOTSPOT_CHANGESET = "d2e3920d2fd0"
-SRC_URI[hotspot.md5sum] = "17a1da8be42ad0c7778e7090ea5003c1"
-SRC_URI[hotspot.sha256sum] = "3f07ee7a49cb4258ef00a8a896b0f7f87e85f06dc31f6c0db698d8058926b365"
-
-JAXP_CHANGESET = "e8a1a2db69dc"
-SRC_URI[jaxp.md5sum] = "9b344a6cf317ca485b8790e67ccc2467"
-SRC_URI[jaxp.sha256sum] = "fbd0eaed48415c2918a47e7d76ce276416bab792e1959b1d3dee2b703aa76f5a"
-
-JAXWS_CHANGESET = "7b4329f78e52"
-SRC_URI[jaxws.md5sum] = "b1da20ee79382eb5bb72077eb02addd4"
-SRC_URI[jaxws.sha256sum] = "ffd31d467c6fe7fc0956e801c08168d48ba02b4dea38b7dedbafc054092ca8f0"
-
-JDK_CHANGESET = "d201d8b87f48"
-SRC_URI[jdk.md5sum] = "bced8a322e53083472b39f01e938b21a"
-SRC_URI[jdk.sha256sum] = "6e057ceb02a7d8bb66233d52b23d246120b5c0d72e7a71cb6fb0ace84e8bb581"
-
-LANGTOOLS_CHANGESET = "034738d4f1d2"
-SRC_URI[langtools.md5sum] = "fbc6faea65cfc248f93f54e634d7bf50"
-SRC_URI[langtools.sha256sum] = "91615ade480c706f58062e74ee112f95ab947e1c5366a29a7d9b2b6b0a2f72d3"
-
-NASHORN_CHANGESET = "81ce60cabe97"
-SRC_URI[nashorn.md5sum] = "318993c189f16894abe94db14a067618"
-SRC_URI[nashorn.sha256sum] = "8df64026be98e6efad200ef8639e2f7e96a783e262b402afcb8045f46709e457"
-
-OPENJDK_CHANGESET = "4be07cb28b21"
-SRC_URI[openjdk.md5sum] = "24d30b66aaaef51af9b598c8989c1c82"
-SRC_URI[openjdk.sha256sum] = "8f9ecc5fc5f9c6df671a2ef07949f86080823c89954b2b87f6727a82af679eca"
-
-
-#CACAO_VERSION = "e215e36be9fc"
-#CACAO_FILE = "${CACAO_VERSION}.tar.gz"
-#CACAO_URI = "http://icedtea.wildebeest.org/download/drops/cacao/${CACAO_FILE};name=cacao;unpack=false"
-#SRC_URI[cacao.md5sum] = "79f95f0aea4ba04cf2f1a8632ac66d14"
-#SRC_URI[cacao.sha256sum] = "4966514c72ee7ed108b882d9b6e65c3adf8a8f9c2dccb029f971b3c8cb4870ab"
-#
-#JAMVM_VERSION = "ec18fb9e49e62dce16c5094ef1527eed619463aa"
-#JAMVM_FILE = "jamvm-${JAMVM_VERSION}.tar.gz"
-#JAMVM_URI = "http://icedtea.wildebeest.org/download/drops/jamvm/${JAMVM_FILE};name=jamvm;unpack=false"
-#SRC_URI[jamvm.md5sum] = "d50ae193d01a9251e10679c7a2cc6ff1"
-#SRC_URI[jamvm.sha256sum] = "31810266666c23822942aac62a78019c2c4589e1c5ee48329cbf42652d4437bc"
diff --git a/recipes-core/openjdk/openjdk-8-release-172b11-aarch64.inc b/recipes-core/openjdk/openjdk-8-release-172b11-aarch64.inc
new file mode 100644
index 0000000..dddae6a
--- /dev/null
+++ b/recipes-core/openjdk/openjdk-8-release-172b11-aarch64.inc
@@ -0,0 +1,33 @@
+require openjdk-8-release-172b11-common.inc
+
+CORBA_CHANGESET_aarch64 = "3a04a7c080af"
+SRC_URI[corba.md5sum] = "758b29d6cf714fd894df8674afd78e17"
+SRC_URI[corba.sha256sum] = "564113dbeadc57ac5831ccc056e0b920adbd3b74558cf750aa899f5de25ceb5e"
+
+HOTSPOT_CHANGESET_aarch64 = "1ced2ae00e35"
+SRC_URI[hotspot.md5sum] = "1db8a0e5e63352f1743e9d41ab6ed5cf"
+SRC_URI[hotspot.sha256sum] = "6993c3138035a7c0d2782b1ca7aabdb43452b1abbcc60448042f5c9207b03ab5"
+
+JAXP_CHANGESET_aarch64 = "ab8087f496fe"
+SRC_URI[jaxp.md5sum] = "0e7d8755af72aaf9ec7521514d8bb541"
+SRC_URI[jaxp.sha256sum] = "6e70c1535d738dc2c4e3a2fb9e6e11c660172b6d2ce905ec33e8924f8c208978"
+
+JAXWS_CHANGESET_aarch64 = "1e71aeefeecf"
+SRC_URI[jaxws.md5sum] = "16ff9ba1007aee21ad3df472b1f5c55e"
+SRC_URI[jaxws.sha256sum] = "b6ccb2855c2e9cd5778b193b5ad47f2e13496cbbbad74497c70216cd04b4c7dc"
+
+JDK_CHANGESET_aarch64 = "e8e6553e7ca9"
+SRC_URI[jdk.md5sum] = "52b35732c17e9048e506b7b46c1282f8"
+SRC_URI[jdk.sha256sum] = "ffaa79dad3b126af77ac9c230c54805b224c5d6517830a37c7272678407c99da"
+
+LANGTOOLS_CHANGESET_aarch64 = "14d381cbe563"
+SRC_URI[langtools.md5sum] = "d14425cc0334ed46ce695c9930bff6d5"
+SRC_URI[langtools.sha256sum] = "a4334c8859fe48bf2eae3b076785ff2e36a5ae80cf5840aef32731c3099a2274"
+
+NASHORN_CHANGESET_aarch64 = "c667b467b394"
+SRC_URI[nashorn.md5sum] = "0389c953bdd14c804d873d95ff4b3033"
+SRC_URI[nashorn.sha256sum] = "7cd87e641f0781481635593c144c8030f20d97cfc048ca57bd56381bab8e7d92"
+
+OPENJDK_CHANGESET_aarch64 = "74564d40b0d6"
+SRC_URI[openjdk.md5sum] = "13f7f15386f7aa0cc3383e9d1e98d2f1"
+SRC_URI[openjdk.sha256sum] = "a6425e11700edcdc0761df9da75b28b48adc664f3d8259c49ced1c85af3dc502"
diff --git a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc b/recipes-core/openjdk/openjdk-8-release-172b11-common.inc
similarity index 100%
rename from recipes-core/openjdk/openjdk-8-release-16xbyy.inc
rename to recipes-core/openjdk/openjdk-8-release-172b11-common.inc
diff --git a/recipes-core/openjdk/openjdk-8-release-172b11.inc b/recipes-core/openjdk/openjdk-8-release-172b11.inc
new file mode 100644
index 0000000..fdf7b39
--- /dev/null
+++ b/recipes-core/openjdk/openjdk-8-release-172b11.inc
@@ -0,0 +1,36 @@
+require openjdk-8-release-172b11-common.inc
+
+# We do not yet work for aarch64.
+COMPATIBLE_HOST = "^(?!aarch64).*"
+
+CORBA_CHANGESET = "875a75c440cd"
+SRC_URI[corba.md5sum] = "66242dd6e749f39a5ef6add34f5ecb2f"
+SRC_URI[corba.sha256sum] = "f1618be7ad88619c7d7c1eed9800c528d0646e1c9f039e20a57b3e72ae3d3512"
+
+HOTSPOT_CHANGESET = "32ba4d2121c1"
+SRC_URI[hotspot.md5sum] = "a3e1d2f91ba8873f71e9a72043e2644a"
+SRC_URI[hotspot.sha256sum] = "680b1f5100786910bfceeef90ce28d74fcf6eacfdd3b92dfc76dcf3216060e99"
+
+JAXP_CHANGESET = "30586bb50743"
+SRC_URI[jaxp.md5sum] = "b413b1cb709d74e513f13c586215366d"
+SRC_URI[jaxp.sha256sum] = "ba36dd8ad72ff3d8bda38b7d6773037e18c3c68ebadd61f1e1f7fc167a506baa"
+
+JAXWS_CHANGESET = "452a6a5a878e"
+SRC_URI[jaxws.md5sum] = "5c3c4d1fec19398128cf818aef5486a9"
+SRC_URI[jaxws.sha256sum] = "89aa34e6bc3410a85ea697aa4ae70c21f7099efdacef78a6e5a46747421e86f9"
+
+JDK_CHANGESET = "5ccc572f4ffe"
+SRC_URI[jdk.md5sum] = "29dd4772e3862193e56007a0bb0d6886"
+SRC_URI[jdk.sha256sum] = "4d1758ceec155fcd2cd786f11071ed614947a9720373d704221d78ed98beadec"
+
+LANGTOOLS_CHANGESET = "34ee52bc68a4"
+SRC_URI[langtools.md5sum] = "b195802f2aaa5c95c06cc50021bb42a6"
+SRC_URI[langtools.sha256sum] = "0403bd2c9a45e4c0dc2148907028e0cdfd087be512e6d6b3763a01411936663a"
+
+NASHORN_CHANGESET = "7efd6152328e"
+SRC_URI[nashorn.md5sum] = "3aa4b31fdbf330baf28194e21697b8d6"
+SRC_URI[nashorn.sha256sum] = "8b5cbd29e9dbace477a57d7c07a127312dd3cf6b8e648b0b64026616d12c6862"
+
+OPENJDK_CHANGESET = "33d274a7dda0"
+SRC_URI[openjdk.md5sum] = "105f62e8f22a68b8c4151c68a447f76e"
+SRC_URI[openjdk.sha256sum] = "bf49215fe1e43e6f110470c911fce32722c843e03efb68e40cc7a832eb80faea"
diff --git a/recipes-core/openjdk/openjdk-8_16xbyy.bb b/recipes-core/openjdk/openjdk-8_172b11.bb
similarity index 92%
rename from recipes-core/openjdk/openjdk-8_16xbyy.bb
rename to recipes-core/openjdk/openjdk-8_172b11.bb
index 522d6b5..9c2a7a1 100644
--- a/recipes-core/openjdk/openjdk-8_16xbyy.bb
+++ b/recipes-core/openjdk/openjdk-8_172b11.bb
@@ -1,7 +1,6 @@
-PV = "162b12"
-PV_aarch64 = "161b15"
-
-require openjdk-8-release-${PV}.inc
+INC_FILE_SUFFIX = ""
+INC_FILE_SUFFIX_aarch64 = "-aarch64"
+require openjdk-8-release-${PV}${INC_FILE_SUFFIX}.inc
 require openjdk-8-cross.inc
 
 do_install() {
diff --git a/recipes-core/openjdk/openjre-8_16xbyy.bb b/recipes-core/openjdk/openjre-8_172b11.bb
similarity index 91%
rename from recipes-core/openjdk/openjre-8_16xbyy.bb
rename to recipes-core/openjdk/openjre-8_172b11.bb
index e6454ea..220dc01 100644
--- a/recipes-core/openjdk/openjre-8_16xbyy.bb
+++ b/recipes-core/openjdk/openjre-8_172b11.bb
@@ -1,7 +1,6 @@
-PV = "162b12"
-PV_aarch64 = "161b15"
-
-require openjdk-8-release-${PV}.inc
+INC_FILE_SUFFIX = ""
+INC_FILE_SUFFIX_aarch64 = "-aarch64"
+require openjdk-8-release-${PV}${INC_FILE_SUFFIX}.inc
 require openjdk-8-cross.inc
 
 do_install() {
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [meta-java] OpenJDK-8 fixes and updates
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (8 preceding siblings ...)
  2018-08-13 10:09 ` [meta-java][PATCH 9/9] openjdk-8: update to 8u172b11 André Draszik
@ 2018-08-13 10:41 ` Richard Leitner
  2018-08-13 14:53 ` Richard Leitner
  10 siblings, 0 replies; 15+ messages in thread
From: Richard Leitner @ 2018-08-13 10:41 UTC (permalink / raw)
  To: openembedded-devel

Hi Andre,
thank you very much for this series and the work you've put in it!

I'll take a look at it ASAP.

regards;Richard.L

On 8/13/18 12:09 PM, André Draszik wrote:
> Hi,
> 
> This series addresses a few OpenJDK-8 issues:
> 
> Highlights are:
> * compilation on gcc < v7 host compilers was broken
> * compilation on gcc v8 (cross) compilers produced non-working binaries
> * update  to the latest 8u172b11 release
> 
> This series was tested on:
> * qemux86-64 (with & without security flags, host gcc 6.3.0, target gcc 8)
> * qemuarm64 (with & without security flags, host gcc 4.8.4 & 6.3.0, target gcc 8)
> * qemuarm64 (host gcc 7.3.0, target gcc 7.3.0)
> 
> Note that yocto's gcc 8 update completely broke qemuarm support, but I'll
> hopefully address this by importing the aarch32 openjdk port into this layer.
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type)
  2018-08-13 10:09 ` [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type) André Draszik
@ 2018-08-13 13:03   ` Richard Leitner
  2018-08-13 14:25     ` André Draszik
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Leitner @ 2018-08-13 13:03 UTC (permalink / raw)
  To: André Draszik, openembedded-devel

Hi André,
just some nitpicking:

On 8/13/18 12:09 PM, André Draszik wrote:
> From: André Draszik <andre.draszik@jci.com>
> 
> Similar to the patch just reverted, we wilence the build warnings
> regarding return type of functions, but we only do this for gcc versions
> where it matters, now that our infrastructure for doing so works again:

I guess with "the patch just reverted" you refer to the [PATCH 7/9] which will be applied afterwards.

Is it OK for you if I apply Patch #7 before Patch #6 so the commit message works out?

Furthermore I'll change "wilence" to "silence" if it's OK for you? ;-)

> 
>     | <<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.
> 
> 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 fb97e97..77d905d 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 = "-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
> 

regards;Richard.L


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [meta-java][PATCH 4/9] openjdk-8: fix infrastructure for version host gcc != cross gcc (again)
  2018-08-13 10:09 ` [meta-java][PATCH 4/9] openjdk-8: fix infrastructure for version host gcc != cross gcc (again) André Draszik
@ 2018-08-13 13:53   ` Richard Leitner
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Leitner @ 2018-08-13 13:53 UTC (permalink / raw)
  To: openembedded-devel

On 8/13/18 12:09 PM, André Draszik wrote:

> ...

> diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
> index 4e52448..fb97e97 100644
> --- a/recipes-core/openjdk/openjdk-8-common.inc
> +++ b/recipes-core/openjdk/openjdk-8-common.inc
> @@ -224,32 +224,39 @@ FLAGS_GCC7 = "-fno-lifetime-dse -fno-delete-null-pointer-checks"
>  # version is and only add the flags that are appropriate for that GCC
>  # version.
>  
> -def version_specific_cflags(d):
> -    import re
> -
> -    extraflags = None
> -    version = None
> +def get_cflags_by_cc_version(d, version):
> +    if version.isdigit():
> +        return d.getVar('FLAGS_GCC%d' % int(version)) or ''
> +    return ''
>  
> -    if bb.data.inherits_class('native', d):
> +def get_build_cflags(d):
> +    def get_build_cc_version(build_cc):
>          from subprocess import Popen, PIPE
> -
> -        cmd = d.expand('${CC} -dumpversion').split()
> +        cmd = d.expand('%s -dumpversion' % build_cc).split()
>          cc = Popen(cmd, stdout=PIPE, stderr=PIPE)
> -        version = cc.communicate()[0].decode('utf-8')[0]
> -    else:
> -        # in the cross case, trust that GCCVERSION is correct. This won't
> -        # 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():]
> +        return cc.communicate()[0].decode('utf-8')[0]
>  
> -    if version.isdigit():
> -        extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) or ''
> -        return extraflags
> -    return ''
> +    build_cc = d.getVar('BUILD_CC')
> +    version = get_build_cc_version(build_cc)
> +    return get_cflags_by_cc_version(d, version)
> +
> +def get_target_cflags(d):
> +    import re

First: Thank you for this patch and the reorganization of those functions!

As we will need those functions also for openjdk-7 it would be great if
they are accessible from there too.

The solution which came to my mind first would be to move the content from
openjdk-common.inc to openjdk-7-common.inc (as it's the only file 
requiring" it).

Then place those functions inside openjdk-common.inc and require it from
openjdk-7-common.inc and openjdk-8-common.inc.

What do you think about it? Any comments or other ideas?

(fyi: no need to change this patch! I just thought it would be a good
point for starting a discussion about it)

> ...

regards;Richard.L


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type)
  2018-08-13 13:03   ` Richard Leitner
@ 2018-08-13 14:25     ` André Draszik
  0 siblings, 0 replies; 15+ messages in thread
From: André Draszik @ 2018-08-13 14:25 UTC (permalink / raw)
  To: Richard Leitner, openembedded-devel

On Mon, 2018-08-13 at 15:03 +0200, Richard Leitner wrote:
> Hi André,
> just some nitpicking:
> 
> On 8/13/18 12:09 PM, André Draszik wrote:
> > From: André Draszik <andre.draszik@jci.com>
> > 
> > Similar to the patch just reverted, we wilence the build warnings
> > regarding return type of functions, but we only do this for gcc versions
> > where it matters, now that our infrastructure for doing so works again:
> 
> I guess with "the patch just reverted" you refer to the [PATCH 7/9] which
> will be applied afterwards.
> 
> Is it OK for you if I apply Patch #7 before Patch #6 so the commit message
> works out?

You're right. I had them in a different order when I wrote the commit
message, but then decided to fix the bugs first and remove the work-around
afterwards.

Up to you :-)

> Furthermore I'll change "wilence" to "silence" if it's OK for you? ;-)

Sure :-)

A.

> 
> > 
> >     |
> > <<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:1
> > 97:2: note: in expansion of macro 'ShouldNotReachHere'
> >     |   ShouldNotReachHere();
> >     |   ^~~~~~~~~~~~~~~~~~
> >     etc.
> > 
> > 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 fb97e97..77d905d 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 = "-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
> > 
> 
> regards;Richard.L


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [meta-java] OpenJDK-8 fixes and updates
  2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
                   ` (9 preceding siblings ...)
  2018-08-13 10:41 ` [meta-java] OpenJDK-8 fixes and updates Richard Leitner
@ 2018-08-13 14:53 ` Richard Leitner
  10 siblings, 0 replies; 15+ messages in thread
From: Richard Leitner @ 2018-08-13 14:53 UTC (permalink / raw)
  To: openembedded-devel

Hi,
this is a note to let you know that I've just added this patch series
to the master-next branch of the meta-java repository at
	git://git.yoctoproject.org/meta-java

As soon as it has gone through some more testing it will likely be
merged to the master branch.

If you have any questions, please let me know.

regards;Richard.L

On 8/13/18 12:09 PM, André Draszik wrote:
> Hi,
> 
> This series addresses a few OpenJDK-8 issues:
> 
> Highlights are:
> * compilation on gcc < v7 host compilers was broken
> * compilation on gcc v8 (cross) compilers produced non-working binaries
> * update  to the latest 8u172b11 release
> 
> This series was tested on:
> * qemux86-64 (with & without security flags, host gcc 6.3.0, target gcc 8)
> * qemuarm64 (with & without security flags, host gcc 4.8.4 & 6.3.0, target gcc 8)
> * qemuarm64 (host gcc 7.3.0, target gcc 7.3.0)
> 
> Note that yocto's gcc 8 update completely broke qemuarm support, but I'll
> hopefully address this by importing the aarch32 openjdk port into this layer.
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-08-13 14:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-13 10:09 [meta-java] OpenJDK-8 fixes and updates André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 1/9] gitignore: ignore new python byte-code files André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 2/9] openjdk-8: speed-up do_install() (pack200) André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 3/9] openjdk-8: remove superfluous compiler flag (-std=gnu++98) André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 4/9] openjdk-8: fix infrastructure for version host gcc != cross gcc (again) André Draszik
2018-08-13 13:53   ` Richard Leitner
2018-08-13 10:09 ` [meta-java][PATCH 5/9] openjdk-8: gcc-8 fix #1: backport patch to fix misuses of strncpy/strncat André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 6/9] openjdk-8: gcc-8 fix #2: silence build warnings/errors (return-type) André Draszik
2018-08-13 13:03   ` Richard Leitner
2018-08-13 14:25     ` André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 7/9] Revert "openjdk-8: fix build for gcc8.x" André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 8/9] openjdk-8: gcc-8 fix #3: working binaries André Draszik
2018-08-13 10:09 ` [meta-java][PATCH 9/9] openjdk-8: update to 8u172b11 André Draszik
2018-08-13 10:41 ` [meta-java] OpenJDK-8 fixes and updates Richard Leitner
2018-08-13 14:53 ` Richard Leitner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.