Build fails on non-x86_64 configurations due to ADLC misconfig

Aleksey Shipilev shade at
Mon May 28 12:23:17 UTC 2018


Seems like latest integration of C2 barriers broke the non-x86 builds with:

In file included from ad_aarch64.cpp:37:0:
fatal error: gc/z/zBarrierSetAssembler_aarch64.hpp: No such file or directory
 #include CPU_HEADER(gc/z/zBarrierSetAssembler)

This apparently comes from src/hotspot/share/adlc/main.cpp:

  AD.addInclude(AD._CPP_file, "gc/z/zBarrierSetAssembler.hpp");

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 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 compilation, when INCLUDE_ZGC is available, like this:

diff -r d0ebe2e0cff4 -r e0a872b06721 src/hotspot/cpu/x86/
--- a/src/hotspot/cpu/x86/     Mon May 28 10:50:04 2018 +0200
+++ b/src/hotspot/cpu/x86/     Mon May 28 14:06:01 2018 +0200
@@ -538,6 +538,12 @@


+source_hpp %{
+#include "gc/z/zBarrierSetAssembler.hpp"
 //----------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");
-  AD.addInclude(AD._CPP_file, "gc/z/zBarrierSetAssembler.hpp");
   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.


More information about the zgc-dev mailing list