8165440: Add Zero support for x86_64-linux-gnux32 target
authorglaubitz
Wed, 05 Sep 2018 11:15:28 +0200
changeset 51641 9ce4a0d718c7
parent 51640 58ea9afe0eb8
child 51642 d4099c45f148
8165440: Add Zero support for x86_64-linux-gnux32 target Reviewed-by: erikj, ihse
make/autoconf/flags.m4
make/autoconf/platform.m4
src/hotspot/os/linux/os_linux.cpp
--- a/make/autoconf/flags.m4	Wed Sep 05 11:52:15 2018 +0530
+++ b/make/autoconf/flags.m4	Wed Sep 05 11:15:28 2018 +0200
@@ -241,7 +241,8 @@
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
   elif test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
-    if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86 ||
+    if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86 &&
+        test "x$OPENJDK_TARGET_CPU" != xx32 ||
         test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc ||
         test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then
       MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
--- a/make/autoconf/platform.m4	Wed Sep 05 11:52:15 2018 +0530
+++ b/make/autoconf/platform.m4	Wed Sep 05 11:15:28 2018 +0200
@@ -30,6 +30,12 @@
 [
   # First argument is the cpu name from the trip/quad
   case "$1" in
+    x86_64*x32)
+      VAR_CPU=x32
+      VAR_CPU_ARCH=x86
+      VAR_CPU_BITS=32
+      VAR_CPU_ENDIAN=little
+      ;;
     x86_64)
       VAR_CPU=x86_64
       VAR_CPU_ARCH=x86
@@ -455,6 +461,8 @@
     HOTSPOT_$1_CPU_DEFINE=IA32
   elif test "x$OPENJDK_$1_CPU" = xx86_64; then
     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
--- a/src/hotspot/os/linux/os_linux.cpp	Wed Sep 05 11:52:15 2018 +0530
+++ b/src/hotspot/os/linux/os_linux.cpp	Wed Sep 05 11:15:28 2018 +0200
@@ -1742,7 +1742,7 @@
 
 #if  (defined IA32)
   static  Elf32_Half running_arch_code=EM_386;
-#elif   (defined AMD64)
+#elif   (defined AMD64) || (defined X32)
   static  Elf32_Half running_arch_code=EM_X86_64;
 #elif  (defined IA64)
   static  Elf32_Half running_arch_code=EM_IA_64;