Re: [PATCH] Fail to build zero on x86

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fail to build zero on x86

Martin Buchholz-3
[build-dev redirect]

On Tue, Jan 9, 2018 at 2:16 AM, Ao Qi <[hidden email]> wrote:

> Hi,
>
> I found it failed to build zero. The repository I used is
> http://hg.openjdk.java.net/jdk/jdk
> I get this error (on Ubuntu 16.04 x86):
>
> $ sh configure  --with-boot-jdk=/my-path-to-jdk9 --with-jvm-variants=zero
> $ make hotspot
> Building target 'hotspot' in configuration
> 'linux-x86_64-normal-zero-release'
> Compiling 2 files for BUILD_JVMTI_TOOLS
> Creating support/modules_libs/java.base/libjsig.so from 1 file(s)
> Creating support/modules_libs/java.base/server/libjvm.so from 578 file(s)
> Creating hotspot/variant-zero/libjvm/gtest/libjvm.so from 76 file(s)
> Creating hotspot/variant-zero/libjvm/gtest/gtestLauncher from 1 file(s)
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/safepoint.cpp: In
> function 'static void
> SafepointSynchronize::check_for_lazy_critical_native(JavaThread*,
> JavaThreadState)':
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/
> safepoint.cpp:730:25:
> error: '<anonymous>' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>      if (stub_cb != NULL &&
>                          ^
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/safepoint.cpp: In
> static member function 'static void
> SafepointSynchronize::check_for_lazy_critical_native(JavaThread*,
> JavaThreadState)':
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/
> safepoint.cpp:730:25:
> error: '<anonymous>' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> cc1plus: all warnings being treated as errors
> lib/CompileJvm.gmk:212: recipe for target
> '/home/loongson/aoqi/jdk10/jdk/build/linux-x86_64-normal-
> zero-release/hotspot/variant-zero/libjvm/objs/safepoint.o'
> failed
> make[3]: ***
> [/home/loongson/aoqi/jdk10/jdk/build/linux-x86_64-normal-
> zero-release/hotspot/variant-zero/libjvm/objs/safepoint.o]
> Error 1
> make[3]: *** Waiting for unfinished jobs....
> make/Main.gmk:268: recipe for target 'hotspot-zero-libs' failed
> make[2]: *** [hotspot-zero-libs] Error 1
>
> ERROR: Build failed for target 'hotspot' in configuration
> 'linux-x86_64-normal-zero-release' (exit code 2)
>
> === Output from failing command(s) repeated here ===
> * For target hotspot_variant-zero_libjvm_objs_safepoint.o:
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/safepoint.cpp: In
> function 'static void
> SafepointSynchronize::check_for_lazy_critical_native(JavaThread*,
> JavaThreadState)':
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/
> safepoint.cpp:730:25:
> error: '<anonymous>' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>      if (stub_cb != NULL &&
>                          ^
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/safepoint.cpp: In
> static member function 'static void
> SafepointSynchronize::check_for_lazy_critical_native(JavaThread*,
> JavaThreadState)':
> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/
> safepoint.cpp:730:25:
> error: '<anonymous>' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> cc1plus: all warnings being treated as errors
>
> * All command lines available in
> /home/loongson/aoqi/jdk10/jdk/build/linux-x86_64-normal-
> zero-release/make-support/failure-logs.
> === End of repeated output ===
>
> === Make failed targets repeated here ===
> lib/CompileJvm.gmk:212: recipe for target
> '/home/loongson/aoqi/jdk10/jdk/build/linux-x86_64-normal-
> zero-release/hotspot/variant-zero/libjvm/objs/safepoint.o'
> failed
> make/Main.gmk:268: recipe for target 'hotspot-zero-libs' failed
> === End of repeated output ===
>
> Hint: Try searching the build log for the name of the first failed target.
> Hint: See doc/building.html#troubleshooting for assistance.
>
> /home/loongson/aoqi/jdk10/jdk/make/Init.gmk:291: recipe for target 'main'
> failed
> make[1]: *** [main] Error 1
> /home/loongson/aoqi/jdk10/jdk/make/Init.gmk:186: recipe for target
> 'hotspot' failed
> make: *** [hotspot] Error 2
>
>
> I made a small patch to pass the build. Could someone help to review and
> submit this patch? I had signed OCA.
>
> patch:
>
> diff -r 9a29aa153c20 src/hotspot/cpu/zero/frame_zero.inline.hpp
> --- a/src/hotspot/cpu/zero/frame_zero.inline.hpp Mon Jan 08 07:13:27 2018
> -0800
> +++ b/src/hotspot/cpu/zero/frame_zero.inline.hpp Tue Jan 09 15:38:05 2018
> +0800
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights
> reserved.
> + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights
> reserved.
>   * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
>   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>   *
> @@ -43,23 +43,16 @@
>  inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
>    _zeroframe = zf;
>    _sp = sp;
> +  _cb = NULL;
> +  _deopt_state = not_deoptimized;
>    switch (zeroframe()->type()) {
>    case ZeroFrame::ENTRY_FRAME:
>      _pc = StubRoutines::call_stub_return_pc();
> -    _cb = NULL;
> -    _deopt_state = not_deoptimized;
>      break;
>
> -  case ZeroFrame::INTERPRETER_FRAME:
> -    _pc = NULL;
> -    _cb = NULL;
> -    _deopt_state = not_deoptimized;
> -    break;
> -
> +  case ZeroFrame::INTERPRETER_FRAME: // fall through
>    case ZeroFrame::FAKE_STUB_FRAME:
>      _pc = NULL;
> -    _cb = NULL;
> -    _deopt_state = not_deoptimized;
>      break;
>
>    default:
>
>
> Thanks,
> Ao Qi
>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fail to build zero on x86

John Paul Adrian Glaubitz
Hi Ao!

On 01/09/2018 11:23 PM, Martin Buchholz wrote:
>> /home/loongson/aoqi/jdk10/jdk/src/hotspot/share/runtime/
>> safepoint.cpp:730:25:
>> error: '<anonymous>' may be used uninitialized in this function
>> [-Werror=maybe-uninitialized]
>>      if (stub_cb != NULL &&
>>                          ^

Ah, this might be because you're not building with --disable-warnings-as-errors
which I always use. I always build with:

sh ./configure --with-jvm-variants=zero --with-boot-jdk=/usr/lib/jvm/java-9-openjdk-amd64/ --disable-precompiled-headers --disable-warnings-as-errors && make
JOBS=32 MAKE_VERBOSE=y QUIETLY= LOG=debug CONF=linux-x86_64-normal-zero-release

which is the same configure line that the openjdk-7/8/9/10 packages in Debian
use. Sounds like a good idea to fix this warning though.

I assume that you eventually want to build OpenJDK for MIPS, correct (from your
email address)? If yes, there are actually two additional patches necessary to
get Zero to build on MIPS. In particular, jvmsigs cannot encode all signals
found on MIPS. I should finally get around to work on this.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fail to build zero on x86

John Paul Adrian Glaubitz
On 01/10/2018 12:27 AM, John Paul Adrian Glaubitz wrote:> which is the same configure line that the openjdk-7/8/9/10 packages in Debian> use. Sounds like a good
idea to fix this warning though.
PS: I'm happy to review and sponsor your change. But tomorrow :).

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fail to build zero on x86

敖琪
In reply to this post by John Paul Adrian Glaubitz
Hi John,


> I assume that you eventually want to build OpenJDK for MIPS, correct (from
> your
> email address)? If yes, there are actually two additional patches
> necessary to
> get Zero to build on MIPS. In particular, jvmsigs cannot encode all signals
> found on MIPS. I should finally get around to work on this.
>
>
Thanks for your information. We have a Jenkins server to build OpenJDK
8/9/10 on x86 and MIPS (loongson3a), and I have already used those
patches:) Hope those patches can be submitted to upstream.

Ao Qi
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fail to build zero on x86

敖琪
In reply to this post by John Paul Adrian Glaubitz
Hi John,

Thanks!
PS: It seems that the build begins to fail after this changeset:
http://hg.openjdk.java.net/jdk/jdk/rev/fb290fd1f9d4

Ao Qi

2018-01-10 7:58 GMT+08:00 John Paul Adrian Glaubitz <
[hidden email]>:

> On 01/10/2018 12:27 AM, John Paul Adrian Glaubitz wrote:> which is the
> same configure line that the openjdk-7/8/9/10 packages in Debian> use.
> Sounds like a good
> idea to fix this warning though.
> PS: I'm happy to review and sponsor your change. But tomorrow :).
>
> Adrian
>
> --
>  .''`.  John Paul Adrian Glaubitz
> : :' :  Debian Developer - [hidden email]
> `. `'   Freie Universitaet Berlin - [hidden email]
>   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>