RFR: 8366777: Build fails unknown pseudo-op with old AS on linux-aarch64 [v13]

SendaoYan syan at openjdk.org
Fri Sep 12 07:00:23 UTC 2025


On Thu, 11 Sep 2025 21:16:28 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Create a seperate macro FLAGS_SETUP_SVE
>
> make/autoconf/flags-other.m4 line 167:
> 
>> 165:     fi
>> 166:     CFLAGS="$OLD_CFLAGS"
>> 167:     AC_LANG_POP(C)
> 
> This part should be included in the `IF_ENABLED` block in `UTIL_ARG_ENABLE`.

The `FLAGS_COMPILER_CHECK_ARGUMENTS` macro seem do not work normally in `IF_ENABLED:` block. The 'bash configure' command report "Internal error: Argument DEFAULT to UTIL_ARG_ENABLE can only be true, false or auto, was: ARG_DEFAULT". Below is the implementation.


AC_DEFUN([FLAGS_SETUP_SVE],
[
  UTIL_ARG_ENABLE(NAME: aarch64-sve, DEFAULT: auto,
    RESULT: AARCH64_SVE_ENABLED,
    DESC: [Use SVE when compiling libsleef],
    AVAILABLE: false,
    CHECK_AVAILABLE: [
      # Apple Silicon does not support SVE; use macOS as a proxy for that check.
      if test "x$OPENJDK_TARGET_CPU" = "xaarch64" && test "x$OPENJDK_TARGET_OS" = "xlinux"; then
        if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
          # check the compiler and binutils support sve or not
          AC_MSG_CHECKING([if Arm SVE ACLE is supported])
          AC_LANG_PUSH([C])
          saved_cflags="$CFLAGS"
          saved_cc="$CC"
          CFLAGS="$CFLAGS -march=armv8-a+sve $CFLAGS_WARNINGS_ARE_ERRORS ARG_ARGUMENT"
          CC="$ARG_PREFIX[CC]"
          AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
            [
              #include <arm_sve.h>
              svfloat64_t a() {}
            ],
            [
              svint32_t r = svdup_n_s32(1)
            ])],
            [AVAILABLE=true],
            [AVAILABLE=false]
          )
          AC_MSG_RESULT([$AVAILABLE])
          CC="$saved_cc"
          CFLAGS="$saved_cflags"
          AC_LANG_POP([C])
        fi
      fi
    ],
    IF_ENABLED: [
      SVE_CFLAGS="-march=armv8-a+sve"
      # Switching the initialization mode with gcc from 'pattern' to 'zero'
      # avoids the use of unsupported `__builtin_clear_padding` for variable
      # length aggregates
      if test "x$DEBUG_LEVEL" != xrelease && test "x$TOOLCHAIN_TYPE" = xgcc ; then
        AC_MSG_CHECKING([Switching the initialization mode with gcc from pattern to zero])
        INIT_ZERO_FLAG="-ftrivial-auto-var-init=zero"
        FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$INIT_ZERO_FLAG],
          IF_TRUE: [SVE_CFLAGS="${SVE_CFLAGS} $INIT_ZERO_FLAG"])
      fi
    ]
    )
  AC_SUBST(SVE_CFLAGS)
])

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2343202947


More information about the build-dev mailing list