RFR: 8327283: RISC-V: Minimal build failed after JDK-8319716

Gui Cao gcao at openjdk.org
Tue Mar 5 13:15:46 UTC 2024


On Tue, 5 Mar 2024 07:41:05 GMT, Gui Cao <gcao at openjdk.org> wrote:

> Hi, please review this patch that fix the minimal build failed for riscv.
> 
> Error log for minimal build:
> 
> Creating support/modules_libs/java.base/minimal/libjvm.so from 591 file(s)
> ^@/home/zifeihan/jdk/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp: In member function ‘u_char* StubGenerator::Sha2Generator::generate_sha2_implCompress(Assembler::SEW, bool)’:
> /home/zifeihan/jdk/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp:3938:41: error: ‘MaxVectorSize’ was not declared in this scope; did you mean ‘MaxNewSize’?
>  3938 |       if (vset_sew == Assembler::e64 && MaxVectorSize == 16) { // SHA512 and VLEN = 128
>       |                                         ^~~~~~~~~~~~~
>       |                                         MaxNewSize
> gmake[3]: *** [lib/CompileJvm.gmk:165: /home/zifeihan/jdk/build/linux-riscv64-minimal-fastdebug/hotspot/variant-minimal/libjvm/objs/stubGenerator_riscv.o] Error 1
> gmake[3]: *** Waiting for unfinished jobs....
> ^@gmake[2]: *** [make/Main.gmk:253: hotspot-minimal-libs] Error 2
> gmake[2]: *** Waiting for unfinished jobs....
> ^@
> ERROR: Build failed for target 'images' in configuration 'linux-riscv64-minimal-fastdebug' (exit code 2)
> 
> === Output from failing command(s) repeated here ===
> * For target hotspot_variant-minimal_libjvm_objs_stubGenerator_riscv.o:
> /home/zifeihan/jdk/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp: In member function ‘u_char* StubGenerator::Sha2Generator::generate_sha2_implCompress(Assembler::SEW, bool)’:
> /home/zifeihan/jdk/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp:3938:41: error: ‘MaxVectorSize’ was not declared in this scope; did you mean ‘MaxNewSize’?
>  3938 |       if (vset_sew == Assembler::e64 && MaxVectorSize == 16) { // SHA512 and VLEN = 128
>       |                                         ^~~~~~~~~~~~~
>       |                                         MaxNewSize
> 
> * All command lines available in /home/zifeihan/jdk/build/linux-riscv64-minimal-fastdebug/make-support/failure-logs.
> === End of repeated output ===
> 
> No indication of failed target found.
> HELP: Try searching the build log for '] Error'.
> HELP: Run 'make doctor' to diagnose build problems.
> 
> make[1]: *** [/home/zifeihan/jdk/make/Init.gmk:323: main] Error 2
> make: *** [/home/zifeihan/jdk/make/Init.gmk:189: images] Error 2
> 
> 
> The root cause is that MaxVectorSize is only defined under COMPILER2 , We should use VM_Version::_initial_vector_length instead of MaxVectorSize.  
> 
> Testing:
> 
> - [x] linux-riscv minimal fastdebug native build

> The SHA intrinsic are only used in "LibraryCallKit::inline_digestBase_implCompress" and JVMCI. So I think these (plus md5 and chacha) should be put into a ifdef COMPILER2_OR_JVMCI block. (I was going todo that but it slipped my mind)
> 
> The MaxVectorSize is defined if JVMCI and/or C2 is defined: `NOT_COMPILER2(product(intx, MaxVectorSize, 64,`



> The SHA intrinsic are only used in "LibraryCallKit::inline_digestBase_implCompress" and JVMCI. So I think these (plus md5 and chacha) should be put into a ifdef COMPILER2_OR_JVMCI block. (I was going todo that but it slipped my mind)
> 
> The MaxVectorSize is defined if JVMCI and/or C2 is defined: `NOT_COMPILER2(product(intx, MaxVectorSize, 64,`

Yes, You are right. I've considered this way putting the function definition under a ifdef COMPILER2_OR_JVMCI block. But I find that no other CPU does this. I am not sure if there is any other reason for this. But I can do that if we all think it's better.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18114#issuecomment-1978751082


More information about the hotspot-compiler-dev mailing list