use target path to replace build ones in debugging info
v4 cover use target path to replace build ones in debugging info
Changed in V4:
*) Discuss with upstream maintainer, backport from GCC 6 to ignore
'-fdebug-prefix-map' in producer string rather than add a new option. (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69821)
*) Also backport to gcc 4.9
Changed in V3:
*) Move entry from base.bbclass to bitbake.conf
//Hongxu
The following changes since commit da13f0bce5d1b3c52f5716ae8d104372a820e5f9:
buildhistory.bbclass: remove out-dated information on request (2016-02-15 17:47:08 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib hongxu/fix-buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=hongxu/fix-buildpath
Hongxu Jia (2):
gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string bitbake.conf: use target path as compile dir in debugging info
meta/conf/bitbake.conf | 8 +++++- meta/recipes-devtools/gcc/gcc-4.9.inc | 1 + ...ug-prefix-map-in-producer-string-by-Danie.patch | 31 ++++++++++++++++++++++ meta/recipes-devtools/gcc/gcc-5.3.inc | 1 + ...ug-prefix-map-in-producer-string-by-Danie.patch | 31 ++++++++++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
Signature · 1 line
1.9.1
PATCH v4 1/2 gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string
Backport from upstream master. The discussion detail:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69821
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
...
[YOCTO #7058]
--- meta/recipes-devtools/gcc/gcc-4.9.inc | 1 + ...ug-prefix-map-in-producer-string-by-Danie.patch | 31 ++++++++++++++++++++++ meta/recipes-devtools/gcc/gcc-5.3.inc | 1 + ...ug-prefix-map-in-producer-string-by-Danie.patch | 31 ++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
meta/recipes-devtools/gcc/gcc-4.9.inc +1 -0
@@ -86,6 +86,7 @@ SRC_URI = "\ file://0068-musl-dynamic-linker.patch \ file://0069-musl-no-fixincludes.patch \ file://0070-libstdc-musl.patch \ + file://0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \ " SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327" SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 32593b38082ea65f4c82159254adf1e0dc2423be Mon Sep 17 00:00:00 2001 +From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Tue, 16 Feb 2016 03:15:15 -0500 +Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn + Gillmor) + +* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231835 138bc75d-0d04-0410-961f-82ee72b054a4 + +Upstream-Status: Backport +Signed-off-by: Hongxu Jia <[email protected]> +--- + gcc/dwarf2out.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c +index 3614c10..526f114 100644 +--- a/gcc/dwarf2out.c ++++ b/gcc/dwarf2out.c +@@ -19670,6 +19670,7 @@ gen_producer_string (void) + case OPT_fpreprocessed: + case OPT_fltrans_output_list_: + case OPT_fresolution_: ++ case OPT_fdebug_prefix_map_: + /* Ignore these. */ + continue; + default: +-- +1.9.1 +
meta/recipes-devtools/gcc/gcc-5.3.inc +1 -0
@@ -80,6 +80,7 @@ SRC_URI = "\ file://0048-ssp_nonshared.patch \ file://0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch \ file://0050-powerpc-pass-secure-plt-to-the-linker.patch \ + file://0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \ " BACKPORTS = ""
meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 32593b38082ea65f4c82159254adf1e0dc2423be Mon Sep 17 00:00:00 2001 +From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Tue, 16 Feb 2016 03:15:15 -0500 +Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn + Gillmor) + +* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231835 138bc75d-0d04-0410-961f-82ee72b054a4 + +Upstream-Status: Backport +Signed-off-by: Hongxu Jia <[email protected]> +--- + gcc/dwarf2out.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c +index 3614c10..526f114 100644 +--- a/gcc/dwarf2out.c ++++ b/gcc/dwarf2out.c +@@ -19670,6 +19670,7 @@ gen_producer_string (void) + case OPT_fpreprocessed: + case OPT_fltrans_output_list_: + case OPT_fresolution_: ++ case OPT_fdebug_prefix_map_: + /* Ignore these. */ + continue; + default: +-- +1.9.1 +
Signature · 1 line
1.9.1
PATCH v4 2/2 bitbake.conf: use target path as compile dir in debugging info
In reply to Hongxu JiaIn debugging information, it uses target paths rather than build ones as compile dir.
...
-fdebug-prefix-map=old=new
When compiling files in directory old, record debugging information describing them as in new instead.
...
Compile without this fix:
objdump -g git/test.o
...
The Directory Table (offset 0x1b):
| 1 /buildarea/raid0/hjia/build-20160119-yocto-buildpath/tmp/sysroots/x86_64-linux/usr/lib/
i686-pokymllib32-linux.lib32-gcc-cross-initial-i686/gcc/i686-pokymllib32-linux/5.3.0/include
| 2 /buildarea/raid0/hjia/build-20160119-yocto-buildpath/tmp/sysroots/lib32-qemux86-64/usr/include/bits | 3 /buildarea/raid0/hjia/build-20160119-yocto-buildpath/tmp/sysroots/lib32-qemux86-64/usr/include
...
Compile with this fix:
objdump -g git/test.o
...
The Directory Table (offset 0x1b):
| 1 /usr/lib/i686-pokymllib32-linux.lib32-gcc-cross-initial-i686/gcc/i686-pokymllib32-linux/
5.3.0/include
| 2 /usr/include/bits | 3 /usr/include
...
[YOCTO #7058]
--- meta/conf/bitbake.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/conf/bitbake.conf +7 -1
@@ -544,7 +544,13 @@ EXTRA_OEMAKE_prepend_task-install = "${PARALLEL_MAKEINST} " ################################################################## # Optimization flags. ################################################################## -DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types" +DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types \ + -fdebug-prefix-map=${B}=/usr/src/${BPN} \ + -fdebug-prefix-map=${S}=/usr/src/${BPN} \ + -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ + -fdebug-prefix-map=${STAGING_DIR_HOST}= \ +" + # Disabled until the option works properly -feliminate-dwarf2-dups FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}" DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
Signature · 1 line
1.9.1
Quoted 6 lines · Hongxu Jia
Changed in V4:
*) Discuss with upstream maintainer, backport from GCC 6 to ignore
'-fdebug-prefix-map' in producer string rather than add a new option. (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69821)
*) Also backport to gcc 4.9
This looks ok now.
Quoted 30 lines
Changed in V3:
*) Move entry from base.bbclass to bitbake.conf//Hongxu
The following changes since commit
da13f0bce5d1b3c52f5716ae8d104372a820e5f9:buildhistory.bbclass: remove out-dated information on request (2016-02-15 17:47:08 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contribhongxu/fix-buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=hongxu/fix-buildpathHongxu Jia (2):
gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string bitbake.conf: use target path as compile dir in debugging infometa/conf/bitbake.conf | 8 +++++- meta/recipes-devtools/gcc/gcc-4.9.inc | 1 + ...ug-prefix-map-in-producer-string-by-Danie.patch | 31 ++++++++++++++++++++++ meta/recipes-devtools/gcc/gcc-5.3.inc | 1 + ...ug-prefix-map-in-producer-string-by-Danie.patch | 31 ++++++++++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch--
1.9.1