RFR: 8341880: RISC-V: riscv_vector.h native build fails with gcc13 after JDK-8320500 [v3]

SendaoYan syan at openjdk.org
Fri Oct 11 07:57:48 UTC 2024


> Hi all,
> The file `src/jdk.incubator.vector/linux/native/libsleef/lib/vector_math_rvv.c` introduced by [JDK-8341880](https://bugs.openjdk.org/browse/JDK-8341880) native build fails by fedora OS shipped gcc13.
> Gcc13 doesn't have `__riscv_v_intrinsic` macro by default, and do have `__riscv_v_intrinsic` macro with option: `-march=rv64gcv`. libsleef only supported from llvm version 17 and gcc version 14 onwards, so we need to check the compiler version before use the `__riscv_v_intrinsic`.
> 
> ![image](https://github.com/user-attachments/assets/3bf8557d-d156-48a1-a762-44c1fa50a31c)
> 
> 
> gcc version infomation:
> 
> /usr/bin/gcc -v
> Using built-in specs.
> COLLECT_GCC=/usr/bin/gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/riscv64-redhat-linux/13/lto-wrapper
> Target: riscv64-redhat-linux
> Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-13.2.1-20230728/obj-riscv64-redhat-linux/isl-install --enable-gnu-indirect-function --with-arch=rv64gc --with-abi=lp64d --with-multilib-list=lp64d --build=riscv64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
> Thread model: posix
> Supported LTO compression algorithms: zlib zstd
> gcc version 13.2.1 20230728 (Red Hat 13.2.1-1) (GCC)
> 
> 
> Additonal testing:
> 
> - [x] riscv64 native release debug-level build with gcc13
> - [x] riscv64 native fastdebug debug-level build with gcc13
> - [x] riscv64 native release debug-level build with gcc14
> - [ ] riscv64 native fastdebug debug-level build with gcc14

SendaoYan has updated the pull request incrementally with one additional commit since the last revision:

  add the tailing blank line and add a commnet for #endif

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21442/files
  - new: https://git.openjdk.org/jdk/pull/21442/files/b9484edd..02e545c1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21442&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21442&range=01-02

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/21442.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21442/head:pull/21442

PR: https://git.openjdk.org/jdk/pull/21442


More information about the build-dev mailing list