Skip to contentSkip to conversation

use target path to replace build ones in debugging info

PATCH Superseded Hongxu Jia 6 participants 22 messages Jan 29, 2016 – Feb 22, 2016

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

v3 cover use target path to replace build ones in debugging info

Changed in V3:
- Move entry from base.bbclass to bitbake.conf
- Do not immediate expand SELECTED_OPTIMIZATION

Changed in V2:
- Do not use '-gno-record-gcc-switches' to leave gcc switches in;

- Add gcc option '-gno-record-debug-prefix-map' to not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer;

Test Steps:

vim local.conf
...
MACHINE ?= "qemux86-64"
WARN_QA += "buildpaths"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "core2-32"
...

bitbake -k world

It fixed buildpath QA warning of 169 recipes (previously 236, currently 67) These newly added options does not work on native.(Which TARGET_CFLAGS have been overrided in native.bbclass)

When do the world build, mkelfimage compile failed which triggered by the newly added gcc option.

//Hongxu

The following changes since commit 3d2c0f5902cacf9d8544bf263b51ef0dd1a7218c:

cmake: update to 3.4.2 (2016-01-26 22:49:40 +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 (5):
base/bbclass: use target path as compile dir in debugging info gcc-5.3.inc/base.bbclass: add gcc option to not record
-fdebug-prefix-map to debugging info
mkelfimage: fix target cflags leaks to host glibc.inc: do not immediate expand SELECTED_OPTIMIZATION systemtap_git.inc: do not immediate expand SELECTED_OPTIMIZATION

 meta/conf/bitbake.conf                             | 10 +++-
 meta/recipes-core/glibc/glibc.inc                  | 22 +++-----
 meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
 ...48-add-option-gno-record-debug-prefix-map.patch | 65 ++++++++++++++++++++++
 meta/recipes-devtools/mkelfimage/mkelfimage_git.bb |  4 +-
 meta/recipes-kernel/systemtap/systemtap_git.inc    | 12 ++--
 6 files changed, 91 insertions(+), 25 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v3 1/5 base/bbclass: use target path as compile dir in debugging info

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]

---
 meta/conf/bitbake.conf | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/conf/bitbake.conf +8 -1
index e80ee18..bebaaf4 100644
@@ -546,7 +546,14 @@ 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
#2 lore raw

Re: [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info

Quoted 9 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Hongxu Jia
Sent: den 29 januari 2016 18:36
To: [email protected];
[email protected]; [email protected]; [email protected]
Subject: [OE-core] [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info

                                 ^^^^^^^^^^^^

Change the prefix to "bitbake.conf" to reflect that you now do the Change there...

//Peter

author
#3 lore raw

Re: [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info

Quoted 9 lines · Peter Kjellerstedt
Quoted 9 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Hongxu Jia
Sent: den 29 januari 2016 18:36
To: [email protected];
[email protected]; [email protected]; [email protected]
Subject: [OE-core] [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info

Quoted 3 lines
                                  ^^^^^^^^^^^^

Change the prefix to "bitbake.conf" to reflect that you now do the Change there...

Sorry for the typo

//Hongxu

Quoted 3 lines

//Peter

author
#4 lore raw

PATCH v3 2/5 gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

In reply to Hongxu Jia

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix-map' for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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/conf/bitbake.conf                             |  1 +
 meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
 ...48-add-option-gno-record-debug-prefix-map.patch | 65 ++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
     -fdebug-prefix-map=${S}=/usr/src/${BPN} \
     -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
     -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
 "
 
 # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
index 80999c1..3a36e50 100644
@@ -76,7 +76,8 @@ SRC_URI = "\
            file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
            file://0045-Support-for-arm-linux-musl.patch \
            file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
           "
 
 BACKPORTS = ""
meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
1.9.1
#5 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Wouldn't it be better to swap the first and second commit and then move the addition of -gno-record-debug-prefix-map to the other commit where -fdebug-prefix-map are added.

You must also remember that not all use the compiler provided by OE-Core, so adding -gno-record-debug-prefix-map unconditionally to DEBUG_CFLAGS will break with unpatched compilers... (This also indicates that "Upstream-Status: Inappropriate [oe specific]" may not be quite right if you want this to be supported by other compiler versions).

//Peter

Quoted 173 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hongxu Jia
Sent: den 29 januari 2016 18:36
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [OE-core] [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix- map'
for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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=

(quoted diff) +0 -2
-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/conf/bitbake.conf                             |  1 +
 meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
 ...48-add-option-gno-record-debug-prefix-map.patch | 65
++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-

gno-record-debug-prefix-map.patch

meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
     -fdebug-prefix-map=${S}=/usr/src/${BPN} \
     -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
     -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
 "
 
 # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes- renamed from meta/recipes-devtools/gcc/gcc-5.3.inc +0 -0

devtools/gcc/gcc-5.3.inc
index 80999c1..3a36e50 100644

meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
@@ -76,7 +76,8 @@ SRC_URI = "\
            file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-
 necess.patch \
            file://0045-Support-for-arm-linux-musl.patch \
            file://0046-Get-rid-of-ever-broken-fixincludes-on-
 musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
           "

BACKPORTS = ""

(quoted diff) +0 -0

record-debug-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-5.3/0048- add-option-gno-record-debug-prefix-map.patch
new file mode 100644
index 0000000..e1efaeb

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +0 -0

debug-prefix-map.patch

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +28 -0
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF

DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1) ++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +24 -0
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push

(save_decoded_options[j].orig_option_with_args_text);

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +1 -0
+ 	len += strlen

(save_decoded_options[j].orig_option_with_args_text) + 1;

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +4 -1
+ 	break;
+--
+1.9.1
+
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#6 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 3 lines · Peter Kjellerstedt

Wouldn't it be better to swap the first and second commit and then move the addition of -gno-record-debug-prefix-map to the other commit where -fdebug-prefix-map are added.

OK

Quoted 7 lines

You must also remember that not all use the compiler provided by OE-Core, so adding -gno-record-debug-prefix-map unconditionally to DEBUG_CFLAGS will break with unpatched compilers... (This also indicates that "Upstream-Status: Inappropriate [oe specific]" may not be quite right if you want this to be supported by other compiler versions).

Agree, we should conditionally add -gno-record-debug-prefix-map to support other compiler. Thank you for pointing it out.

//Hongxu

Quoted 175 lines

//Peter

Quoted 173 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hongxu Jia
Sent: den 29 januari 2016 18:36
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [OE-core] [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix- map'
for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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=

(quoted diff) +0 -2
-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/conf/bitbake.conf                             |  1 +
  meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
  ...48-add-option-gno-record-debug-prefix-map.patch | 65
++++++++++++++++++++++
  3 files changed, 68 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-
gno-record-debug-prefix-map.patch

meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
      -fdebug-prefix-map=${S}=/usr/src/${BPN} \
      -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
      -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
  "
 
  # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes- renamed from meta/recipes-devtools/gcc/gcc-5.3.inc +0 -0

devtools/gcc/gcc-5.3.inc
index 80999c1..3a36e50 100644

meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
@@ -76,7 +76,8 @@ SRC_URI = "\
             file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-
 necess.patch \
             file://0045-Support-for-arm-linux-musl.patch \
             file://0046-Get-rid-of-ever-broken-fixincludes-on-
 musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
            "

BACKPORTS = ""

(quoted diff) +0 -0

record-debug-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-5.3/0048- add-option-gno-record-debug-prefix-map.patch
new file mode 100644
index 0000000..e1efaeb

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +0 -0

debug-prefix-map.patch

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +28 -0
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF

DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1) ++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +24 -0
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push

(save_decoded_options[j].orig_option_with_args_text);

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +1 -0
+ 	len += strlen

(save_decoded_options[j].orig_option_with_args_text) + 1;

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +4 -1
+ 	break;
+--
+1.9.1
+
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#7 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 18 lines · Hongxu Jia
Quoted 3 lines · Peter Kjellerstedt

Wouldn't it be better to swap the first and second commit and then move the addition of -gno-record-debug-prefix-map to the other commit where -fdebug-prefix-map are added.

OK

Quoted 7 lines

You must also remember that not all use the compiler provided by OE-Core, so adding -gno-record-debug-prefix-map unconditionally to DEBUG_CFLAGS will break with unpatched compilers... (This also indicates that "Upstream-Status: Inappropriate [oe specific]" may not be quite right if you want this to be supported by other compiler versions).

Quoted 2 lines

Agree, we should conditionally add -gno-record-debug-prefix-map to support other compiler. Thank you for pointing it out.

its not only non gcc compilers, we also have gcc 4.9 still.

Quoted 179 lines

//Hongxu

Quoted 175 lines

//Peter

Quoted 173 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hongxu Jia
Sent: den 29 januari 2016 18:36
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [OE-core] [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix- map'
for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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=

(quoted diff) +0 -2
-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/conf/bitbake.conf                             |  1 +
 meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
 ...48-add-option-gno-record-debug-prefix-map.patch | 65
++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-

gno-record-debug-prefix-map.patch

meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
     -fdebug-prefix-map=${S}=/usr/src/${BPN} \
     -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
     -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
 "
 
 # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes- renamed from meta/recipes-devtools/gcc/gcc-5.3.inc +0 -0

devtools/gcc/gcc-5.3.inc
index 80999c1..3a36e50 100644

meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
@@ -76,7 +76,8 @@ SRC_URI = "\
            file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-
 necess.patch \
            file://0045-Support-for-arm-linux-musl.patch \
            file://0046-Get-rid-of-ever-broken-fixincludes-on-
 musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
           "

BACKPORTS = ""

(quoted diff) +0 -0

record-debug-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-5.3/0048- add-option-gno-record-debug-prefix-map.patch
new file mode 100644
index 0000000..e1efaeb

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +0 -0

debug-prefix-map.patch

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +28 -0
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF

DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1) ++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +24 -0
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push

(save_decoded_options[j].orig_option_with_args_text);

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +1 -0
+ 	len += strlen

(save_decoded_options[j].orig_option_with_args_text) + 1;

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record- new file +4 -1
+ 	break;
+--
+1.9.1
+
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#8 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 21 lines · Khem Raj
Quoted 21 lines

On Jan 29, 2016, at 5:25 PM, Hongxu Jia <[email protected]> wrote:

Quoted 5 lines · Peter Kjellerstedt

Wouldn't it be better to swap the first and second commit and then
move the addition of -gno-record-debug-prefix-map to the other commit
where -fdebug-prefix-map are added.

OK

Quoted 8 lines

You must also remember that not all use the compiler provided by OE-Core, so adding -gno-record-debug-prefix-map unconditionally to
DEBUG_CFLAGS will break with unpatched compilers... (This also indicates that "Upstream-Status: Inappropriate [oe specific]" may not be quite right if you want this to be supported by other compiler versions).

Quoted 4 lines
Quoted 2 lines

Agree, we should conditionally add -gno-record-debug-prefix-map to support other compiler. Thank you for pointing it out.

its not only non gcc compilers, we also have gcc 4.9 still.

I think we do likely need to patch 4.9. For other compilers than that, or other compilers, I'd suggest that people can either define a set of DEBUG_CFLAGS, or set:

DEBUG_CFLAGS_remove = "-gno-record-debug-prefix-map"

to avoid problems. I'm not sure making it conditional in some way is any better than just using the above line.

Cheers,

Richard

author
#9 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 22 lines · Richard Purdie
Quoted 18 lines · Khem Raj
Quoted 18 lines

On Jan 29, 2016, at 5:25 PM, Hongxu Jia <[email protected]> wrote:

Quoted 5 lines · Peter Kjellerstedt

Wouldn't it be better to swap the first and second commit and then
move the addition of -gno-record-debug-prefix-map to the other commit
where -fdebug-prefix-map are added.

OK

Quoted 7 lines

You must also remember that not all use the compiler provided by OE-Core, so adding -gno-record-debug-prefix-map unconditionally to
DEBUG_CFLAGS will break with unpatched compilers... (This also indicates that "Upstream-Status: Inappropriate [oe specific]" may not be quite right if you want this to be supported by other compiler versions).

Quoted 3 lines
Quoted 2 lines

Agree, we should conditionally add -gno-record-debug-prefix-map to support other compiler. Thank you for pointing it out.

its not only non gcc compilers, we also have gcc 4.9 still.

Quoted 8 lines

I think we do likely need to patch 4.9. For other compilers than that, or other compilers, I'd suggest that people can either define a set of DEBUG_CFLAGS, or set:

DEBUG_CFLAGS_remove = "-gno-record-debug-prefix-map"

to avoid problems. I'm not sure making it conditional in some way is any better than just using the above line.

Got it, I will do it in V4.

//Hongxu

Quoted 3 lines

Cheers,

Richard

#10 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 36 lines · Hongxu Jia
Quoted 35 lines · Richard Purdie
Quoted 24 lines · Khem Raj
Quoted 24 lines

On Jan 29, 2016, at 5:25 PM, Hongxu Jia <
[email protected]>
wrote:

Quoted 6 lines · Peter Kjellerstedt

Wouldn't it be better to swap the first and second commit and then
move the addition of -gno-record-debug-prefix-map to the other
commit
where -fdebug-prefix-map are added.

OK

Quoted 11 lines

You must also remember that not all use the compiler provided by
OE-Core, so adding -gno-record-debug-prefix-map unconditionally
to
DEBUG_CFLAGS will break with unpatched compilers... (This also
indicates that "Upstream-Status: Inappropriate [oe specific]" may
not be quite right if you want this to be supported by other compiler versions).

Quoted 4 lines
Quoted 3 lines

Agree, we should conditionally add -gno-record-debug-prefix-map to
support other compiler. Thank you for pointing it out.

its not only non gcc compilers, we also have gcc 4.9 still.

I think we do likely need to patch 4.9. For other compilers than that,
or other compilers, I'd suggest that people can either define a set of
DEBUG_CFLAGS, or set:

Quoted 7 lines
Quoted 5 lines

DEBUG_CFLAGS_remove = "-gno-record-debug-prefix-map"

to avoid problems. I'm not sure making it conditional in some way is
any better than just using the above line.

Got it, I will do it in V4.

I think we should try and see if the the gcc patch would be accepted upstream. Meanwhile, if we default to turning this on in our compilers, much of this issue goes away as Phil mentions.

Cheers,

Richard

#11 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 39 lines · Richard Purdie
Quoted 38 lines · Hongxu Jia
Quoted 37 lines · Richard Purdie
Quoted 24 lines · Khem Raj
Quoted 24 lines

On Jan 29, 2016, at 5:25 PM, Hongxu Jia <
[email protected]>
wrote:

Quoted 6 lines · Peter Kjellerstedt

Wouldn't it be better to swap the first and second commit and then
move the addition of -gno-record-debug-prefix-map to the other
commit
where -fdebug-prefix-map are added.

OK

Quoted 11 lines

You must also remember that not all use the compiler provided by
OE-Core, so adding -gno-record-debug-prefix-map unconditionally
to
DEBUG_CFLAGS will break with unpatched compilers... (This also
indicates that "Upstream-Status: Inappropriate [oe specific]" may
not be quite right if you want this to be supported by other compiler versions).

Quoted 4 lines
Quoted 3 lines

Agree, we should conditionally add -gno-record-debug-prefix-map to
support other compiler. Thank you for pointing it out.

its not only non gcc compilers, we also have gcc 4.9 still.

I think we do likely need to patch 4.9. For other compilers than that,
or other compilers, I'd suggest that people can either define a set of
DEBUG_CFLAGS, or set:

DEBUG_CFLAGS_remove = "-gno-record-debug-prefix-map"

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

to avoid problems. I'm not sure making it conditional in some way is
any better than just using the above line.

Got it, I will do it in V4.

I think we should try and see if the the gcc patch would be accepted upstream.

yes they are fine as such should be sent upstream. but please open a gcc bugzilla entry
to track it

Meanwhile, if we default to turning this on in our compilers,

Quoted 8 lines

much of this issue goes away as Phil mentions.

Cheers,

Richard

author
#12 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

In reply to Richard Purdie
Quoted 4 lines · Richard Purdie
Quoted 1 line

Got it, I will do it in V4.

I think we should try and see if the the gcc patch would be accepted upstream. Meanwhile, if we default to turning this on in our compilers, much of this issue goes away as Phil mentions.

Got it, I will file a entry on gcc bugzilla and send the patch to upsteam.

Sorry for replying late, because of Chinese new year :)

//Hongxu

Quoted 6 lines

Cheers,

Richard

#13 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

In reply to Hongxu Jia

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch line 10

Quoted 5 lines · Hongxu Jia
meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch new file +5 -0
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]

If you consider this to be oe-specific and inappropriate for upstream, wouldn't it be better to make the new behaviour default to on and not have to add an extra option to the CFLAGS? (You could still provide a switch to restore the old behaviour for those who want it.)

Alternatively, if the new behaviour defaults to off, there doesn't seem any reason that this patch couldn't and shouldn't be sent upstream.

p.

#14 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

In reply to Hongxu Jia
Quoted 3 lines · Hongxu Jia

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix-map' for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

Did you check sstate signatures with these debug-prefix-map changes? It seems to cause everything to be MACHINE specific:

ERROR: libgcc-initial different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
basehash changed from 03ccc547064deba9b8e2e290a6be9480 to 6f7eff2e90f301e995298fee2c47b844
Variable FULL_OPTIMIZATION value changed from '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86=> ' to '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86copy=> ' runtaskdeps changed from ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install'] to ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install']
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 0bdaebf5e23c90af7cea65f28a12c789
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 2d1b031bbd46bc8c7401d37bd1edb7cc
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash b6f705a4bd3535b606e8214c5640933a
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash da4e294376b70f951ca4af508fdc6a60
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash 8473bfa83cba1ee93191182b9fd239d7
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash fcad4f5f4d7da576b7c2add3eb24fcc8
Hash for dependent task gcclibgcc-initial_5.3.bb.do_extra_symlinks changed from 0bdaebf5e23c90af7cea65f28a12c789 to 2d1b031bbd46bc8c7401d37bd1edb7cc
Hash for dependent task gcclibgcc-initial_5.3.bb.do_install changed from b6f705a4bd3535b606e8214c5640933a to da4e294376b70f951ca4af508fdc6a60
Hash for dependent task gcclibgcc-initial_5.3.bb.do_multilib_install changed from 8473bfa83cba1ee93191182b9fd239d7 to fcad4f5f4d7da576b7c2add3eb24fcc8

Regards,

Quoted 139 lines

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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

(quoted diff) +0 -2
-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=

(quoted diff) +0 -2
-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

(quoted diff) +0 -3
-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/conf/bitbake.conf                             |  1 +
 meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
 ...48-add-option-gno-record-debug-prefix-map.patch | 65 ++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
     -fdebug-prefix-map=${S}=/usr/src/${BPN} \
     -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
     -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
 "
 
 # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
index 80999c1..3a36e50 100644
@@ -76,7 +76,8 @@ SRC_URI = "\
            file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
            file://0045-Support-for-arm-linux-musl.patch \
            file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
           "
 
 BACKPORTS = ""
meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch new file +65 -0
new file mode 100644
index 0000000..e1efaeb
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+ 
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1)
++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push (save_decoded_options[j].orig_option_with_args_text);
+ 	len += strlen (save_decoded_options[j].orig_option_with_args_text) + 1;
+ 	break;
+-- 
+1.9.1
+
Signature · 7 lines
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#15 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 8 lines · Martin Jansa
Quoted 3 lines · Hongxu Jia

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix-map' for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

Quoted 7 lines

Did you check sstate signatures with these debug-prefix-map changes? It seems to cause everything to be MACHINE specific:

ERROR: libgcc-initial different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
basehash changed from 03ccc547064deba9b8e2e290a6be9480 to 6f7eff2e90f301e995298fee2c47b844
Variable FULL_OPTIMIZATION value changed from '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86=> ' to '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86copy=> ' runtaskdeps changed from ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install'] to ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install’]

These should be ignored from checksum calculations on the same lines as —sysroot is ignored

Quoted 158 lines

oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 0bdaebf5e23c90af7cea65f28a12c789
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 2d1b031bbd46bc8c7401d37bd1edb7cc oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash b6f705a4bd3535b606e8214c5640933a
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash da4e294376b70f951ca4af508fdc6a60 oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash 8473bfa83cba1ee93191182b9fd239d7 changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash fcad4f5f4d7da576b7c2add3eb24fcc8
Hash for dependent task gcclibgcc-initial_5.3.bb.do_extra_symlinks changed from 0bdaebf5e23c90af7cea65f28a12c789 to 2d1b031bbd46bc8c7401d37bd1edb7cc Hash for dependent task gcclibgcc-initial_5.3.bb.do_install changed from b6f705a4bd3535b606e8214c5640933a to da4e294376b70f951ca4af508fdc6a60 Hash for dependent task gcclibgcc-initial_5.3.bb.do_multilib_install changed from 8473bfa83cba1ee93191182b9fd239d7 to fcad4f5f4d7da576b7c2add3eb24fcc8

Regards,

Quoted 134 lines

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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

(quoted diff) +0 -2
-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=

(quoted diff) +0 -2
-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

(quoted diff) +0 -3
-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/conf/bitbake.conf                             |  1 +
meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
...48-add-option-gno-record-debug-prefix-map.patch | 65 ++++++++++++++++++++++
3 files changed, 68 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch

meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
    -fdebug-prefix-map=${S}=/usr/src/${BPN} \
    -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
    -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \

"

# Disabled until the option works properly -feliminate-dwarf2-dups

meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
index 80999c1..3a36e50 100644
@@ -76,7 +76,8 @@ SRC_URI = "\
           file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
           file://0045-Support-for-arm-linux-musl.patch \
           file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
          "
 

BACKPORTS = ""

meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch new file +65 -1
new file mode 100644
index 0000000..e1efaeb
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1)
++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push (save_decoded_options[j].orig_option_with_args_text);
+ 	len += strlen (save_decoded_options[j].orig_option_with_args_text) + 1;
+ 	break;
+--
+1.9.1
+
--

1.9.1

Quoted 5 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
Martin 'JaMa' Jansa jabber: [email protected]

author
#16 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

In reply to Martin Jansa
Quoted 6 lines · Martin Jansa
Quoted 3 lines · Hongxu Jia

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix-map' for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

Did you check sstate signatures with these debug-prefix-map changes? It seems to cause everything to be MACHINE specific:

Hi Martin,

Could you explain your test details?

From your log, it seems the MACHINE was changed from "qemux86" to "qemux86copy". So I run test 'oe-selftest --run-tests sstatetests.SStateTests.test_sstate_sametune_samesigs' and it is OK.

Here is the merged patch:
...
-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}= \

+"
...

//Hongxu

Quoted 158 lines

ERROR: libgcc-initial different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
basehash changed from 03ccc547064deba9b8e2e290a6be9480 to 6f7eff2e90f301e995298fee2c47b844
Variable FULL_OPTIMIZATION value changed from '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86=> ' to '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86copy=> ' runtaskdeps changed from ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install'] to ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install']
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 0bdaebf5e23c90af7cea65f28a12c789
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 2d1b031bbd46bc8c7401d37bd1edb7cc
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash b6f705a4bd3535b606e8214c5640933a
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash da4e294376b70f951ca4af508fdc6a60
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash 8473bfa83cba1ee93191182b9fd239d7
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash fcad4f5f4d7da576b7c2add3eb24fcc8
Hash for dependent task gcclibgcc-initial_5.3.bb.do_extra_symlinks changed from 0bdaebf5e23c90af7cea65f28a12c789 to 2d1b031bbd46bc8c7401d37bd1edb7cc
Hash for dependent task gcclibgcc-initial_5.3.bb.do_install changed from b6f705a4bd3535b606e8214c5640933a to da4e294376b70f951ca4af508fdc6a60
Hash for dependent task gcclibgcc-initial_5.3.bb.do_multilib_install changed from 8473bfa83cba1ee93191182b9fd239d7 to fcad4f5f4d7da576b7c2add3eb24fcc8

Regards,

Quoted 138 lines

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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

(quoted diff) +0 -2
-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=

(quoted diff) +0 -2
-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

(quoted diff) +0 -3
-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/conf/bitbake.conf                             |  1 +
  meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
  ...48-add-option-gno-record-debug-prefix-map.patch | 65 ++++++++++++++++++++++
  3 files changed, 68 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch

meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
      -fdebug-prefix-map=${S}=/usr/src/${BPN} \
      -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
      -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
  "
 
  # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
index 80999c1..3a36e50 100644
@@ -76,7 +76,8 @@ SRC_URI = "\
             file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
             file://0045-Support-for-arm-linux-musl.patch \
             file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
            "
 
  BACKPORTS = ""
meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch new file +65 -0
new file mode 100644
index 0000000..e1efaeb
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1)
++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push (save_decoded_options[j].orig_option_with_args_text);
+ 	len += strlen (save_decoded_options[j].orig_option_with_args_text) + 1;
+ 	break;
+--
+1.9.1
+
Signature · 7 lines
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
#17 lore raw

Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info

Quoted 8 lines · Hongxu Jia
Quoted 6 lines · Martin Jansa
Quoted 3 lines · Hongxu Jia

Add option '-gno-record-debug-prefix-map' and '-grecord-debug-prefix-map' for gcc. If '-gno-record-debug-prefix-map' is used, it does not record '-fdebug-prefix-map' to gcc command line switches in DWARF DW_AT_producer.

Did you check sstate signatures with these debug-prefix-map changes? It seems to cause everything to be MACHINE specific:

Quoted 6 lines

Hi Martin,

Could you explain your test details?

From your log, it seems the MACHINE was changed from "qemux86" to
"qemux86copy".

I'm using
openembedded-core/scripts/sstate-diff-machines.sh instead of oe-selftest, the same script is used to generate reports like this one:
http://lists.openembedded.org/pipermail/openembedded-core/2015-November/112795.html

But with today's oe-core I cannot reproduce it anymore and these were the only issues reported today:
http://lists.openembedded.org/pipermail/openembedded-devel/2016-February/106104.html

so it was fixed somewhere already, thanks for trying to reproduce it, appreciate it.

Quoted 177 lines

So I run test 'oe-selftest --run-tests sstatetests.SStateTests.test_sstate_sametune_samesigs' and it is OK.

Here is the merged patch:
...

(quoted diff) +6 -1
-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}= \
+"
...

//Hongxu

Quoted 158 lines

ERROR: libgcc-initial different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
basehash changed from 03ccc547064deba9b8e2e290a6be9480 to 6f7eff2e90f301e995298fee2c47b844
Variable FULL_OPTIMIZATION value changed from '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86=> ' to '-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=TOPDIR/work/i586-webos-linux/libgcc-initial/5.3.0-r0/gcc-5.3.0/build.i586-webos-linux.i586-webos-linux=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/work-shared/gcc-5.3.0-r0/gcc-5.3.0=/usr/src/libgcc> -fdebug-prefix-map=TOPDIR/sysroots/x86_64-linux=> -fdebug-prefix-map=TOPDIR/sysroots/qemux86copy=> ' runtaskdeps changed from ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install'] to ['gcclibgcc-initial_5.3.bb.do_extra_symlinks', 'gcclibgcc-initial_5.3.bb.do_install', 'gcclibgcc-initial_5.3.bb.do_multilib_install']
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 0bdaebf5e23c90af7cea65f28a12c789
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_extra_symlinks> with hash 2d1b031bbd46bc8c7401d37bd1edb7cc
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash b6f705a4bd3535b606e8214c5640933a
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_install> with hash da4e294376b70f951ca4af508fdc6a60
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash 8473bfa83cba1ee93191182b9fd239d7
changed to
oe-core/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb.do_multilib_install> with hash fcad4f5f4d7da576b7c2add3eb24fcc8
Hash for dependent task gcclibgcc-initial_5.3.bb.do_extra_symlinks changed from 0bdaebf5e23c90af7cea65f28a12c789 to 2d1b031bbd46bc8c7401d37bd1edb7cc
Hash for dependent task gcclibgcc-initial_5.3.bb.do_install changed from b6f705a4bd3535b606e8214c5640933a to da4e294376b70f951ca4af508fdc6a60
Hash for dependent task gcclibgcc-initial_5.3.bb.do_multilib_install changed from 8473bfa83cba1ee93191182b9fd239d7 to fcad4f5f4d7da576b7c2add3eb24fcc8

Regards,

Quoted 138 lines

The patch could make sure the debugging informaion does not has TMPDIR and also leaves gcc switches in.

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

(quoted diff) +0 -2
-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=

(quoted diff) +0 -2
-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

(quoted diff) +0 -3
-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/conf/bitbake.conf                             |  1 +
  meta/recipes-devtools/gcc/gcc-5.3.inc              |  3 +-
  ...48-add-option-gno-record-debug-prefix-map.patch | 65 ++++++++++++++++++++++
  3 files changed, 68 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch

meta/conf/bitbake.conf +1 -0
index bebaaf4..e2e55e8 100644
@@ -552,6 +552,7 @@ DEBUG_FLAGS ?= "-g \
      -fdebug-prefix-map=${S}=/usr/src/${BPN} \
      -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
      -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+    -gno-record-debug-prefix-map \
  "
 
  # Disabled until the option works properly -feliminate-dwarf2-dups
meta/recipes-devtools/gcc/gcc-5.3.inc +2 -1
index 80999c1..3a36e50 100644
@@ -76,7 +76,8 @@ SRC_URI = "\
             file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
             file://0045-Support-for-arm-linux-musl.patch \
             file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
-	   file://0047-Fix-nios2-musl-build.patch \
+           file://0047-Fix-nios2-musl-build.patch \
+           file://0048-add-option-gno-record-debug-prefix-map.patch \
            "
 
  BACKPORTS = ""
meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch new file +65 -0
new file mode 100644
index 0000000..e1efaeb
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 28 Jan 2016 15:25:23 +0800
+Subject: [PATCH] add option gno-record-debug-prefix-map
+
+If option gno-record-debug-prefix-map used, it does not
+record -fdebug-prefix-map to gcc command line switches
+in DWARF DW_AT_producer.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gcc/common.opt  | 8 ++++++++
+ gcc/dwarf2out.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 0c4f86b..e4c6bd6 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -2516,6 +2516,14 @@ grecord-gcc-switches
+ Common RejectNegative Var(dwarf_record_gcc_switches,1)
+ Record gcc command line switches in DWARF DW_AT_producer.
+
++gno-record-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,0) Init(1)
++Don't record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
++grecord-debug-prefix-map
++Common RejectNegative Var(dwarf_record_debug_prefix_map,1)
++Record -fdebug-prefix-map in gcc command line switches in DWARF DW_AT_producer.
++
+ gno-split-dwarf
+ Common Driver RejectNegative Var(dwarf_split_debug_info,0) Init(0)
+ Don't generate debug information in separate .dwo files
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index f90329b..646a706 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19383,6 +19383,8 @@ gen_producer_string (void)
+       case OPT_SPECIAL_input_file:
+       case OPT_grecord_gcc_switches:
+       case OPT_gno_record_gcc_switches:
++      case OPT_grecord_debug_prefix_map:
++      case OPT_gno_record_debug_prefix_map:
+       case OPT__output_pch_:
+       case OPT_fdiagnostics_show_location_:
+       case OPT_fdiagnostics_show_option:
+@@ -19415,6 +19417,12 @@ gen_producer_string (void)
+ 	  default:
+ 	    break;
+ 	  }
++
++	/* Don't record -fdebug-prefix-map in gcc command line
++	   switches in DWARF DW_AT_producer */
++	if (save_decoded_options[j].opt_index==OPT_fdebug_prefix_map_ &&
++	    !dwarf_record_debug_prefix_map)
++	  continue;
+ 	switches.safe_push (save_decoded_options[j].orig_option_with_args_text);
+ 	len += strlen (save_decoded_options[j].orig_option_with_args_text) + 1;
+ 	break;
+--
+1.9.1
+
Signature · 7 lines
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#18 lore raw

PATCH v3 3/5 mkelfimage: fix target cflags leaks to host

In reply to Hongxu Jia

The patch fix-makefile-to-find-libz.patch fixed native compile failure; for target compile, it incorrectly leaks CFLAGS to HOST_CFLAGS.

[YOCTO #3547]

---
 meta/recipes-devtools/mkelfimage/mkelfimage_git.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/mkelfimage/mkelfimage_git.bb +3 -1
index e1c33a6..92435cd 100644
@@ -14,8 +14,10 @@ DEPENDS += "zlib"
 
 SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \
            file://cross-compile.patch   \
-           file://fix-makefile-to-find-libz.patch   \
           "
+SRC_URI_append_class-native = " \
+           file://fix-makefile-to-find-libz.patch   \
+"
 
 CLEANBROKEN = "1"
 
Signature · 1 line
1.9.1
author
#19 lore raw

PATCH v3 4/5 glibc.inc: do not immediate expand SELECTED_OPTIMIZATION

In reply to Hongxu Jia

We need to expand SELECTED_OPTIMIZATION later, so
do not immediate expansion, and do the work in
anonymous python function.

It is reasonable to give an error for -O0.

[YOCTO #7058]

---
 meta/recipes-core/glibc/glibc.inc | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)
meta/recipes-core/glibc/glibc.inc +8 -14
index 17fa2d5..7c4551a 100644
@@ -9,26 +9,20 @@ PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
 TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
 
 # glibc can't be built without optimization, if someone tries to compile an
-# entire image as -O0, we override it with -O2 here and give a note about it.
-def get_optimization(d):
-    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
-    if bb.utils.contains("SELECTED_OPTIMIZATION", "-O2", "x", "", d) == "x":
-        return selected_optimization
-    elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O", "x", "", d) == "x":
+# entire image as -O0, break with fatal.
+python () {
+    if bb.utils.contains("SELECTED_OPTIMIZATION", "-O", "x", "", d) == "x":
         bb.note("glibc can't be built with -O, -O -Wno-error will be used instead.")
-        return selected_optimization.replace("-O", "-O -Wno-error")
+        d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
     elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
-        bb.note("glibc can't be built with -O0, -O2 will be used instead.")
-        return selected_optimization.replace("-O0", "-O2")
+        bb.fatal("glibc can't be built with -O0, using -O1 -Wno-error or -O1 instead.")
     elif bb.utils.contains("SELECTED_OPTIMIZATION", "-Os", "x", "", d) == "x":
         bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.")
-        return selected_optimization.replace("-Os", "-Os -Wno-error")
+        d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
     elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O1", "x", "", d) == "x":
         bb.note("glibc can't be built with -O1, -O1 -Wno-error will be used instead.")
-        return selected_optimization.replace("-O1", "-O1 -Wno-error")
-    return selected_optimization
-
-SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
+        d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
+}
 
 # siteconfig.bbclass runs configure which needs a working compiler
 # For the compiler to work we need a working libc yet libc isn't
Signature · 1 line
1.9.1
#20 lore raw

Re: [PATCH 4/5] glibc.inc: do not immediate expand SELECTED_OPTIMIZATION

Quoted 5 lines · Hongxu Jia

We need to expand SELECTED_OPTIMIZATION later, so
do not immediate expansion, and do the work in
anonymous python function.

It is reasonable to give an error for -O0.

I applaud the general idea of this patch, but...

Quoted 1 line

+ d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")

... can't you just use CFLAGS += -Wno-error rather than fiddling with SELECTED_OPTIMIZATION here? -Wno-error is clearly not an optimization flag.

p.

author
#21 lore raw

PATCH v3 5/5 systemtap_git.inc: do not immediate expand SELECTED_OPTIMIZATION

In reply to Hongxu Jia

We need to expand SELECTED_OPTIMIZATION later, so
do not immediate expansion, and do the work in
anonymous python function.

It is reasonable to give an error for -O0.

[YOCTO #7058]

---
 meta/recipes-kernel/systemtap/systemtap_git.inc | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
meta/recipes-kernel/systemtap/systemtap_git.inc +4 -8
index 7f9ae0b..656f15f 100644
@@ -17,12 +17,8 @@ COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux'
 S = "${WORKDIR}/git"
 
 # systemtap can't be built without optimization, if someone tries to compile an
-# entire image as -O0, we override it with -O2 here and give a note about it.
-def get_optimization(d):
-    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
+# entire image as -O0, break with fatal.
+python () {
     if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
-        bb.note("systemtap can't be built with -O0, -O2 will be used instead.")
-        return selected_optimization.replace("-O0", "-O2")
-    return selected_optimization
-
-SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
+        bb.fatal("systemtap can't be built with -O0, using -O1 -Wno-error or -O1 instead.")
+}
Signature · 1 line
1.9.1