I apologize for taking a while. I now have setup with top of tree and can do testing easily. However the approach with -fprofile-generate=<dir> -fprofile-use=<samedir> does not work with GCC9+. GCC8 used relative paths to name files in the profile directory and that was updated to use absolute paths in funny # mangling in GCC9+. This means that the -fprofile-feedback=<samedir> compilation is not able to find the gcda files produced at runtime because the absolute path of object file produced is different.
I will implement flag in GCC, but until that happens I think it is best to use -fprofile-generate and -fprofile-use and before starting -fprofile-use just copy gcda files to new location. Somehting like
tar cf <profdata> `find . -name "*.gcda"'
tar xf <profdata>
Sorry for suggesting a wrong direction originally.