https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93401

--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This only work because the directory does not change from build time to train
time. The paths are not relative instead absolute path is put into every .o
file at compile time.

jan@skylake:~> gcc -fprofile-generate t.c -c | strings t.o | grep gcda
/home/jan/t.gcda

now the compile time path is typically something like
/home/<joe the user>/programming/<my project>/build

while at runtime it is uploaded to different machine where /home/<joe the user>
does not exist.

I guess one can count the number of components in the path at build time, write
it into the package and then setup

GCOV_PREFIX_STRIP=5
GCOV_PREFIX=/home/runbot/profile-data

and then tar things around and untar into the build directory prior building.
But this does not seem very pretty either, especially the step of counting
components and passing it to the runtime environment.

Reply via email to