Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V4 0/2] use target path to replace build ones in debugging info
@ 2016-02-16  9:14 Hongxu Jia
  2016-02-16  9:14 ` [PATCH 1/2] gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string Hongxu Jia
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hongxu Jia @ 2016-02-16  9:14 UTC (permalink / raw)
  To: openembedded-core, liezhi.yang, raj.khem, richard.purdie

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

-- 
1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string
  2016-02-16  9:14 [PATCH V4 0/2] use target path to replace build ones in debugging info Hongxu Jia
@ 2016-02-16  9:14 ` Hongxu Jia
  2016-02-16  9:14 ` [PATCH 2/2] bitbake.conf: use target path as compile dir in debugging info Hongxu Jia
  2016-02-16 16:48 ` [PATCH V4 0/2] use target path to replace build ones " Khem Raj
  2 siblings, 0 replies; 4+ messages in thread
From: Hongxu Jia @ 2016-02-16  9:14 UTC (permalink / raw)
  To: openembedded-core, liezhi.yang, raj.khem, richard.purdie

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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 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

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 736c956..6412490 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -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"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch b/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
new file mode 100644
index 0000000..e8f79b5
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
@@ -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 <hongxu.jia@windriver.com>
+---
+ 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
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
index 214af10..a653e5c 100644
--- a/meta/recipes-devtools/gcc/gcc-5.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -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 = ""
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch b/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
new file mode 100644
index 0000000..e8f79b5
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
@@ -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 <hongxu.jia@windriver.com>
+---
+ 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
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] bitbake.conf: use target path as compile dir in debugging info
  2016-02-16  9:14 [PATCH V4 0/2] use target path to replace build ones in debugging info Hongxu Jia
  2016-02-16  9:14 ` [PATCH 1/2] gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string Hongxu Jia
@ 2016-02-16  9:14 ` Hongxu Jia
  2016-02-16 16:48 ` [PATCH V4 0/2] use target path to replace build ones " Khem Raj
  2 siblings, 0 replies; 4+ messages in thread
From: Hongxu Jia @ 2016-02-16  9:14 UTC (permalink / raw)
  To: openembedded-core, liezhi.yang, raj.khem, richard.purdie

In 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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/conf/bitbake.conf | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a75bb8b..631b759 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -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"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V4 0/2] use target path to replace build ones in debugging info
  2016-02-16  9:14 [PATCH V4 0/2] use target path to replace build ones in debugging info Hongxu Jia
  2016-02-16  9:14 ` [PATCH 1/2] gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string Hongxu Jia
  2016-02-16  9:14 ` [PATCH 2/2] bitbake.conf: use target path as compile dir in debugging info Hongxu Jia
@ 2016-02-16 16:48 ` Khem Raj
  2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2016-02-16 16:48 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: Patches and discussions about the oe-core layer

On Tue, Feb 16, 2016 at 1:14 AM, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> 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.


> 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
>
> --
> 1.9.1
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-16 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16  9:14 [PATCH V4 0/2] use target path to replace build ones in debugging info Hongxu Jia
2016-02-16  9:14 ` [PATCH 1/2] gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string Hongxu Jia
2016-02-16  9:14 ` [PATCH 2/2] bitbake.conf: use target path as compile dir in debugging info Hongxu Jia
2016-02-16 16:48 ` [PATCH V4 0/2] use target path to replace build ones " Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox