Bug 87972 - remove -f*-prefix-map= options from Ada Library Information files
Summary: remove -f*-prefix-map= options from Ada Library Information files
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 8.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2018-11-11 15:01 UTC by Nicolas Boulenguez
Modified: 2020-04-12 00:01 UTC (History)
0 users

See Also:
Known to work:
Known to fail:
Last reconfirmed:

skip -f*-prefix-map options when writing .ali files (534 bytes, patch)
2018-11-11 15:01 UTC, Nicolas Boulenguez
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Boulenguez 2018-11-11 15:01:06 UTC
Created attachment 44984 [details]
skip -f*-prefix-map options when writing .ali files

The -f(file|debug|macro)-prefix-map=OLD=NEW options added by revision 256847 explicitly ask that OLD is never written.
Comment 1 Nicolas Boulenguez 2020-04-12 00:01:30 UTC
This patch does not fix the initial problem.

Imagine a compilation driven by gnatmake with
gnatmake main.adb -cargs -fdebug-prefix-map=OLD=NEW

During the compilation phase:
gcc -c -fdebug-prefix-map=OLD=NEW main.adb
* does not write the path to .o   (because of the option)
* does not write the path to .ali (because of the patch)
This is good. However, during the link phase, the source generated by the linker (b~main.adb) is compiled by gnatlink. The flags are taken from main.ali, they do not contain -fdebug-prefix-map anymore.
So the path appears in b~main.o then the executable, which is exactly what we want to avoid.

The problem is more general, see

Sorry for the noise.