Created attachment 31203 [details] testcase hi, i'm trying to use -fdebug-prefix-map to reuse (ccache) compilation units across multiple software branches. the first problem was reported as PR58767 and the second one is here. the gcc hardcodes DW_AT_comp_dir when -fdebug-prefix-map is in use and prevents ccache from computing identical checksum/manifest. imo -fdebug-prefix-map should adjust DW_AT_comp_dir in the same way as source name (DW_AT_name). $ ./bug.sh + rm -f '*.o' + CXXFLAGS='-Wall -gno-record-gcc-switches -g2 -gdwarf-4 -c' + cd repo/branch + readlink -m t.cpp + src=/home/users/pawels/bugs/gcc-bug/repo/branch/t.cpp + dirname /home/users/pawels/bugs/gcc-bug/repo/branch/t.cpp + g++ -Wall -gno-record-gcc-switches -g2 -gdwarf-4 -c /home/users/pawels/bugs/gcc-bug/repo/branch/t.cpp '-fdebug-prefix-map=/home/users/pawels/bugs/gcc-bug/repo/branch/=' + objdump -g t.o + grep -E DW_AT_name.+cpp <11> DW_AT_name : (indirect string, offset: 0x0): t.cpp + objdump -g t.o + grep -E DW_AT_comp_dir.+string <15> DW_AT_comp_dir : (indirect string, offset: 0x14c): /home/users/pawels/bugs/gcc-bug/repo/branch + cd ../..
my fault, the trailing slash in -fdebug-prefix-map was a problem.