New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile,runtime: race support for riscv64 #64345
Comments
I can setup a linux-riscv64-race builder(LUCI) for you. |
Thanks @mengzhuo, appreciate if you could handle that 🙏 |
@mengzhuo I tried compiling the syso file for riscv64 with CC=clang and got stuck in this part: runtime/race(.rodata): unexpected relocation type 291 (R_RISCV_ADD32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LBB438_37 (type=291 (R_RISCV_ADD32) stype=1 (STEXT))
runtime/race(.rodata): unexpected relocation type 295 (R_RISCV_SUB32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LJTI438_0 (type=295 (R_RISCV_SUB32) stype=9 (SRODATA))runtime/race(.rodata): unexpected relocation type 291 (R_RISCV_ADD32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LBB438_169 (type=291 (R_RISCV_ADD32) stype=1 (STEXT))
runtime/race(.rodata): unexpected relocation type 295 (R_RISCV_SUB32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LJTI438_0 (type=295 (R_RISCV_SUB32) stype=9 (SRODATA))runtime/race(.rodata): unexpected relocation type 291 (R_RISCV_ADD32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LBB438_169 (type=291 (R_RISCV_ADD32) stype=1 (STEXT))
runtime/race(.rodata): unexpected relocation type 295 (R_RISCV_SUB32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LJTI438_0 (type=295 (R_RISCV_SUB32) stype=9 (SRODATA))runtime/race(.rodata): unexpected relocation type 291 (R_RISCV_ADD32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LBB438_169 (type=291 (R_RISCV_ADD32) stype=1 (STEXT))
runtime/race(.rodata): unexpected relocation type 295 (R_RISCV_SUB32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LJTI438_0 (type=295 (R_RISCV_SUB32) stype=9 (SRODATA))runtime/race(.rodata): unexpected relocation type 291 (R_RISCV_ADD32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LBB438_169 (type=291 (R_RISCV_ADD32) stype=1 (STEXT))
runtime/race(.rodata): unexpected relocation type 295 (R_RISCV_SUB32)
runtime/race(.rodata): unsupported dynamic relocation for symbol .LJTI438_0 (type=295 (R_RISCV_SUB32) stype=9 (SRODATA))runtime/race(.rodata): unexpected relocation type 291 (R_RISCV_ADD32)
/home/ubuntu/git/go/pkg/tool/linux_riscv64/link: too many errors Maybe I have to use some specific compiler flag? I see that these relocations are currently supported in the go linker |
@mauri870 that looks like the riscv64 linker is missing handling for some relocation types - do you have a branch handy that I can build/test from? |
@4a6f656c I have some changes in one of my branches, hopefully you can still build from it, if not then let me know: https://github.com/golang/go/compare/master...mauri870:go:feature/race-riscv64?expand=1 Edit: If you wanna compile the syso file yourself, then you have to get a hold of a llvm copy and then |
There was a previous issue requesting support for riscv64 (#58739), but it was closed because upstream support in LLVM was lacking.
On Oct 6 support for riscv64 was finally merged into the LLVM tree.
I propose we reconsider adding race detector support to Risc-V. From the top of my head this would require:
Happy to work on this for the early stage of Go 1.23.
cc @golang/runtime @golang/riscv64
The text was updated successfully, but these errors were encountered: