Pitfall Record: Enabling PGO Compilation Optimization in GCC 7.3.0 Results in Missing gcov Symbols? The Final Solution is Here!

Pitfall Record: Enabling PGO Compilation Optimization in GCC 7.3.0 Results in Missing gcov Symbols? The Final Solution is Here!

1. Background In the performance optimization practice of C/C++, PGO (Profile-Guided Optimization) is a very effective compilation optimization technique. The basic process is divided into two stages: Generation Stage (profile-generate): The compiler inserts additional counting logic into the code (e.g., function call counts, branch hit counts, etc.). Usage Stage (profile-use): The runtime collected profile data … Read more