提交 6e5e9832 编写于 作者: S sgehwolf

8073139: PPC64: User-visible arch directory and os.arch value on ppc64le cause...

8073139: PPC64: User-visible arch directory and os.arch value on ppc64le cause issues with Java tooling
Reviewed-by: erikj, goetz, dholmes
上级 a0e8ba6f
......@@ -285,7 +285,7 @@ ifneq ($(OSNAME),windows)
# 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 @@ ifneq ($(OSNAME),windows)
ARCH/amd64 = x86
ARCH/x86_64 = x86
ARCH/ppc64 = ppc
ARCH/ppc64le= ppc
ARCH/ppc = ppc
ARCH/zero = zero
......@@ -316,7 +317,12 @@ ifneq ($(OSNAME),windows)
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
......
......@@ -1956,7 +1956,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
{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
......
......@@ -97,6 +97,7 @@ ifdef LP64
CFLAGS/sparcv9 += -m64
CFLAGS/amd64 += -m64
CFLAGS/ppc64 += -m64
CFLAGS/ppc64le += -m64 -DABI_ELFv2
else
ARCH=$(ARCH1:amd64=i386)
CFLAGS/i386 += -m32
......
......@@ -88,7 +88,7 @@ int main(int ac, char** av) {
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);
......
......@@ -488,7 +488,7 @@ static const char* native_arch_name() {
#ifdef LIBARCH_sparcv9
res = "sparc:v9b";
#endif
#ifdef LIBARCH_ppc64
#if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le)
res = "powerpc:common64";
#endif
if (res == NULL)
......
......@@ -184,11 +184,16 @@ const char* Abstract_VM_Version::jre_release_version() {
#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
......
......@@ -185,6 +185,15 @@ grep "ppc" vm_version.out > ${NULL}
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 ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册