RFD: AOT for AArch64

Andrew Haley aph at redhat.com
Fri Mar 30 09:11:20 UTC 2018

On 03/29/2018 06:49 PM, Dmitry Chuyko wrote:
> It's gone now. I see almost all methods in java.base are aot'ed, 
> excluding the same ones as for x86. Non-tiered .so is created but for 
> --compile-for-tiered there's a recurring linkage error:
> Exception in thread "main" java.lang.InternalError: ava.base-coop2: In 
> function `java.io.CharArrayWriter.toCharArray()[C':(.text+0x6e030c): 
> relocation truncated to fit: R_AARCH64_CALL26 against 
> `plt._aot_stub_routines_arrayof_jshort_disjoint_arraycopy'java.base-coop2: 
> In function 

That's because the shared library is too big, more than 512 M.  We
need some kind of jaot compiler flag which is the equivalent of GCC's
-fPIC.  This will cause three instructions [adrp; ldr, blr] to be
generated at every call site, rather than one.  I don't propose to do
anything about this in the JDK 11 timeframe,.

People who want to use AOT for performance should not use such huge
shared libraries because it'll only make performance worse.  So, I'm
reluctant to spend much time on the problem.

Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-dev mailing list