https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97193
Bug ID: 97193 Summary: .gcno files are not written to same directory as the object file Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: mario at klebsch dot de CC: marxin at gcc dot gnu.org Target Milestone: --- According to https://gcc.gnu.org/onlinedocs/gcc/Gcov-Data-Files.html, the .gcno files should be written to the same directory as the object files. > The .gcno files are placed in the same directory as the object file. This seems to work with gcc 8.3.0 but does not work with gcc 9.3.0: + echo Toolchain 1 Toolchain 1 + find . -name '*.gcno' -exec rm '{}' + + find . -name '*.o' -exec rm '{}' + + find . -name '*.gcno' -o -name '*.o' + toolchain1/bin/powerpc-603e-linux-gnu-gcc --version powerpc-603e-linux-gnu-gcc (GCC) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + toolchain1/bin/powerpc-603e-linux-gnu-gcc -fprofile-arcs -ftest-coverage -fprofile-dir=/tmp/coverage -c foo.c -o build/foo.o + find . -name '*.gcno' -o -name '*.o' ./build/foo.o ./build/foo.gcno ^^^^^ same directory as expected + echo Toolchain 2 Toolchain 2 + find . -name '*.gcno' -exec rm '{}' + + find . -name '*.o' -exec rm '{}' + + find . -name '*.gcno' -o -name '*.o' + toolchain2/bin/powerpc-603e-linux-gnu-gcc --version powerpc-603e-linux-gnu-gcc (GCC) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + toolchain2/bin/powerpc-603e-linux-gnu-gcc -fprofile-arcs -ftest-coverage -fprofile-dir=/tmp/coverage -c foo.c -o build/foo.o + find . -name '*.gcno' -o -name '*.o' ./#tmp#gcc-bug#build#foo.gcno ./build/foo.o ^^^^^^^ Different directories, not as excpected. :-( + echo Natove compiler Natove compiler + find . -name '*.gcno' -exec rm '{}' + + find . -name '*.o' -exec rm '{}' + + find . -name '*.gcno' -o -name '*.o' + gcc --version gcc (Gentoo 9.3.0-r1 p3) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + gcc -fprofile-arcs -ftest-coverage -fprofile-dir=/tmp/coverage -c foo.c -o build/foo.o + find . -name '*.gcno' -o -name '*.o' ./#tmp#gcc-bug#build#foo.gcno ./build/foo.o ^^^^^^^ Different directories, not as excpected. :-(