Closed mcronce closed 1 year ago
PS - thanks for the hard work on this! Your code in this repo and in the BOLT PRs for rustlang/rust are literally the only documentation I can find on using BOLT with Rust
Never mind the LTO bit; fat LTO is now not (even close to) worth the compile time hit to this project with the addition of BOLT, but it looks like it wasn't an actual blocking issue, only the strip
piece and LLVM version were.
Hi! Thanks for the useful information. In theory, cargo-pgo
could detect symbol stripping/fat LTO and warn the user about it. With LLVM version, it's a bit more difficult, because it's probably impossible for the plugin to detect whether a specific LLVM version will work or not :sweat_smile:
I added a warning about stripping symbols when using BOLT to the README. Let me know if you think that I should document more things.
I think that gets the job done. Hopefully it saves somebody some time :)
In order to get PGO+BOLT working, I needed to
strip = "symbols"
in my release profileIs it worth documenting those, and/or is there a way to make those settings work in
RUSTFLAGS
when you build the PGO-optimized binary that you're going to pass tollvm-bolt --instrument
? The errors come fromcc
, which makes them super cryptic and unhelpful; I found the workarounds by just throwing possible fixes at the wall until something stuck :joy:I can retrigger the errors tonight if having a copy of them would be helpful