1 # DP: Add support for x32
3 --- a/common/autoconf/platform.m4
4 +++ b/common/autoconf/platform.m4
5 @@ -31,10 +31,17 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU
6 # First argument is the cpu name from the trip/quad
12 - VAR_CPU_ENDIAN=little
13 + if test "`dpkg-architecture -qDEB_HOST_ARCH`" = x32 ; then
17 + VAR_CPU_ENDIAN=little
22 + VAR_CPU_ENDIAN=little
27 @@ -451,7 +458,13 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
28 ppc64) ZERO_ARCHDEF=PPC64 ;;
29 s390*) ZERO_ARCHDEF=S390 ;;
30 sparc*) ZERO_ARCHDEF=SPARC ;;
31 - x86_64*) ZERO_ARCHDEF=AMD64 ;;
33 + if test "`dpkg-architecture -qDEB_HOST_ARCH`" = x32 ; then
39 x86) ZERO_ARCHDEF=IA32 ;;
40 *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z)
42 --- a/hotspot/src/os/linux/vm/os_linux.cpp
43 +++ b/hotspot/src/os/linux/vm/os_linux.cpp
44 @@ -1980,7 +1980,7 @@ void * os::dll_load(const char *filename
47 static Elf32_Half running_arch_code=EM_386;
48 - #elif (defined AMD64)
49 + #elif (defined AMD64) || (defined X32)
50 static Elf32_Half running_arch_code=EM_X86_64;
52 static Elf32_Half running_arch_code=EM_IA_64;
53 --- a/jdk/make/gensrc/GensrcX11Wrappers.gmk
54 +++ b/jdk/make/gensrc/GensrcX11Wrappers.gmk
55 @@ -91,9 +91,11 @@ ifneq ($(COMPILE_TYPE), cross)
56 $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
58 # use -m32/-m64 only if the compiler supports it
59 + ifneq ($(OPENJDK_TARGET_CPU),x32)
60 ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true)
61 MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*"
65 # Compile the C code into an executable.
66 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c