From zhuyong.me at gmail.com Mon Sep 26 10:30:30 2016 From: zhuyong.me at gmail.com (Zhu Yong) Date: Mon, 26 Sep 2016 18:30:30 +0800 Subject: cross compile openjdk8u102-b14, zeroshark, getFunctionAddress() return NULL when compile java.lang.String::equals Message-ID: Dear All, I am new to OpenJDK, I was assigned task to do some evaluation on OpenJDK on ARM, both zero and zeroshark. My Host is x86_64, boot JDK use 32bit JDK7 from Oracle, LLVM use 3.4.2, cross compiled. I have managed to cross compile oepnjdk jdk8u102-b14, zero variant for ARM, java runs OK, but it's slow. Ccross compile zeroshark variant for ARM passed with some patches found online. In sharkCompiler.cpp, I enabled MCJIT, forced MArch to ARM. When I run "java" command on target, I saw assert: # Internal Error (/data/develop/kinetic/uboot-linux/buildroot-2011.05-2013_Q1.1/output/build/openjdk-jdk8u102-b14/hotspot/src/share/vm/shark/sharkCompiler.cpp:339), pid=26316, tid=0x4d29f470 # assert(code != NULL) failed: code must be != NULL To debug the failure, I added some debug message in both OpenJDK and LLVM, and discovered 1. method java.lang.String::hashCode was compiled successfully from module _normal_context->module() 2. When compile java.lang.String::equals method, call of execution_engine()->getFunctionAddress(name); return NULL, this caused the assert above. 3. From debug message I added in LLVM MCJIT::FindFunctionNamed(), java.lang.String::equals function already in the finalized module (normal). But it's not in RuntimeDyldImpl.GlobalSymbolTable , and that's why MCJIT::getExistingSymbolAddress() can't find it. 4. Then I printed all symbols in RuntimeDyldImpl::loadObject(), java.lang.String::equals was not in the symbol list. What's the status for zeroshark in jdk8u? Any specific version of LLVM is required? Is it stable? Refer to the assert, method java.lang.String::equals is compiled into same module as java.lang.String::hashCode , but not added into RuntimeDyldImpl.GlobalSymbolTable, what should I do to make java.lang.String::equals added into symbol table? Thank you very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From aph at redhat.com Mon Sep 26 10:48:56 2016 From: aph at redhat.com (Andrew Haley) Date: Mon, 26 Sep 2016 11:48:56 +0100 Subject: cross compile openjdk8u102-b14, zeroshark, getFunctionAddress() return NULL when compile java.lang.String::equals In-Reply-To: References: Message-ID: On 26/09/16 11:30, Zhu Yong wrote: > What's the status for zeroshark in jdk8u? Any specific version of > LLVM is required? Is it stable? It does need a very specific version of LLVM, but I'd have to search. I don't know that Shark has been tested in some time. It may not work. Andrew.