-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime,cmd/compile: build errors with "relocation truncated to fit" on linux-riscv-unmatched as of CL 345051 #48791
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
Comments
This appears to have broken at CL 345051. |
I can reproduce this and it will definitely be a result of the call trampolines change. That said, there is some pretty strange code generation going on here - the unicode/norm test compiles to a 40MB text object, with the
The issue is caused by the fact that we now use a From the riscv64 side there are potential a number of options if we want/need to continue to support functions of this size (unfortunately all have complexity/downsides):
|
@4a6f656c thanks for the investigation.
This doesn't sound too bad to me. I think we can do it in the assembler without much complexity. At the PC assignment loop https://cs.opensource.google/go/go/+/master:src/cmd/internal/obj/riscv/obj.go;l=589 we'll know the size of a function. If it is too large we can just redo the PC assignment while rewriting JAL to AUIPC/JALR. |
For the record, it turns out that the strange code are address calculations that have not yet had relocations applied. Overall, it looks like the main code bloat results from initialisation of sparse arrays - I would have expected this to be data driven with minimal code, where as instead it seems to be almost entirely code driven. |
Right, we can do that - it adds some complexity and interferes with some of the next steps to further clean up the assembler and eliminate obj.Prog rewriting, but I'll deal with that in due course. |
Change https://golang.org/cl/356250 mentions this issue: |
greplogs --dashboard -md -l -e 'relocation truncated to fit' --since=2021-05-01
2021-10-05T07:32:41-5bd84dd-d55009c/linux-riscv64-unmatched
2021-10-05T01:30:56-5bd84dd-123393a/linux-riscv64-unmatched
2021-10-05T00:29:40-5bd84dd-81b7ec1/linux-riscv64-unmatched
2021-10-02T17:29:46-1b99300-3bbc823/linux-riscv64-unmatched
CC @cherrymui @4a6f656c
The text was updated successfully, but these errors were encountered: