[jdk17u-dev] RFR: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b

Gui Cao gcao at openjdk.org
Sat Nov 18 10:20:55 UTC 2023


Hi, I would like to backport this riscv-specific change to remove dependency on latomic libraries.
latomic is used for non native atomic operation which causes problems with extra dependency. This have been fixed in recent gcc, so latomic is no longer needed. this backport will work for older gcc versions as well,  it uses assembly code.
The backport is not clean because jdk17u-dev has no [JDK-8307806](https://bugs.openjdk.org/browse/JDK-8307806), and the original patch modified a test case(test/hotspot/gtest/runtime/test_atomic.cpp), but there is no corresponding test case in the jdk17u-dev.

### Testing:
qemu 8.1.50 with UseRVV:
- [x] Tier1 tests (release)
- [x] Tier2 tests (release)
- [x] Tier3 tests (release)

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

Commit messages:
 - Backport 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b

Changes: https://git.openjdk.org/jdk17u-dev/pull/1970/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=1970&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316645
  Stats: 79 lines in 2 files changed: 73 ins; 6 del; 0 mod
  Patch: https://git.openjdk.org/jdk17u-dev/pull/1970.diff
  Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/1970/head:pull/1970

PR: https://git.openjdk.org/jdk17u-dev/pull/1970


More information about the jdk-updates-dev mailing list