Invalid runtime symbol while bolting go binary #154
Comments
Hello. The bolt doesn't support golang currently. |
@nmdis1999 thanks for detailed reporting! BOLT should be working with golang binaries, we'll take a look. |
@aaupov The golang heavily uses function pointer deltas, which BOLT doesn't support. Plus some problems like with symbol table sorting must be resolved specifically for golang binaries.. |
@yota9 Thanks for the context. Is it relying on function pointers for every function? Can we strategically blacklist e.g. runtime functions? Symbol table sorting might perhaps be worked around with -use-old-text, but let me see. |
@aaupov It is hard for me to say right now on every function or not, at least for the interface function it does, so it could be not only runtime. Use old text won't help, but you can save the list of the symbols using nm :) But the functions sizes will change and the deltas would be screwed up anyway. But it is not the biggest issue, there are few static tables that belongs to the function, which shows the offset from the beginning of the function to the specific instruction. For example pcsp table show the offsets to the SP-change instructions, that is the real challenge here :) |
@yota9 That's good to know. We can disable function re-ordering by removing While we had some limited success re-writing golang binaries, it appears to be dependent on the specific version of the runtime and options used. Overall, you are correct in stating "BOLT doesn't support golang". The generated code and runtime heavily depends on function and instruction locations. For proper support, BOLT will need to understand all dependencies and update them accordingly. |
Can we expect BOLT supporting golang in future? |
@nmdis1999: currently we don't have specific plans on supporting golang binaries. |
@thomasdullien Hello! I think no. Since golang runtime is mostly supported by Google, it has poor documentation and the only way I know is to look at runtime code and binary objdump :) |
Hello, is there a list of open projects to work on? |
Hi All, I'm glad to announce that we (Advanced Software Technology Lab, Huawei) are working on introducing Go support in BOLT. @yota9 (aka @yota9-huawei 😄) is a member of our team (well, actually he is the key member of this project). Another member of the team is Alexey Moksyakov, who also committed a patch recently. "Almost" product-quality version is ready internally, and it demonstrates pretty impressive performance gains on real-world Go applications. There is nothing in BOLT that prevents its usage for Go, but being a pretty distinct runtime environment (with roots going back to Plan9, not Unix) Go requires some pretty complex changes -- both in BOLT and Go compiler itself (that we're also working on). We plan to upstream everything (both BOLT and Go compiler parts) soon; but as common, first we need to pass all the internal regulations. Thus, I can't make specific promises; but we definitely plan to upstream and continue development in a completely open way, as a part of an open-source community (LLVM at that time? -- we'll see). Hope to share more news soon! Yours, |
That's amazing! Looking forward to your teams's patches. Will also be interested in hearing details on challenges you've faced and Go runtime internals. |
Marking as closed, the support is added in https://reviews.llvm.org/D141234, to be upstreamed soon. |
Hello, I was trying to run bolt on go binary and I am seeing very werid message. I followed following steps:
message from perf2bolt:
Error after running the executable
Not sure what's happening here, can you help?
The text was updated successfully, but these errors were encountered: