Build fails on non-x86_64 configurations due to ADLC misconfig

Per Liden per.liden at oracle.com
Tue May 29 11:50:07 UTC 2018


A few adjustments were also needed, else it didn't build with 
pre-compiler headers enabled.

http://cr.openjdk.java.net/~pliden/zgc/fix_adlc_include_zgc/webrev.0

/Per

On 05/28/2018 03:09 PM, Per Liden wrote:
> On 05/28/2018 02:40 PM, Per Liden wrote:
>> Hi Aleksey,
>>
>> On 05/28/2018 02:23 PM, Aleksey Shipilev wrote:
>>> Hey,
>>>
>>> Seems like latest integration of C2 barriers broke the non-x86 builds 
>>> with:
>>>
>>> In file included from ad_aarch64.cpp:37:0:
>>> /pool/buildbot/slaves/sobornost/zgc/build/src/hotspot/share/gc/z/zBarrierSetAssembler.hpp:39:47: 
>>>
>>> fatal error: gc/z/zBarrierSetAssembler_aarch64.hpp: No such file or 
>>> directory
>>>   #include CPU_HEADER(gc/z/zBarrierSetAssembler)
>>
>> Ah, I was just about to look into why our Sparc build broke :) Your 
> 
> (Just to clarify, it broke when I tried to compile without the "ZGC: 
> Solaris/Sparc support" patch).
> 
> /Per
> 
>> proposal seems like a a good workaround/fix. I'll take it for a spin 
>> on Sparc.
>>
>> Thanks!
>>
>> /Per
>>
>>>
>>> This apparently comes from src/hotspot/share/adlc/main.cpp:
>>>
>>> #if INCLUDE_ZGC
>>>    AD.addInclude(AD._CPP_file, "gc/z/zBarrierSetAssembler.hpp");
>>> #endif
>>>
>>> This does not seem to work, because adlc itself is built separately 
>>> from the rest of JVM, and
>>> INCLUDE_ZGC=0 is not passed there, as it would be the case for 
>>> libjvm.so build via JVM_CFLAGS. (I
>>> have idly wondered why do we even need BSAsm in C2-ish .ad, but it 
>>> seems that .ad does use symbols
>>> from that BSAsm).
>>>
>>> So, I think we can just move the INCLUDE_ZGC block straight to .ad 
>>> template, and let the build
>>> figure out the include during the libjvm.so compilation, when 
>>> INCLUDE_ZGC is available, like this:
>>>
>>> diff -r d0ebe2e0cff4 -r e0a872b06721 src/hotspot/cpu/x86/x86_64.ad
>>> --- a/src/hotspot/cpu/x86/x86_64.ad     Mon May 28 10:50:04 2018 +0200
>>> +++ b/src/hotspot/cpu/x86/x86_64.ad     Mon May 28 14:06:01 2018 +0200
>>> @@ -538,6 +538,12 @@
>>>
>>>   %}
>>>
>>> +source_hpp %{
>>> +#if INCLUDE_ZGC
>>> +#include "gc/z/zBarrierSetAssembler.hpp"
>>> +#endif
>>> +%}
>>> +
>>>   //----------SOURCE 
>>> BLOCK-------------------------------------------------------
>>>   // This is a block of C++ code which provides values, functions, and
>>>   // definitions necessary in the rest of the architecture description
>>> diff -r d0ebe2e0cff4 -r e0a872b06721 src/hotspot/share/adlc/main.cpp
>>> --- a/src/hotspot/share/adlc/main.cpp   Mon May 28 10:50:04 2018 +0200
>>> +++ b/src/hotspot/share/adlc/main.cpp   Mon May 28 14:06:01 2018 +0200
>>> @@ -216,9 +216,6 @@
>>>     AD.addInclude(AD._CPP_file, "code/nativeInst.hpp");
>>>     AD.addInclude(AD._CPP_file, "code/vmreg.inline.hpp");
>>>     AD.addInclude(AD._CPP_file, "gc/shared/collectedHeap.inline.hpp");
>>> -#if INCLUDE_ZGC
>>> -  AD.addInclude(AD._CPP_file, "gc/z/zBarrierSetAssembler.hpp");
>>> -#endif
>>>     AD.addInclude(AD._CPP_file, "oops/compiledICHolder.hpp");
>>>     AD.addInclude(AD._CPP_file, "oops/markOop.hpp");
>>>     AD.addInclude(AD._CPP_file, "oops/method.hpp");
>>>
>>> This builds on x86_64 and fixes the build for at least AArch64. Other 
>>> .ad files (SPARC?) require the
>>> same change, but I cannot test it.
>>
>>
>>
>>>
>>> Thanks,
>>> -Aleksey
>>>


More information about the zgc-dev mailing list