On 2020-05-07 13:18, John Paul Adrian Glaubitz wrote:
Hi Mikael!

On 5/7/20 2:47 AM, Mikael Vidstedt wrote:
New webrev available here:

webrev: 
http://cr.openjdk.java.net/~mikael/webrevs/8244224/webrev.01/build/open/webrev/ 
<http://cr.openjdk.java.net/~mikael/webrevs/8244224/webrev.01/build/open/webrev/>
incremental: 
http://cr.openjdk.java.net/~mikael/webrevs/8244224/webrev.01/build.incr/open/webrev/ 
<http://cr.openjdk.java.net/~mikael/webrevs/8244224/webrev.01/build.incr/open/webrev/>

I believe I have addressed all the review comments apart from:

* GNM - Magnus to file a follow-up RFE

* Zero - Waiting for somebody (Adrian?) to provide more information about what 
needs to be preserved
I haven't had the time to look at this yet due to $DAYJOB@SUSE, but I should 
have time tomorrow
as there is a public holiday tomorrow.

Also, Magnus should get to a SPARC-T5 running Debian unstable within the next 
hours so he
will be able to perform build tests as well and provide feedback.
That was quite painless, actually. Two files needed partial restoration, then everything worked fine.

Mikael, if you apply this patch on top of your patchset, it should back out those of your changes that broke linux-sparc-zero. Also, I missed that you removed a configure option without deprecating it, something we have as a policy not to do. This patch also fixes that.

diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4
--- a/make/autoconf/platform.m4
+++ b/make/autoconf/platform.m4
@@ -150,6 +150,18 @@
       VAR_CPU_BITS=32
       VAR_CPU_ENDIAN=little
       ;;
+    sparc)
+      VAR_CPU=sparc
+      VAR_CPU_ARCH=sparc
+      VAR_CPU_BITS=32
+      VAR_CPU_ENDIAN=big
+      ;;
+    sparcv9|sparc64)
+      VAR_CPU=sparcv9
+      VAR_CPU_ARCH=sparc
+      VAR_CPU_BITS=64
+      VAR_CPU_ENDIAN=big
+      ;;
     *)
       AC_MSG_ERROR([unsupported cpu $1])
       ;;
@@ -308,8 +320,10 @@
       OPENJDK_TARGET_CPU_BITS=32
       if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
         OPENJDK_TARGET_CPU=x86
+      elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
+        OPENJDK_TARGET_CPU=sparc
       else
-        AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64]) +        AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9])
       fi
     elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then        AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.])
@@ -422,6 +436,8 @@
   HOTSPOT_$1_CPU=${OPENJDK_$1_CPU}
   if test "x$OPENJDK_$1_CPU" = xx86; then
     HOTSPOT_$1_CPU=x86_32
+  elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
+    HOTSPOT_$1_CPU=sparc
   elif test "x$OPENJDK_$1_CPU" = xppc64; then
     HOTSPOT_$1_CPU=ppc_64
   elif test "x$OPENJDK_$1_CPU" = xppc64le; then
@@ -440,6 +456,8 @@
     HOTSPOT_$1_CPU_DEFINE=AMD64
   elif test "x$OPENJDK_$1_CPU" = xx32; then
     HOTSPOT_$1_CPU_DEFINE=X32
+  elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
+    HOTSPOT_$1_CPU_DEFINE=SPARC
   elif test "x$OPENJDK_$1_CPU" = xaarch64; then
     HOTSPOT_$1_CPU_DEFINE=AARCH64
   elif test "x$OPENJDK_$1_CPU" = xppc64; then
@@ -448,6 +466,8 @@
     HOTSPOT_$1_CPU_DEFINE=PPC64

   # The cpu defines below are for zero, we don't support them directly.
+  elif test "x$OPENJDK_$1_CPU" = xsparc; then
+    HOTSPOT_$1_CPU_DEFINE=SPARC
   elif test "x$OPENJDK_$1_CPU" = xppc; then
     HOTSPOT_$1_CPU_DEFINE=PPC32
   elif test "x$OPENJDK_$1_CPU" = xs390; then
@@ -526,6 +546,9 @@
   PLATFORM_SET_MODULE_TARGET_OS_VALUES
   PLATFORM_SET_RELEASE_FILE_OS_VALUES
   PLATFORM_SETUP_LEGACY_VARS
+
+  # Deprecated in JDK 15
+  UTIL_DEPRECATED_ARG_ENABLE(deprecated-ports)
 ])

 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -318,7 +318,7 @@


 #ifndef SYS_gettid
-// i386: 224, ia64: 1105, amd64: 186
+// i386: 224, ia64: 1105, amd64: 186, sparc 143
   #ifdef __ia64__
     #define SYS_gettid 1105
   #else
@@ -328,7 +328,11 @@
       #ifdef __amd64__
         #define SYS_gettid 186
       #else
-        #error define gettid for the arch
+        #ifdef __sparc__
+          #define SYS_gettid 143
+        #else
+          #error define gettid for the arch
+        #endif
       #endif
     #endif
   #endif
@@ -404,7 +408,7 @@
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
 #ifndef OVERRIDE_LIBPATH
-  #if defined(AMD64) || defined(PPC64) || defined(S390)
+  #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
     #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
   #else
     #define DEFAULT_LIBPATH "/lib:/usr/lib"
@@ -1854,6 +1858,9 @@
     {EM_486,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
     {EM_IA_64,       EM_IA_64,   ELFCLASS64, ELFDATA2LSB, (char*)"IA 64"},
     {EM_X86_64,      EM_X86_64,  ELFCLASS64, ELFDATA2LSB, (char*)"AMD 64"}, +    {EM_SPARC,       EM_SPARC,   ELFCLASS32, ELFDATA2MSB, (char*)"Sparc 32"}, +    {EM_SPARC32PLUS, EM_SPARC,   ELFCLASS32, ELFDATA2MSB, (char*)"Sparc 32"}, +    {EM_SPARCV9,     EM_SPARCV9, ELFCLASS64, ELFDATA2MSB, (char*)"Sparc v9 64"},      {EM_PPC,         EM_PPC,     ELFCLASS32, ELFDATA2MSB, (char*)"Power PC 32"},
 #if defined(VM_LITTLE_ENDIAN)
     {EM_PPC64,       EM_PPC64,   ELFCLASS64, ELFDATA2LSB, (char*)"Power PC 64 LE"},
@@ -1880,6 +1887,10 @@
   static  Elf32_Half running_arch_code=EM_X86_64;
 #elif  (defined IA64)
   static  Elf32_Half running_arch_code=EM_IA_64;
+#elif  (defined __sparc) && (defined _LP64)
+  static  Elf32_Half running_arch_code=EM_SPARCV9;
+#elif  (defined __sparc) && (!defined _LP64)
+  static  Elf32_Half running_arch_code=EM_SPARC;
 #elif  (defined __powerpc64__)
   static  Elf32_Half running_arch_code=EM_PPC64;
 #elif  (defined __powerpc__)
@@ -1906,7 +1917,7 @@
   static  Elf32_Half running_arch_code=EM_RISCV;
 #else
     #error Method os::dll_load requires that one of following is defined:\
-        AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH +        AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc
 #endif

   // Identify compatibility class for VM's architecture and library's architecture
@@ -2564,6 +2575,8 @@
 const char* search_string = "cpu";
 #elif defined(S390)
 const char* search_string = "machine =";
+#elif defined(SPARC)
+const char* search_string = "cpu";
 #else
 const char* search_string = "Processor";
 #endif
@@ -2615,6 +2628,8 @@
   strncpy(cpuinfo, "PPC64", length);
 #elif defined(S390)
   strncpy(cpuinfo, "S390", length);
+#elif defined(SPARC)
+  strncpy(cpuinfo, "sparcv9", length);
 #elif defined(ZERO_LIBARCH)
   strncpy(cpuinfo, ZERO_LIBARCH, length);
 #else

I ran some initial tier1 testing, as a sanity check that we're up and running, at least. There might be more subtle issues with the hotspot code, though. I'll leave it to Adrian to sort that out, if that is the case.

/Magnus


Sorry for not being able to reply earlier.

Adrian


Reply via email to