changeset 2370:3d1b2ce06d99

8139303: aarch32: add support for ARM aarch32 Summary: Initial port of template interpreter to aarch32 Reviewed-by: duke Contributed-by: nikolay@azulsystems.com
author enevill
date Wed, 30 Dec 2015 09:25:50 +0000
parents 832508a6165c
children 84a69380750b
files common/autoconf/build-aux/config.sub common/autoconf/generated-configure.sh common/autoconf/jdk-options.m4 common/autoconf/platform.m4 common/autoconf/toolchain.m4 cross-pkg-config cross_configure.sh cross_make.sh
diffstat 8 files changed, 130 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/build-aux/config.sub	Mon Oct 26 13:20:08 2015 -0700
+++ b/common/autoconf/build-aux/config.sub	Wed Dec 30 09:25:50 2015 +0000
@@ -29,36 +29,43 @@
 
 DIR=`dirname $0`
 
-# First, filter out everything that doesn't begin with "aarch64-"
-if ! echo $* | grep '^aarch64-' >/dev/null ; then
+# First, filter out everything that doesn't begin with "aarch32-" or "aarch64-"
+if ! echo $* | grep -E '^(aarch32-|aarch64-)' >/dev/null; then
     . $DIR/autoconf-config.sub "$@"
     # autoconf-config.sub exits, so we never reach here, but just in
     # case we do:
     exit
 fi
 
-while test $# -gt 0 ; do
-    case $1 in 
-        -- )   # Stop option processing
+original="arm-"
+
+while test $# -gt 0; do
+    case $1 in
+        --) # Stop option processing
             shift; break ;;
-        aarch64-* )
+        aarch32-*)
+            config=`echo $1 | sed 's/^aarch32-/arm-/'`
+            sub_args="$sub_args $config"
+            original="aarch32-"
+            shift ;;
+        aarch64-*)
             config=`echo $1 | sed 's/^aarch64-/arm-/'`
             sub_args="$sub_args $config"
-            shift; ;;
-        - )    # Use stdin as input.
+            original="aarch64-"
+            shift ;;
+        -) # Use stdin as input
             sub_args="$sub_args $1"
             shift; break ;;
-        * )
+        *)
             sub_args="$sub_args $1"
-            shift; ;;
+            shift ;;
     esac
 done
 
 result=`. $DIR/autoconf-config.sub $sub_args "$@"`
 exitcode=$?
 
-result=`echo $result | sed "s/^arm-/aarch64-/"`
+result=`echo $result | sed "s/^arm-/$original/"`
 
 echo $result
 exit $exitcode
-
--- a/common/autoconf/generated-configure.sh	Mon Oct 26 13:20:08 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Wed Dec 30 09:25:50 2015 +0000
@@ -3880,7 +3880,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1445418840
+DATE_WHEN_GENERATED=1451436803
 
 ###############################################################################
 #
@@ -6825,8 +6825,14 @@
       VAR_CPU_ENDIAN=little
       ;;
     arm*)
-      VAR_CPU=arm
-      VAR_CPU_ARCH=arm
+      VAR_CPU=aarch32
+      VAR_CPU_ARCH=aarch32
+      VAR_CPU_BITS=32
+      VAR_CPU_ENDIAN=little
+      ;;
+    aarch32)
+      VAR_CPU=aarch32
+      VAR_CPU_ARCH=aarch32
       VAR_CPU_BITS=32
       VAR_CPU_ENDIAN=little
       ;;
@@ -6962,8 +6968,14 @@
       VAR_CPU_ENDIAN=little
       ;;
     arm*)
-      VAR_CPU=arm
-      VAR_CPU_ARCH=arm
+      VAR_CPU=aarch32
+      VAR_CPU_ARCH=aarch32
+      VAR_CPU_BITS=32
+      VAR_CPU_ENDIAN=little
+      ;;
+    aarch32)
+      VAR_CPU=aarch32
+      VAR_CPU_ARCH=aarch32
       VAR_CPU_BITS=32
       VAR_CPU_ENDIAN=little
       ;;
@@ -7978,13 +7990,16 @@
 
 
   INCLUDE_SA=true
-  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
+  if test "x$JVM_VARIANT_ZERO" = xtrue; then
+    INCLUDE_SA=false
+  fi
+  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
     INCLUDE_SA=false
   fi
-  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
+  if test "x$OPENJDK_TARGET_CPU" = xppc64; then
     INCLUDE_SA=false
   fi
-  if test "x$VAR_CPU" = xppc64 ; then
+  if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
     INCLUDE_SA=false
   fi
   if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
@@ -29667,7 +29682,7 @@
   #
   case $COMPILER_NAME in
     gcc )
-      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
+      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-unused-parameter -Wno-parentheses \
       -pipe \
       -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
       case $OPENJDK_TARGET_CPU_ARCH in
--- a/common/autoconf/jdk-options.m4	Mon Oct 26 13:20:08 2015 -0700
+++ b/common/autoconf/jdk-options.m4	Wed Dec 30 09:25:50 2015 +0000
@@ -152,13 +152,16 @@
   AC_SUBST(JVM_VARIANT_CORE)
 
   INCLUDE_SA=true
-  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
+  if test "x$JVM_VARIANT_ZERO" = xtrue; then
     INCLUDE_SA=false
   fi
-  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
+  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
     INCLUDE_SA=false
   fi
-  if test "x$VAR_CPU" = xppc64 ; then
+  if test "x$OPENJDK_TARGET_CPU" = xppc64; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
     INCLUDE_SA=false
   fi
   if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
--- a/common/autoconf/platform.m4	Mon Oct 26 13:20:08 2015 -0700
+++ b/common/autoconf/platform.m4	Wed Dec 30 09:25:50 2015 +0000
@@ -43,8 +43,14 @@
       VAR_CPU_ENDIAN=little
       ;;
     arm*)
-      VAR_CPU=arm
-      VAR_CPU_ARCH=arm
+      VAR_CPU=aarch32
+      VAR_CPU_ARCH=aarch32
+      VAR_CPU_BITS=32
+      VAR_CPU_ENDIAN=little
+      ;;
+    aarch32)
+      VAR_CPU=aarch32
+      VAR_CPU_ARCH=aarch32
       VAR_CPU_BITS=32
       VAR_CPU_ENDIAN=little
       ;;
--- a/common/autoconf/toolchain.m4	Mon Oct 26 13:20:08 2015 -0700
+++ b/common/autoconf/toolchain.m4	Wed Dec 30 09:25:50 2015 +0000
@@ -957,7 +957,7 @@
   #
   case $COMPILER_NAME in
     gcc )
-      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
+      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-unused-parameter -Wno-parentheses \
       -pipe \
       -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
       case $OPENJDK_TARGET_CPU_ARCH in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cross-pkg-config	Wed Dec 30 09:25:50 2015 +0000
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Wrapper script that calls the real pkg-config with the relocated
+# sysroot location
+#
+# Wrapper derived from raspberry crosstool and modified to take SYSROOT
+# env variable from outside instead of computing via gcc -print-sysroot,
+# which produces wrong output if called without CFLAGS which contain --sysroot
+# Computing with CFLAGS not used, as pkg-config, in general, should not rely 
+# on CC, CFLAGS, ...
+# However, we need to CC env defined to compute pkg-config-real executable.
+# CC could be not used, if this script placed in raspberry crosstool's bin/.
+ 
+set -e
+
+if [ ! $SYSROOT ] || [ ! $CC ]; then
+	echo "No SYSROOT or CC env defined, exiting"
+	exit 1
+fi
+
+GCC="$CC"
+MACHINE=`"$GCC" -dumpmachine`
+
+#GCC could contain version like xxx-gcc-4.8.3, assuming xxx is equal to machine name
+PKG_CONFIG_REAL=${GCC%$MACHINE-*}$MACHINE-pkg-config-real
+
+export PKG_CONFIG_DIR=
+export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/${MACHINE}/pkgconfig":"${SYSROOT}/usr/lib/pkgconfig":"${SYSROOT}/usr/share/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR="${SYSROOT}"
+
+exec $PKG_CONFIG_REAL "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cross_configure.sh	Wed Dec 30 09:25:50 2015 +0000
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -v
+
+LDFLAGS="--sysroot=$RASPI_ROOT"  \
+CFLAGS="--sysroot=$RASPI_ROOT"  \
+CXXFLAGS="--sysroot=$RASPI_ROOT"  \
+PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$RASPI_ROOT/usr/lib/arm-linux-gnueabihf/pkgconfig"  \
+PKG_CONFIG=$PWD/cross-pkg-config \
+SYSROOT=$RASPI_ROOT \
+bash configure  \
+	CC=arm-linux-gnueabihf-gcc  \
+	CXX=arm-linux-gnueabihf-g++  \
+	BUILD_CC=gcc  \
+	BUILD_LD=gcc  \
+	--with-sys-root=$RASPI_ROOT \
+	--with-freetype-include=$RASPI_ROOT/usr/include/freetype2/  \
+	--with-freetype-lib=$RASPI_ROOT/usr/lib/arm-linux-gnueabihf  \
+	--x-includes=$RASPI_ROOT/usr/include/  \
+	--x-libraries=$RASPI_ROOT/usr/lib  \
+	--disable-precompiled-headers \
+	--with-extra-cflags=--sysroot=$RASPI_ROOT \
+	--with-extra-cxxflags=--sysroot=$RASPI_ROOT \
+	--with-extra-ldflags=--sysroot=$RASPI_ROOT \
+	--openjdk-target=aarch32-linux-gnueabihf \
+	"$@"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cross_make.sh	Wed Dec 30 09:25:50 2015 +0000
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -v
+
+CFLAGS="--sysroot=$RASPI_ROOT"  \
+CXXFLAGS="--sysroot=$RASPI_ROOT"  \
+LDFLAGS="--sysroot=$RASPI_ROOT"  \
+BUILD_LD=gcc \
+make \
+    OBJCOPY=/opt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-objcopy \
+    STRIP=/opt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-strip \
+    POST_STRIP_CMD="/opt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-strip -g" \
+	BUILD_LD=gcc \
+	"$@"