When using gcc with -fprofile-arcs and -ftest-coverage, when the resulting executable terminates, it tries to create .gcda output files in the same location as the .o files used to compile the executable. This is inconvenient when I'm running on a different machine than the one I built on -- is there any way to change this behaviour?
You can use the environment variable GCOV_PREFIX
. It's mentionned in the doc under a "cross-profiling" section, which itself is referred to in the documentation for -fprofile-arcs
.