loongson/jdk8u

hotspot/src/share/vm/jfr not supported?

phorcys opened this issue · 6 comments

#ifdef TARGET_ARCH_x86
# include "bytes_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "bytes_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "bytes_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "bytes_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "bytes_ppc.hpp"
#endif
#ifdef TARGET_ARCH_aarch64
# include "bytes_aarch64.hpp"
#endif
//
// The Encoding policy prescribes a template

Build failed on gentoo loongarch64

configure params:
./configure --prefix=/usr --build=loongarch64-unknown-linux-gnu --host=loongarch64-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/openjdk-8.352_p08 --htmldir=/usr/share/doc/openjdk-8.352_p08/html --with-sysroot=/ --libdir=/usr/lib64 --disable-ccache --disable-freetype-bundling --disable-precompiled-headers --enable-unlimited-crypto --with-boot-jdk=/opt/openjdk-bin-8.345_p01 --with-extra-cflags=-O2 -pipe -fcommon --with-extra-cxxflags=-O2 -pipe -fcommon --with-extra-ldflags=-Wl,-O1 -Wl,--as-needed --with-freetype-lib=/usr/lib64 --with-freetype-include=/usr/include/freetype2 --with-giflib=system --with-jtreg=no --with-jobs=1 --with-num-cores=1 --with-update-version=352 --with-build-number=b08 --with-milestone=fcs --with-vendor-name=Gentoo --with-vendor-url=https://gentoo.org --with-vendor-bug-url=https://bugs.gentoo.org --with-vendor-vm-bug-url=https://bugs.openjdk.java.net --with-zlib=system --with-native-debug-symbols=none

Hi @phorcys

Could you provide the detailed compile error log?

Thanks,
Leslie Zhai

Hi @phorcys

Could you provide the detailed compile error log?

Thanks, Leslie Zhai

step1. cross build jdk8u master-ls branch on a gentoo x64 system with cross toolchain : working... got jdk8u image tarball
step2. test this tarball on a gentoo loongarch64 system: working, no problem.
step3. try compile jdk8u master-ls branch on a gentoo loongarch64 system using step1 tarball as bootjdk, build with ./configure ; make : working..
step4. created a gentoo ebuild with latest jdk8u master-ls source code, emerge it. broken
"openjdk-8.352_p0" is the ebuild name, source code is downloaded from master-ls branch tarball.

/usr/bin/loongarch64-unknown-linux-gnu-g++ -DLINUX -D_GNU_SOURCE -DLOONGARCH64 -DPRODUCT  -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/prims -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/precompiled -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/cpu/loongarch/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/os_cpu/linux_loongarch/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/os/linux/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"25.352-b08\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"portage\"" -DHOTSPOT_LIB_ARCH=\"loongarch64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\""  -O2 -pipe -fcommon -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_loongarch -DTARGET_ARCH_MODEL_loongarch_64 -DTARGET_OS_ARCH_linux_loongarch -DTARGET_OS_ARCH_MODEL_linux_loongarch_64 -DTARGET_COMPILER_gcc -DINCLUDE_JFR=1 -DCOMPILER2 -DCOMPILER1 -DDONT_USE_PRECOMPILED_HEADER  -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden  -pipe -fno-strict-aliasing  -fno-omit-frame-pointer -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_loongarch -DTARGET_ARCH_MODEL_loongarch_64 -DTARGET_OS_ARCH_linux_loongarch -DTARGET_OS_ARCH_MODEL_linux_loongarch_64 -DTARGET_COMPILER_gcc -DINCLUDE_JFR=1 -DCOMPILER2 -DCOMPILER1 -DDONT_USE_PRECOMPILED_HEADER -fPIC -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden  -pipe -fno-strict-aliasing  -fno-omit-frame-pointer -O3  -DVM_LITTLE_ENDIAN -DSICORTEX_ERRATA -D_LP64=1 -fno-omit-frame-pointer  -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type   --sysroot="/" -fstack-protector -O2 -pipe -fcommon -fno-delete-null-pointer-checks -fno-lifetime-dse -std=gnu++98 -c -MMD -MP -MF ../generated/dependencies/allocationStats.o.d -fpch-deps -o allocationStats.o /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp 
In file included from /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/writers/jfrEncoding.hpp:28,
                 from /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/writers/jfrNativeEventWriter.hpp:29,
                 from /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/recorder/service/jfrEvent.hpp:32,
                 from ../generated/jfrfiles/jfrEventClasses.hpp:12,
                 from /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/jfrEvents.hpp:32,
                 from /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/gc_interface/allocTracer.cpp:28:
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp: In static member function ‘static size_t BigEndianEncoderImpl::encode(T, u1*)’:
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp:94:8: error: ‘Bytes’ has not been declared
   94 |        Bytes::put_Java_u2(dest, value);
      |        ^~~~~
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp:98:8: error: ‘Bytes’ has not been declared
   98 |        Bytes::put_Java_u4(dest, value);
      |        ^~~~~
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp:102:8: error: ‘Bytes’ has not been declared
  102 |        Bytes::put_Java_u8(dest, value);

checked source code causing problem:

#ifdef TARGET_ARCH_x86
# include "bytes_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "bytes_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "bytes_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "bytes_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "bytes_ppc.hpp"
#endif
#ifdef TARGET_ARCH_aarch64
# include "bytes_aarch64.hpp"
#endif
//
// The Encoding policy prescribes a template

try fix it by adding to jfrEncoders.hpp

#if defined(__loongarch__)
# include "bytes_loongarch.hpp"
#endif

got another error:

/usr/bin/loongarch64-unknown-linux-gnu-g++ -DLINUX -D_GNU_SOURCE -DLOONGARCH64 -DPRODUCT  -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/prims -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/precompiled -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/cpu/loongarch/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/os_cpu/linux_loongarch/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/os/linux/vm -I/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"25.352-b08\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"portage\"" -DHOTSPOT_LIB_ARCH=\"loongarch64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\""  -O2 -pipe -fcommon -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_loongarch -DTARGET_ARCH_MODEL_loongarch_64 -DTARGET_OS_ARCH_linux_loongarch -DTARGET_OS_ARCH_MODEL_linux_loongarch_64 -DTARGET_COMPILER_gcc -DINCLUDE_JFR=1 -DCOMPILER2 -DCOMPILER1 -DDONT_USE_PRECOMPILED_HEADER  -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden  -pipe -fno-strict-aliasing  -fno-omit-frame-pointer -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_loongarch -DTARGET_ARCH_MODEL_loongarch_64 -DTARGET_OS_ARCH_linux_loongarch -DTARGET_OS_ARCH_MODEL_linux_loongarch_64 -DTARGET_COMPILER_gcc -DINCLUDE_JFR=1 -DCOMPILER2 -DCOMPILER1 -DDONT_USE_PRECOMPILED_HEADER -fPIC -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden  -pipe -fno-strict-aliasing  -fno-omit-frame-pointer -O3  -DVM_LITTLE_ENDIAN -DSICORTEX_ERRATA -D_LP64=1 -fno-omit-frame-pointer  -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type   --sysroot="/" -fstack-protector -O2 -pipe -fcommon -fno-delete-null-pointer-checks -fno-lifetime-dse -std=gnu++98 -c -MMD -MP -MF ../generated/dependencies/c1_Compiler.o.d -fpch-deps -o c1_Compiler.o /var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/share/vm/c1/c1_Compiler.cpp 
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp: In static member function ‘static jbyte* G1PostBarrierStub::byte_map_base_slow()’:
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp:366:12: error: ‘G1SATBCardTableModRefBS’ was not declared in this scope; did you mean ‘TraceCardTableModRefBS’?
  366 |   return ((G1SATBCardTableModRefBS*)bs)->byte_map_base;
      |            ^~~~~~~~~~~~~~~~~~~~~~~
      |            TraceCardTableModRefBS
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp:366:36: error: expected primary-expression before ‘)’ token
  366 |   return ((G1SATBCardTableModRefBS*)bs)->byte_map_base;
      |                                    ^
/var/tmp/portage/dev-java/openjdk-8.352_p08/work/jdk8u-master-ls/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp:366:37: error: expected ‘)’ before ‘bs’
  366 |   return ((G1SATBCardTableModRefBS*)bs)->byte_map_base;
      |          ~                          ^~
      |                                     )

check emerge log for configure param:
./configure --prefix=/usr --build=loongarch64-unknown-linux-gnu --host=loongarch64-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/openjdk-8.352_p08 --htmldir=/usr/share/doc/openjdk-8.352_p08/html --with-sysroot=/ --libdir=/usr/lib64 --disable-ccache --disable-freetype-bundling --disable-precompiled-headers --enable-unlimited-crypto --with-boot-jdk=/opt/openjdk-bin-8.345_p01 --with-extra-cflags=-O2 -pipe -fcommon --with-extra-cxxflags=-O2 -pipe -fcommon --with-extra-ldflags=-Wl,-O1 -Wl,--as-needed --with-freetype-lib=/usr/lib64 --with-freetype-include=/usr/include/freetype2 --with-giflib=system --with-jtreg=no --with-jobs=1 --with-num-cores=1 --with-update-version=352 --with-build-number=b08 --with-milestone=fcs --with-vendor-name=Gentoo --with-vendor-url=https://gentoo.org --with-vendor-bug-url=https://bugs.gentoo.org --with-vendor-vm-bug-url=https://bugs.openjdk.java.net --with-zlib=system --with-native-debug-symbols=none

full build log at https://pastebin.com/YCNGX5gQ

Hi @phorcys ,

Thanks for the detailed reporting. We will fix this as soon as possible. Before that, trying not to use --disable-precompiled-headers in your configure parameter may be a workaround

Before that, trying not to use --disable-precompiled-headers in your configure parameter may be a workaround

... or using this patch:

diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
index 81605ed27..b42dbd256 100644
--- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
@@ -1557,12 +1557,10 @@ public:
     AbstractAssembler::flush();
   }
 
-  inline void emit_int32(int);
   inline void emit_data(int x) { emit_int32(x); }
   inline void emit_data(int, RelocationHolder const&);
   inline void emit_data(int, relocInfo::relocType rtype);
 
-
   // Generic instructions
   // Does 32bit or 64bit as needed for the platform. In some sense these
   // belong in macro assembler but there is no need for both varieties to exist
diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
index 21f3f0ba8..2521e5f31 100644
--- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
@@ -30,10 +30,6 @@
 #include "asm/codeBuffer.hpp"
 #include "code/codeCache.hpp"
 
-inline void Assembler::emit_int32(int x) {
-  AbstractAssembler::emit_int32(x);
-}
-
 inline void Assembler::emit_data(int x, relocInfo::relocType rtype) {
   relocate(rtype);
   emit_int32(x);
diff --git a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
index d14a213f3..febd2a24b 100644
--- a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
+++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
@@ -34,6 +34,9 @@
 #include "nativeInst_loongarch.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "vmreg_loongarch.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define A0 RA0
 #define A3 RA3
diff --git a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
index 96cf39cfa..a750dca32 100644
--- a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
+++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
@@ -44,6 +44,9 @@
 #include "runtime/vframe.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_loongarch.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define A0 RA0
 #define A1 RA1
diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
index 084505266..36164750d 100644
--- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
@@ -48,6 +48,7 @@
 #endif // INCLUDE_ALL_GCS
 
 #ifdef COMPILER2
+#include "opto/node.hpp"
 #include "opto/compile.hpp"
 #endif
 
diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
index dd940e18e..3fbb2dc83 100644
--- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "compiler/disassembler.hpp"
 #include "memory/resourceArea.hpp"
 #include "nativeInst_loongarch.hpp"
 #include "oops/oop.inline.hpp"
@@ -32,6 +33,9 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 #include <sys/mman.h>
 
diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
index 8db5e7156..137ed864b 100644
--- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
@@ -26,6 +26,7 @@
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
 #include "code/relocInfo.hpp"
+#include "compiler/disassembler.hpp"
 #include "nativeInst_loongarch.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/safepoint.hpp"
diff --git a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
index 42a8b719c..b69f3b2cd 100644
--- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
+++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
@@ -46,6 +46,9 @@
 #ifdef TARGET_ARCH_aarch64
 # include "bytes_aarch64.hpp"
 #endif
+#ifdef TARGET_ARCH_loongarch
+# include "bytes_loongarch.hpp"
+#endif
 
 //
 // The Encoding policy prescribes a template

Before that, trying not to use --disable-precompiled-headers in your configure parameter may be a workaround

... or using this patch:

diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
index 81605ed27..b42dbd256 100644
--- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
@@ -1557,12 +1557,10 @@ public:
     AbstractAssembler::flush();
   }
 
-  inline void emit_int32(int);
   inline void emit_data(int x) { emit_int32(x); }
   inline void emit_data(int, RelocationHolder const&);
   inline void emit_data(int, relocInfo::relocType rtype);
 
-
   // Generic instructions
   // Does 32bit or 64bit as needed for the platform. In some sense these
   // belong in macro assembler but there is no need for both varieties to exist
diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
index 21f3f0ba8..2521e5f31 100644
--- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
@@ -30,10 +30,6 @@
 #include "asm/codeBuffer.hpp"
 #include "code/codeCache.hpp"
 
-inline void Assembler::emit_int32(int x) {
-  AbstractAssembler::emit_int32(x);
-}
-
 inline void Assembler::emit_data(int x, relocInfo::relocType rtype) {
   relocate(rtype);
   emit_int32(x);
diff --git a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
index d14a213f3..febd2a24b 100644
--- a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
+++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
@@ -34,6 +34,9 @@
 #include "nativeInst_loongarch.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "vmreg_loongarch.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define A0 RA0
 #define A3 RA3
diff --git a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
index 96cf39cfa..a750dca32 100644
--- a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
+++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
@@ -44,6 +44,9 @@
 #include "runtime/vframe.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_loongarch.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define A0 RA0
 #define A1 RA1
diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
index 084505266..36164750d 100644
--- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
@@ -48,6 +48,7 @@
 #endif // INCLUDE_ALL_GCS
 
 #ifdef COMPILER2
+#include "opto/node.hpp"
 #include "opto/compile.hpp"
 #endif
 
diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
index dd940e18e..3fbb2dc83 100644
--- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "compiler/disassembler.hpp"
 #include "memory/resourceArea.hpp"
 #include "nativeInst_loongarch.hpp"
 #include "oops/oop.inline.hpp"
@@ -32,6 +33,9 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 #include <sys/mman.h>
 
diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
index 8db5e7156..137ed864b 100644
--- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
@@ -26,6 +26,7 @@
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
 #include "code/relocInfo.hpp"
+#include "compiler/disassembler.hpp"
 #include "nativeInst_loongarch.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/safepoint.hpp"
diff --git a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
index 42a8b719c..b69f3b2cd 100644
--- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
+++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
@@ -46,6 +46,9 @@
 #ifdef TARGET_ARCH_aarch64
 # include "bytes_aarch64.hpp"
 #endif
+#ifdef TARGET_ARCH_loongarch
+# include "bytes_loongarch.hpp"
+#endif
 
 //
 // The Encoding policy prescribes a template

Before that, trying not to use --disable-precompiled-headers in your configure parameter may be a workaround

... or using this patch:

diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
index 81605ed27..b42dbd256 100644
--- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp
@@ -1557,12 +1557,10 @@ public:
     AbstractAssembler::flush();
   }
 
-  inline void emit_int32(int);
   inline void emit_data(int x) { emit_int32(x); }
   inline void emit_data(int, RelocationHolder const&);
   inline void emit_data(int, relocInfo::relocType rtype);
 
-
   // Generic instructions
   // Does 32bit or 64bit as needed for the platform. In some sense these
   // belong in macro assembler but there is no need for both varieties to exist
diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
index 21f3f0ba8..2521e5f31 100644
--- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp
@@ -30,10 +30,6 @@
 #include "asm/codeBuffer.hpp"
 #include "code/codeCache.hpp"
 
-inline void Assembler::emit_int32(int x) {
-  AbstractAssembler::emit_int32(x);
-}
-
 inline void Assembler::emit_data(int x, relocInfo::relocType rtype) {
   relocate(rtype);
   emit_int32(x);
diff --git a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
index d14a213f3..febd2a24b 100644
--- a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
+++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp
@@ -34,6 +34,9 @@
 #include "nativeInst_loongarch.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "vmreg_loongarch.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define A0 RA0
 #define A3 RA3
diff --git a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
index 96cf39cfa..a750dca32 100644
--- a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
+++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp
@@ -44,6 +44,9 @@
 #include "runtime/vframe.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_loongarch.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define A0 RA0
 #define A1 RA1
diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
index 084505266..36164750d 100644
--- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp
@@ -48,6 +48,7 @@
 #endif // INCLUDE_ALL_GCS
 
 #ifdef COMPILER2
+#include "opto/node.hpp"
 #include "opto/compile.hpp"
 #endif
 
diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
index dd940e18e..3fbb2dc83 100644
--- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "compiler/disassembler.hpp"
 #include "memory/resourceArea.hpp"
 #include "nativeInst_loongarch.hpp"
 #include "oops/oop.inline.hpp"
@@ -32,6 +33,9 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 #include <sys/mman.h>
 
diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
index 8db5e7156..137ed864b 100644
--- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp
@@ -26,6 +26,7 @@
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
 #include "code/relocInfo.hpp"
+#include "compiler/disassembler.hpp"
 #include "nativeInst_loongarch.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/safepoint.hpp"
diff --git a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
index 42a8b719c..b69f3b2cd 100644
--- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
+++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp
@@ -46,6 +46,9 @@
 #ifdef TARGET_ARCH_aarch64
 # include "bytes_aarch64.hpp"
 #endif
+#ifdef TARGET_ARCH_loongarch
+# include "bytes_loongarch.hpp"
+#endif
 
 //
 // The Encoding policy prescribes a template

Thank you.
emerge success , hello world working.

I will close this issue when the fix is merged.