Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8214466

Append assembler flags on ARM targets

    Details

    • Subcomponent:
    • Resolved In Build:
      b23
    • CPU:
      arm

      Description

      On 2018-11-25 07:49, Jakub Vaněk wrote:
      > Hi,
      >
      > This patch is a redo of the ARM926EJ-S patch. It adds a mechanism of
      > passing ARM CPU-specific flags to the assembler. This is achieved
      > through sharing variables between ABI setup and ASFLAGS setup. Then
      > this patch adds pre-existing -march flags in CFLAGS to ASFLAGS as well.
      >
      > An alternative way of doing this would be to set this directly in
      > flags-other.m4, but this would lead to setting ARM CPU-specific flags
      > on multiple places.
      >
      > It is not possible to simply copy CFLAGS to ASFLAGS, because not all
      > flags that the C compiler accepts are accepted by the assembler (e.g.
      > -marm doesn't work).

      # HG changeset patch
      # User Jakub Vaněk <linuxtardis at gmail.com>
      # Date 1543065692 -3600
      # Sat Nov 24 14:21:32 2018 +0100
      # Node ID c5ff4e346842d9025e8abdde0cf8c7d33dfd8d82
      # Parent 30a02b4e6c06e874ec8735dedb7e894844b1d627
      Append assembler flags on ARM targets

      diff --git a/make/autoconf/flags-other.m4 b/make/autoconf/flags-
      other.m4
      --- a/make/autoconf/flags-other.m4
      +++ b/make/autoconf/flags-other.m4
      @@ -119,6 +119,12 @@
         # Misuse EXTRA_CFLAGS to mimic old behavior
         $2JVM_ASFLAGS="$JVM_BASIC_ASFLAGS ${$2EXTRA_CFLAGS}"
       
      + if test "x$1" = "xTARGET" && \
      + test "x$TOOLCHAIN_TYPE" = xgcc && \
      + test "x$OPENJDK_TARGET_CPU" = xarm; then
      + $2JVM_ASFLAGS="${$2JVM_ASFLAGS} $ARM_ARCH_TYPE_ASFLAGS
      $ARM_FLOAT_TYPE_ASFLAGS"
      + fi
      +
         AC_SUBST($2JVM_ASFLAGS)
       ])
       
      diff --git a/make/autoconf/flags.m4 b/make/autoconf/flags.m4
      --- a/make/autoconf/flags.m4
      +++ b/make/autoconf/flags.m4
      @@ -49,38 +49,52 @@
           if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
             ARM_FLOAT_TYPE=vfp-sflt
             ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
      + ARM_ARCH_TYPE_ASFLAGS='-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'
      + ARM_ARCH_TYPE_ASFLAGS='-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'
      + ARM_ARCH_TYPE_ASFLAGS='-march=armv5t'
           elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
             ARM_FLOAT_TYPE=vfp-sflt
             ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
      + ARM_ARCH_TYPE_ASFLAGS='-march=armv5t'
           elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
             ARM_FLOAT_TYPE=vfp-hflt
             ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
      + ARM_ARCH_TYPE_ASFLAGS='-march=armv6'
           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=
      + ARM_ARCH_TYPE_ASFLAGS=
           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'
      + ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=softfp -mfpu=vfp"
           elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
             ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-
      vfp-hflt'
      + ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=hard -mfpu=vfp"
           elif test "x$ARM_FLOAT_TYPE" = xsflt; then
             ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
      + ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=soft -mfpu=vfp"
           fi
      +
           AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags])
           AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS])
      + AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags for
      assembler])
      + AC_MSG_RESULT([$ARM_FLOAT_TYPE_ASFLAGS])
       
           AC_MSG_CHECKING([for arch type flags])
           AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS])
      + AC_MSG_CHECKING([for arch type flags for assembler])
      + AC_MSG_RESULT([$ARM_ARCH_TYPE_ASFLAGS])
       
           # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last
      part of the
           # autoconf target triplet.


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dholmes David Holmes
                Reporter:
                dholmes David Holmes
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: