Closed
Description
Problem
PGO works in two phases:
- Compile an instrumented binary of your program that enables collecting profile data. This is done via
RUSTFLAGS=-Cprofile-generate
. - Compile an optimized binary that makes use of the profile data collected in step (1). This is done via
RUSTFLAGS=-Cprofile-use
.
In order for this to work, the symbol names within the two program versions must match up because LLVM generates profiling data in terms of symbol names.
However, since #6503, RUSTFLAGS
are fed into the -Cmetadata
argument to rustc
. This causes symbol names to differ because one version has -Cprofile-generate
and the other has -Cprofile-use
in their RUSTFLAGS
.
I think I would prefer not feeding RUSTFLAGS
into -C metadata
at all. It does not seem right to me that symbol names are affected by random command line arguments to the compiler.