common/autoconf/flags.m4
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/common/autoconf/flags.m4	Tue Sep 27 09:55:50 2016
--- new/common/autoconf/flags.m4	Tue Sep 27 09:55:49 2016

*** 21,30 **** --- 21,126 ---- # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. # + ################################################################################ + # + # Setup ABI profile (for arm) + # + AC_DEFUN([SETUP_ABI_PROFILE], + [ + AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile], + [specify ABI profile (for arm)])]) + + if test "x$with_abi_profile" != x; then + if test "x$OPENJDK_TARGET_CPU" != xarm && \ + test "x$OPENJDK_TARGET_CPU" != xaarch64; then + AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64]) + fi + + OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile + AC_MSG_CHECKING([for ABI profle]) + AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE]) + + if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then + ARM_FLOAT_TYPE=vfp-sflt + ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' + elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then + ARM_FLOAT_TYPE=vfp-hflt + ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' + elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then + ARM_FLOAT_TYPE=sflt + ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' + elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then + ARM_FLOAT_TYPE=vfp-sflt + ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' + elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then + ARM_FLOAT_TYPE=vfp-hflt + ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' + elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then + # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME + ARM_FLOAT_TYPE= + ARM_ARCH_TYPE_FLAGS= + elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then + # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME + ARM_FLOAT_TYPE= + ARM_ARCH_TYPE_FLAGS= + else + AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"]) + fi + + if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then + ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' + elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then + ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' + elif test "x$ARM_FLOAT_TYPE" = xsflt; then + ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' + fi + AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) + AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) + + AC_MSG_CHECKING([for arch type flags]) + AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) + + # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the + # autoconf target triplet. + [ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] + # Sanity check that it is a known ABI. + if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ + test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ + test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then + AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) + fi + AC_MSG_CHECKING([for ABI property name]) + AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) + AC_SUBST(JDK_ARCH_ABI_PROP_NAME) + + # Pass these on to the open part of configure as if they were set using + # --with-extra-c[xx]flags. + with_extra_cflags="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS $with_extra_cflags" + with_extra_cxxflags="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS $with_extra_cxxflags" + # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4" + # FIXME: This should not really be set using extra_cflags. + if test "x$OPENJDK_TARGET_CPU" = xarm; then + with_extra_cflags="-Wno-psabi $with_extra_cflags" + with_extra_cxxflags="-Wno-psabi $with_extra_cxxflags" + fi + # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS. + with_extra_cflags="-DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"' $with_extra_cflags" + # And pass the architecture flags to the linker as well + with_extra_ldflags="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS $with_extra_ldflags" + fi + + # When building with an abi profile, the name of that profile is appended on the + # bundle platform, which is used in bundle names. + if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then + OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" + fi + AC_SUBST(OPENJDK_TARGET_ABI_PROFILE) + ]) + # Reset the global CFLAGS/LDFLAGS variables and initialize them with the # corresponding configure arguments instead AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS], [ if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
*** 351,360 **** --- 447,466 ---- SET_SHARED_LIBRARY_ORIGIN='' SET_SHARED_LIBRARY_NAME='' SET_SHARED_LIBRARY_MAPFILE='-def:[$]1' fi + # arm specific settings + if test "x$OPENJDK_TARGET_CPU_ARCH" = "xarm"; then + CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB -fsigned-char" + CFLAGS_JDKLIB="$CFLAGS_JDKLIB -fsigned-char" + CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE -fsigned-char" + CFLAGS_JDKEXE="$CFLAGS_JDKEXE -fsigned-char" + # '-Wl,-z,origin' isn't used on arm. + SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1' + fi + AC_SUBST(C_FLAG_REORDER) AC_SUBST(CXX_FLAG_REORDER) AC_SUBST(SET_EXECUTABLE_ORIGIN) AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) AC_SUBST(SET_SHARED_LIBRARY_NAME)

common/autoconf/flags.m4
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File