Hi all, I come from OpenEmbedded community (https://www.yoctoproject.org/), thanks the powerful gcc, it helps us to do lots of compiling staff. While cross compilation, we add '-g' to record debugging info, and lots of build path existed in debugging info. We do not want to expose the build path to others. So add '-fdebug-prefix-map=old=new' to replace the build path with target path. But the option '-fdebug-prefix-map=old=new' itself which included build path still exists in gcc command line switches in DWARF DW_AT_producer. I know we could use '-gno-record-gcc-switches' to not record all gcc command line switches in DWARF DW_AT_producer. But we would like to keep the others and only remove '-fdebug-prefix-map=old=new'. So I suggested to add a new option '-gno-record-debug-prefix-map' which don't record '-fdebug-prefix-map' in gcc command line switches in DWARF DW_AT_producer. Thanks Hongxu
Created attachment 37691 [details] add option Compile without this fix: objdump -g packages-split/lib32-glibc-dev/usr/lib/gcrt1.o ... | <5f> DW_AT_producer : (indirect string, offset: 0x1b): GNU C99 5.3.0 -m32-march=core2 -mtune=core2 -msse3 -mfpmath=sse -mpreferred-stack-boundary=4 -g -O2 -std=gnu99 -fgnu89-inline -fdebug-prefix-map=/buildarea/raid0/hjia/buil d-20160127-yocto-buildpath-2/tmp/sysroots/lib32-qemux86-64= -feliminate-unused-debug-types -fmerge-all-constants -frounding-math -ftls-model=initial-exec ... Compile with this fix: objdump -g packages-split/lib32-glibc-dev/usr/lib/gcrt1.o ... | <5f> DW_AT_producer : (indirect string, offset: 0xa1): GNU C99 5.3.0 -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mpreferred-stack-boundary=4 -g -O2 -std=gnu99 -fgnu89-inline -feliminate-unused-debug-types -fmerge-all-constants -frounding-math -ftls-model=initial-exec ...
Patches should be sent to gcc-patches@.
(In reply to Andrew Pinski from comment #2) > Patches should be sent to gcc-patches@. Got it //Hongxu
I think it makes sense to omit this by default. In fact it is already in GCC 6. case OPT_fdebug_prefix_map_: /* Ignore these. */
Indeed. This has been fixed with r231835.
Should we backport this to 5?
It is not a regression and is user visible change, so I think changing it just in GCC 6 is sufficient.
(In reply to Jakub Jelinek from comment #7) > It is not a regression and is user visible change, so I think changing it > just in GCC 6 is sufficient. Got it, thanks for pointing it out. I will backport to our Yocto. //Hongxu