On Fri, 5 Sep 2025 06:16:01 GMT, SendaoYan <[email protected]> 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:
> 
>   Use UTIL_ARG_ENABLE instead of AC_ARG_ENABLE

make/autoconf/flags-cflags.m4 line 963:

> 961:       AC_MSG_RESULT([$sve_supported])
> 962:       $2SVE_CFLAGS=""
> 963:       if test "x$enable_aarch64_sve" = "xyes"; then

`UTIL_ARG_ENABLE` will return `true`, not `yes`. Have you even tested this code?

make/autoconf/flags-cflags.m4 line 997:

> 995: [
> 996:   UTIL_ARG_ENABLE(NAME: aarch64-sve, DEFAULT: auto,
> 997:       RESULT: enable_aarch64_sve,

We use upper-case letters for everything but variables that are local to a 
function. A name like `AARCH64_SVE_ENABLED` would be more in line with how we 
usually name these variables (even if, for historical reasons, we have not been 
consistent with this.)

In fact, `UTIL_ARG_ENABLE` will create `AARCH64_SVE_ENABLED` for you 
automatically if you do not set `RESULT:`, but for clarity this is still 
recommended.

make/autoconf/flags-cflags.m4 line 999:

> 997:       RESULT: enable_aarch64_sve,
> 998:       DESC: [Use SVE when compile libsleef])
> 999:   AC_SUBST(enable_aarch64_sve)

You don't need `AC_SUBST`. You are not exporting this to spec.gmk.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2332257596
PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2332252805
PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2332253539

Reply via email to