Add a 'fdo_optimize' feature to the auto-configured crosstool.
Bazel's fallback action config for PGO optimization uses Google-internal
compiler flags. Here, we provide a 'fdo_optimize' feature without these internal
flags, so --fdo_optimize can work out of the box.
This fixes
@@ -131,6 +131,20 @@ toolchain {
linking_mode_flags { mode: DYNAMIC }
%{coverage}
+
+ feature {
+ name: 'fdo_optimize'
+ provides: 'profile'
+ flag_set {
+ action: 'c-compile'
+ action: 'c++-compile'
+ expand_if_all_available: 'fdo_profile_path'
+ flag_group {
+ flag: '-fprofile-use=%{fdo_profile_path}'
+ flag: '-fprofile-correction',
+ }
+ }
+ }
}
toolchain {
