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

Magnus Ihse Bursie ihse at openjdk.org
Tue Sep 9 07:21:16 UTC 2025


On Sun, 7 Sep 2025 14:04:40 GMT, SendaoYan <syan at openjdk.org> wrote:

>> make/autoconf/flags-cflags.m4 line 996:
>> 
>>> 994: AC_DEFUN([BPERF_SETUP_SVE],
>>> 995: [
>>> 996:   UTIL_ARG_ENABLE(NAME: aarch64-sve, DEFAULT: auto,
>> 
>> The idea with this macro is that you put the supported check and actions on enabled/disabled in the call and let it handle the logic. It shouldn't be moved to a separate macro. Also, macros defined in this file should have the `FLAGS` prefix, not `BPERF`.
>
> I also want to put the put the supported check and actions on enabled/disabled in the call previous. But I found that the configure will stuck at below command:
> 
> 
> ++ /usr/bin/autoconf -W all -I/home/yansendao/git/jdk-ysd/make/autoconf -
> 
> 
> The change like that:
> 
> 
> diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
> index 97e37cc923b..96ea730e80a 100644
> --- a/make/autoconf/flags-cflags.m4
> +++ b/make/autoconf/flags-cflags.m4
> @@ -940,6 +940,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
>    # ACLE and this flag are required to build the aarch64 SVE related functions in
>    # libvectormath. Apple Silicon does not support SVE; use macOS as a proxy for
>    # that check.
> +  UTIL_ARG_ENABLE(NAME: aarch64-sve, DEFAULT: auto,
> +      RESULT: enable_aarch64_sve,
> +      DESC: [Use SVE when compile libsleef])
> +  AC_SUBST(enable_aarch64_sve)
>    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
>        AC_LANG_PUSH(C)
> @@ -991,14 +995,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
>    AC_SUBST($2SVE_CFLAGS)
>  ])
> 
> -AC_DEFUN([BPERF_SETUP_SVE],
> -[
> -  UTIL_ARG_ENABLE(NAME: aarch64-sve, DEFAULT: auto,
> -      RESULT: enable_aarch64_sve,
> -      DESC: [Use SVE when compile libsleef])
> -  AC_SUBST(enable_aarch64_sve)
> -])
> -
>  AC_DEFUN_ONCE([FLAGS_SETUP_BRANCH_PROTECTION],
>  [
>    # Is branch protection available?
> 
> 
> I think I should find other solution later.

This is since `FLAGS_SETUP_CFLAGS_CPU_DEP` is called twice. UTIL_ARG_ENABLE should only be called once. So it is (unfortunately) correct that the call to UTIL_ARG_ENABLE cannot be close to where it is used, in this case. 

However, it seems excessive to call a separate function from the top-level configure.ac only for that. I believe you can just inline this into FLAGS_SETUP_FLAGS, or at the very least, call `FLAGS_SETUP_SVE` (as it should be called, if kept) from  FLAGS_SETUP_FLAGS.

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

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


More information about the build-dev mailing list