On Thu, 11 Sep 2025 14:11:39 GMT, SendaoYan <s...@openjdk.org> wrote:
>> Hi all, >> >> Build jdk on linux-aarch64 with older assembler version(as 2.30) will report >> compilation failre, shows as >> [JDK-8366777](https://bugs.openjdk.org/browse/JDK-8366777). >> >> This PR add the expression `svfloat64_t a() {}` to makefile which will >> trigger the compilation during configure stage. After this PR, at configure >> stage will check the gcc and assember support `-march=armv8-a+sve` or not >> more comprehensive. >> >> Testing: >> - [x] On linux-aarch64 gcc12.3.1 as2.37, configure set SVE_CFLAGS as >> '-march=armv8-a+sve' >> - [x] On linux-aarch64 gcc10.3.0 as2.30, configure set SVE_CFLAGS as empty >> >> >> The compilation fails demo as below: >> >> >> # cat sve.c >> #include <arm_sve.h> >> svfloat64_t a() {} >> # gcc -march=armv8-a+sve sve.c >> /tmp/ccVOzMzb.s: Assembler messages: >> /tmp/ccVOzMzb.s:6: Error: unknown pseudo-op: `.variant_pcs' > > SendaoYan has updated the pull request incrementally with one additional > commit since the last revision: > > Create a seperate macro FLAGS_SETUP_SVE This definitely looks better but still some things that can be improved. make/autoconf/flags-other.m4 line 116: > 114: UTIL_ARG_ENABLE(NAME: aarch64-sve, DEFAULT: auto, > 115: RESULT: AARCH64_SVE_ENABLED, > 116: DESC: [Use SVE when compile libsleef], Suggestion: DESC: [Use SVE when compiling libsleef], make/autoconf/flags-other.m4 line 119: > 117: CHECK_AVAILABLE: [ > 118: # Check whether the compiler supports the Arm C Language > Extensions (ACLE) > 119: # for SVE. Set SVE_CFLAGS to -march=armv8-a+sve if it does. This comment is a bit out of date with the code now. This is just the check available part. Maybe move this to before the macro call? make/autoconf/flags-other.m4 line 140: > 138: ])], > 139: [AVAILABLE=yes], > 140: [AVAILABLE=no] The documentation of `UTIL_ARG_ENABLE` says that `AVAILABLE` needs to be set to `false` when not available. make/autoconf/flags-other.m4 line 146: > 144: CFLAGS="$saved_cflags" > 145: AC_LANG_POP([C]) > 146: fi I think we need `AVAILABLE=fallse` when not matching the toolchain. This can also be expressed as `AVAILABLE: false` as a parameter to `UTIL_ARG_ENABLE`. The `CHECK_AVAILABLE` gets a chance to overwrite that value. 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`. ------------- PR Review: https://git.openjdk.org/jdk/pull/27073#pullrequestreview-3213638099 PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2342338970 PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2342341790 PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2342355196 PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2342354523 PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2342359541