[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1025948: gcc: provide --debug-prefix-map for gnu as with -ffile-prefix-map



Source: gcc-12
Version: 12.2.0-10

Please backport changes mentioned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93371 in order to improve
overall build reproducibility.

I've been hit by this issue in
https://salsa.debian.org/mingw-w64-team/mingw-w64/-/merge_requests/3/diffs?commit_id=9bd67866e243e361c56daad2e8456e0f1ede1240

Test case:

Let's consider having file "empty.S" with following contents:
// -- cut --
.text
ret
// -- cut --

$ gcc -c -o empty.S.o empty.S -O2 -g && strings -f empty.S.o | grep -F
${PWD} && echo NOT OK || echo OK
empty.S.o: /home/krd/gcc-prefix-case
empty.S.o: /home/krd/gcc-prefix-case
NOT OK

$ gcc -c -o empty.S.o empty.S -O2 -g -fdebug-prefix-map=${PWD}=. &&
strings -f empty.S.o | grep -F ${PWD} && echo NOT OK || echo OK
OK

$ gcc -c -o empty.S.o empty.S -O2 -g -ffile-prefix-map=${PWD}=. &&
strings -f empty.S.o | grep -F ${PWD} && echo NOT OK || echo OK
empty.S.o: /home/krd/gcc-prefix-case
empty.S.o: /home/krd/gcc-prefix-case
NOT OK

$ gcc -c -o empty.S.o empty.S -O2 -g -ffile-prefix-map=${PWD}=.
-Wa,--debug-prefix-map,${PWD}=. && strings -f empty.S.o | grep -F
${PWD} && echo NOT OK || echo OK
OK

--
SY,
Konstantin Demin


Reply to: