changeset 8976:882a55369341

8073139: PPC64: User-visible arch directory and os.arch value on ppc64le cause issues with Java tooling Reviewed-by: erikj, goetz, dholmes
author sgehwolf
date Tue, 25 Sep 2018 16:23:35 +0200
parents a3df1579a864
children 59bbf36a21f9
files make/defs.make src/os/linux/vm/os_linux.cpp src/share/tools/hsdis/Makefile src/share/tools/hsdis/hsdis-demo.c src/share/tools/hsdis/hsdis.c src/share/vm/runtime/vm_version.cpp test/test_env.sh
diffstat 7 files changed, 27 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/make/defs.make	Thu Oct 04 19:35:30 2018 +0000
+++ b/make/defs.make	Tue Sep 25 16:23:35 2018 +0200
@@ -285,7 +285,7 @@
 
   # Use uname output for SRCARCH, but deal with platform differences. If ARCH
   # is not explicitly listed below, it is treated as x86.
-  SRCARCH    ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 zero,$(ARCH)))
+  SRCARCH    ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 ppc64le zero,$(ARCH)))
   ARCH/       = x86
   ARCH/sparc  = sparc
   ARCH/sparc64= sparc
@@ -293,6 +293,7 @@
   ARCH/amd64  = x86
   ARCH/x86_64 = x86
   ARCH/ppc64  = ppc
+  ARCH/ppc64le= ppc
   ARCH/ppc    = ppc
   ARCH/zero   = zero
 
@@ -316,7 +317,12 @@
     endif
   endif
 
-  # LIBARCH is 1:1 mapping from BUILDARCH
+  # LIBARCH is 1:1 mapping from BUILDARCH, except for ARCH=ppc64le
+  ifeq ($(ARCH),ppc64le)
+    LIBARCH      ?= ppc64le
+  else
+    LIBARCH      ?= $(LIBARCH/$(BUILDARCH))
+  endif
   LIBARCH        ?= $(LIBARCH/$(BUILDARCH))
   LIBARCH/i486    = i386
   LIBARCH/amd64   = amd64
--- a/src/os/linux/vm/os_linux.cpp	Thu Oct 04 19:35:30 2018 +0000
+++ b/src/os/linux/vm/os_linux.cpp	Tue Sep 25 16:23:35 2018 +0200
@@ -1956,7 +1956,7 @@
     {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"},
+    {EM_PPC64,       EM_PPC64,   ELFCLASS64, ELFDATA2LSB, (char*)"Power PC 64 LE"},
 #else
     {EM_PPC64,       EM_PPC64,   ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"},
 #endif
--- a/src/share/tools/hsdis/Makefile	Thu Oct 04 19:35:30 2018 +0000
+++ b/src/share/tools/hsdis/Makefile	Tue Sep 25 16:23:35 2018 +0200
@@ -97,6 +97,7 @@
 CFLAGS/sparcv9	+= -m64
 CFLAGS/amd64	+= -m64
 CFLAGS/ppc64	+= -m64
+CFLAGS/ppc64le  += -m64 -DABI_ELFv2
 else
 ARCH=$(ARCH1:amd64=i386)
 CFLAGS/i386	+= -m32
--- a/src/share/tools/hsdis/hsdis-demo.c	Thu Oct 04 19:35:30 2018 +0000
+++ b/src/share/tools/hsdis/hsdis-demo.c	Tue Sep 25 16:23:35 2018 +0200
@@ -88,7 +88,7 @@
   printf("...And now for something completely different:\n");
   void *start = (void*) &main;
   void *end = (void*) &end_of_file;
-#if defined(__ia64) || defined(__powerpc__)
+#if defined(__ia64) || (defined(__powerpc__) && !defined(ABI_ELFv2))
   /* On IA64 and PPC function pointers are pointers to function descriptors */
   start = *((void**)start);
   end = *((void**)end);
--- a/src/share/tools/hsdis/hsdis.c	Thu Oct 04 19:35:30 2018 +0000
+++ b/src/share/tools/hsdis/hsdis.c	Tue Sep 25 16:23:35 2018 +0200
@@ -488,7 +488,7 @@
 #ifdef LIBARCH_sparcv9
   res = "sparc:v9b";
 #endif
-#ifdef LIBARCH_ppc64
+#if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le)
   res = "powerpc:common64";
 #endif
   if (res == NULL)
--- a/src/share/vm/runtime/vm_version.cpp	Thu Oct 04 19:35:30 2018 +0000
+++ b/src/share/vm/runtime/vm_version.cpp	Tue Sep 25 16:23:35 2018 +0200
@@ -184,11 +184,16 @@
 #ifndef CPU
 #ifdef ZERO
 #define CPU      ZERO_LIBARCH
+#elif defined(PPC64)
+#if defined(VM_LITTLE_ENDIAN)
+#define CPU      "ppc64le"
+#else
+#define CPU      "ppc64"
+#endif
 #else
 #define CPU      IA32_ONLY("x86")                \
                  IA64_ONLY("ia64")               \
                  AMD64_ONLY("amd64")             \
-                 PPC64_ONLY("ppc64")             \
                  SPARC_ONLY("sparc")
 #endif // ZERO
 #endif
--- a/test/test_env.sh	Thu Oct 04 19:35:30 2018 +0000
+++ b/test/test_env.sh	Tue Sep 25 16:23:35 2018 +0200
@@ -185,6 +185,15 @@
 if [ $? = 0 ]
 then
   VM_CPU="ppc"
+  if [ $VM_BITS = "64" ]
+  then
+    VM_CPU="ppc64"
+    grep "ppc64le" vm_version.out > ${NULL}
+    if [ $? = 0 ]
+    then
+      VM_CPU="ppc64le"
+    fi
+  fi
 fi
 grep "ia64" vm_version.out > ${NULL}
 if [ $? = 0 ]