[PATCH] Propagate -ffile-prefix-map from CFLAGS to ASFLAGS.

Khem Raj raj.khem@gmail.com
Fri Apr 30 19:22:39 GMT 2021


On Fri, Apr 30, 2021 at 12:08 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Fri, Apr 30, 2021 at 11:28 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > -ffile-prefix-map could be used as superset to imply -fdebug-prefix-map
> > as well, therefore it should be propagated too, so cases when
> > -ffile-prefix-map is used but -fdebug-prefix-map is not, then it should
> > still rewire the paths in debug info
>
> hmm noticed that when I remove -fdebug-prefix-map then
> -ffile-prefix-map did not work and its because GCC is not
> translating -ffile-prefix-map to equivalent assembler option
> --debug-prefix-map like it does for -fdebug-prefix-map
> it seems a bug in GCC driver.

infact there already is a bug for gcc driver for this

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


>
> > ---
> >  Makeconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Makeconfig b/Makeconfig
> > index 01f8638c2e..5a675e20e3 100644
> > --- a/Makeconfig
> > +++ b/Makeconfig
> > @@ -1067,7 +1067,7 @@ endif
> >
> >  # The assembler can generate debug information too.
> >  ifndef ASFLAGS
> > -ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
> > +ASFLAGS := $(filter -g% -ffile-prefix-map=% -fdebug-prefix-map=%,$(CFLAGS))
> >  endif
> >  override ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
> >
> > --
> > 2.31.1
> >


More information about the Libc-alpha mailing list