The newer version of GCC has changed spec related to pthread, so libatomic is not automatically added when "-pthread" is specified (see https://github.com/riscv-collab/riscv-gcc/issues/337). For doubleword atomics, libatomic is still needed (implemented with locks).
Details
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 22332 Build 54618: Vulcan Build Jenkins Build 54617: Vulcan Build (macOS) Jenkins Build 54616: Vulcan Build (Windows) Jenkins
Event Timeline
Thanks for the patch, @xctan! I've added you to the "Contributors" group, so the next time you upload a patch, it is built by our CI.
I can't comment on the patch itself, but I can ask you to upload it with context and add yourself to the credits. :)
(See https://trac.wildfiregames.com/wiki/SubmittingPatches#Makingsomechanges.)
Is this ment to be applied on top of D4634?
The dw-cas is likely used in boost::lockfree::queue and we try to remove boost as a dependency.
We don't use 16byte atomics directly, I think it might be under the hood of boost::lockfree::queue. I'm also wondering why it's not linked automatically (by detecting standard library usage)?
Possible references:
Previously before inline atomics were added to riscv-gcc, --as-needed -latomic --no-as-needed is included in the builtin spec for pthread, which in turn automatically detects its usage. But on riscv64 doubleword atomics can't be lockfree (i.e. no instruction support in rv64gc ISA), so the compiler can't inline these operations either. The library libatomic internally uses a table of locks to ensure atomicity.
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7285/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8374/display/redirect
Sorry for the long reply. Could you upload your system_info and userreport_hwdetect with your hardware? Also how smooth is it?
We'd like to support riscv64 but we don't have active people to test it.
From the ticket on Twitter, I'm not sure but I think the hangs are caused by the GC (Similar issue on RPI4):
I haven't thoroughly tested the game on my RISC-V boards yet. Their integrated Imagination GPUs have poor driver support. So, I'm waiting for new boards with PCIe slots, where a decent GPU with proper OpenGL support can be attached.
Sophgo is going to launch a new SoC SG2380 with more powerful SiFive cores in a few days.