Open GabrielRavier opened 1 year ago
For now the frame pointer is read-only, and we can only return values via registers, which basically means you can only return 1 value within 64-bit R0 register.
Note that the linux kernel documentation explicitly states that BPF does not support multiple returning values.
https://docs.kernel.org/bpf/bpf_design_QA.html#id6
This issue should be consider as "won't fix" or just turn the backend crashing into some elegant error reporting.
I guessed it was probably an issue with BPF itself but I was reporting in large part because I'd assume anything that makes LLVM go "FATAL ERROR PLEASE REPORT THIS TO GITHUB" is a bug that should be fixed, even if just to make it so it doesn't direct the user to report to GitHub.
Also, does this imply there's a bug in GCC's BPF backend, given that it'll happily return an __int128_t
by stuffing half the return value in r1
?
I guessed it was probably an issue with BPF itself but I was reporting in large part because I'd assume anything that makes LLVM go "FATAL ERROR PLEASE REPORT THIS TO GITHUB" is a bug that should be fixed, even if just to make it so it doesn't direct the user to report to GitHub.
Totally agree as I commented above,
turn the backend crashing into some elegant error reporting.
The following code:
currently makes trunk Clang crash when using the eBPF backend, with the following error message:
this appears to be caused by LLVM seemingly not knowing how to handle returning 128-bit objects.