On Thu, 11 Sep 2025 12:44:42 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:
> 
>   Fix CFLAGS save bugs after "Use lambda with CHECK_AVAIABLE"

I would suggest creating a separate `FLAGS_SETUP_SVE`, called from 
`FLAGS_SETUP_FLAGS` and put the whole thing in there.

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

> 951:         IF_TRUE: [
> 952:           $2SVE_CFLAGS="${$2SVE_CFLAGS} $INIT_ZERO_FLAG"
> 953:         ]

This should also be moved out of `FLAGS_SETUP_CFLAGS_CPU_DEP`. The role of the 
macro `FLAGS_SETUP_CFLAGS_CPU_DEP` is to be run twice, once for the target 
compiler and once for the build compiler. If we have concluded that the sve 
flags are irrelevant to the build compiler and only want to do this once for 
just the target compiler, then it shouldn't be in this macro. The whole thing 
needs to be outside of it and be run explicitly against just the target 
compiler. I think it can all be inlined in the macro call to `UTIL_ARG_ENABLE`.

make/autoconf/flags.m4 line 377:

> 375:       # libvectormath. Apple Silicon does not support SVE; use macOS as 
> a proxy for
> 376:       # that check.
> 377:       if test "x$FLAGS_CPU" = "xaarch64" && test "x$FLAGS_OS" = 
> "xlinux"; then

If moving this outside of `FLAGS_SETUP_CFLAGS_CPU_DEP`, then these variables 
don't exist anymore.

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

PR Review: https://git.openjdk.org/jdk/pull/27073#pullrequestreview-3211450697
PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2340776092
PR Review Comment: https://git.openjdk.org/jdk/pull/27073#discussion_r2340763819

Reply via email to