* [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info
2016-01-29 17:35 [PATCH v3 0/5]use target path to replace build ones in debugging info Hongxu Jia
@ 2016-01-29 17:35 ` Hongxu Jia
2016-01-29 17:48 ` Peter Kjellerstedt
2016-01-29 17:35 ` [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to " Hongxu Jia
` (3 subsequent siblings)
4 siblings, 1 reply; 22+ messages in thread
From: Hongxu Jia @ 2016-01-29 17:35 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 | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e80ee18..bebaaf4 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -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"
--
1.9.1
^ permalink raw reply related [flat|nested] 22+ messages in thread* Re: [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info
2016-01-29 17:35 ` [PATCH 1/5] base/bbclass: use target path as compile dir " Hongxu Jia
@ 2016-01-29 17:48 ` Peter Kjellerstedt
2016-01-30 1:15 ` Hongxu Jia
0 siblings, 1 reply; 22+ messages in thread
From: Peter Kjellerstedt @ 2016-01-29 17:48 UTC (permalink / raw)
To: Hongxu Jia, openembedded-core@lists.openembedded.org,
liezhi.yang@windriver.com, raj.khem@gmail.com,
richard.purdie@linuxfoundation.org
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Hongxu Jia
> Sent: den 29 januari 2016 18:36
> To: openembedded-core@lists.openembedded.org;
> liezhi.yang@windriver.com; raj.khem@gmail.com;
> richard.purdie@linuxfoundation.org
> 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
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 1/5] base/bbclass: use target path as compile dir in debugging info
2016-01-29 17:48 ` Peter Kjellerstedt
@ 2016-01-30 1:15 ` Hongxu Jia
0 siblings, 0 replies; 22+ messages in thread
From: Hongxu Jia @ 2016-01-30 1:15 UTC (permalink / raw)
To: Peter Kjellerstedt, openembedded-core@lists.openembedded.org,
liezhi.yang@windriver.com, raj.khem@gmail.com,
richard.purdie@linuxfoundation.org
On 01/30/2016 01:48 AM, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org
>> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
>> Hongxu Jia
>> Sent: den 29 januari 2016 18:36
>> To: openembedded-core@lists.openembedded.org;
>> liezhi.yang@windriver.com; raj.khem@gmail.com;
>> richard.purdie@linuxfoundation.org
>> 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...
Sorry for the typo
//Hongxu
>
> //Peter
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-29 17:35 [PATCH v3 0/5]use target path to replace build ones in debugging info Hongxu Jia
2016-01-29 17:35 ` [PATCH 1/5] base/bbclass: use target path as compile dir " Hongxu Jia
@ 2016-01-29 17:35 ` Hongxu Jia
2016-01-29 17:47 ` Peter Kjellerstedt
` (2 more replies)
2016-01-29 17:35 ` [PATCH 3/5] mkelfimage: fix target cflags leaks to host Hongxu Jia
` (2 subsequent siblings)
4 siblings, 3 replies; 22+ messages in thread
From: Hongxu Jia @ 2016-01-29 17:35 UTC (permalink / raw)
To: openembedded-core, liezhi.yang, raj.khem, richard.purdie
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]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
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
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index bebaaf4..e2e55e8 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -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
diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
index 80999c1..3a36e50 100644
--- a/meta/recipes-devtools/gcc/gcc-5.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -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 = ""
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-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
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
@@ -0,0 +1,65 @@
+From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+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 <hongxu.jia@windriver.com>
+---
+ 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
^ permalink raw reply related [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-29 17:35 ` [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to " Hongxu Jia
@ 2016-01-29 17:47 ` Peter Kjellerstedt
2016-01-30 1:25 ` Hongxu Jia
2016-01-30 11:43 ` Phil Blundell
2016-02-20 13:00 ` Martin Jansa
2 siblings, 1 reply; 22+ messages in thread
From: Peter Kjellerstedt @ 2016-01-29 17:47 UTC (permalink / raw)
To: Hongxu Jia, openembedded-core@lists.openembedded.org,
liezhi.yang@windriver.com, raj.khem@gmail.com,
richard.purdie@linuxfoundation.org
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
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Hongxu Jia
> Sent: den 29 januari 2016 18:36
> To: openembedded-core@lists.openembedded.org;
> liezhi.yang@windriver.com; raj.khem@gmail.com;
> richard.purdie@linuxfoundation.org
> 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=
> -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/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
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index bebaaf4..e2e55e8 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -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
> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-
> devtools/gcc/gcc-5.3.inc
> index 80999c1..3a36e50 100644
> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
> @@ -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 = ""
> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-
> 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
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-
> debug-prefix-map.patch
> @@ -0,0 +1,65 @@
> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +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 <hongxu.jia@windriver.com>
> +---
> + 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
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-29 17:47 ` Peter Kjellerstedt
@ 2016-01-30 1:25 ` Hongxu Jia
2016-01-30 2:36 ` Khem Raj
0 siblings, 1 reply; 22+ messages in thread
From: Hongxu Jia @ 2016-01-30 1:25 UTC (permalink / raw)
To: Peter Kjellerstedt, openembedded-core@lists.openembedded.org,
liezhi.yang@windriver.com, raj.khem@gmail.com,
richard.purdie@linuxfoundation.org
On 01/30/2016 01:47 AM, Peter Kjellerstedt wrote:
> 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
>
> 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
> //Peter
>
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org
>> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
>> Hongxu Jia
>> Sent: den 29 januari 2016 18:36
>> To: openembedded-core@lists.openembedded.org;
>> liezhi.yang@windriver.com; raj.khem@gmail.com;
>> richard.purdie@linuxfoundation.org
>> 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=
>> -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/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
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index bebaaf4..e2e55e8 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -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
>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-
>> devtools/gcc/gcc-5.3.inc
>> index 80999c1..3a36e50 100644
>> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
>> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
>> @@ -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 = ""
>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-
>> 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
>> --- /dev/null
>> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-
>> debug-prefix-map.patch
>> @@ -0,0 +1,65 @@
>> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>> +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 <hongxu.jia@windriver.com>
>> +---
>> + 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
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-30 1:25 ` Hongxu Jia
@ 2016-01-30 2:36 ` Khem Raj
2016-01-30 10:57 ` Richard Purdie
0 siblings, 1 reply; 22+ messages in thread
From: Khem Raj @ 2016-01-30 2:36 UTC (permalink / raw)
To: Hongxu Jia; +Cc: Peter Kjellerstedt, openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 7876 bytes --]
> On Jan 29, 2016, at 5:25 PM, Hongxu Jia <hongxu.jia@windriver.com> wrote:
>
> On 01/30/2016 01:47 AM, Peter Kjellerstedt wrote:
>> 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
>
>>
>> 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.
its not only non gcc compilers, we also have gcc 4.9 still.
>
> //Hongxu
>
>> //Peter
>>
>>> -----Original Message-----
>>> From: openembedded-core-bounces@lists.openembedded.org
>>> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
>>> Hongxu Jia
>>> Sent: den 29 januari 2016 18:36
>>> To: openembedded-core@lists.openembedded.org;
>>> liezhi.yang@windriver.com; raj.khem@gmail.com;
>>> richard.purdie@linuxfoundation.org
>>> 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=
>>> -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/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
>>>
>>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>>> index bebaaf4..e2e55e8 100644
>>> --- a/meta/conf/bitbake.conf
>>> +++ b/meta/conf/bitbake.conf
>>> @@ -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
>>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-
>>> devtools/gcc/gcc-5.3.inc
>>> index 80999c1..3a36e50 100644
>>> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
>>> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
>>> @@ -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 = ""
>>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-
>>> 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
>>> --- /dev/null
>>> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-
>>> debug-prefix-map.patch
>>> @@ -0,0 +1,65 @@
>>> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
>>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>>> +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 <hongxu.jia@windriver.com>
>>> +---
>>> + 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
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-30 2:36 ` Khem Raj
@ 2016-01-30 10:57 ` Richard Purdie
2016-02-01 14:01 ` Hongxu Jia
0 siblings, 1 reply; 22+ messages in thread
From: Richard Purdie @ 2016-01-30 10:57 UTC (permalink / raw)
To: Khem Raj, Hongxu Jia
Cc: Peter Kjellerstedt, openembedded-core@lists.openembedded.org
On Fri, 2016-01-29 at 18:36 -0800, Khem Raj wrote:
> > On Jan 29, 2016, at 5:25 PM, Hongxu Jia <hongxu.jia@windriver.com>
> > wrote:
> >
> > On 01/30/2016 01:47 AM, Peter Kjellerstedt wrote:
> > > 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
> >
> > >
> > > 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.
>
> 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
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-30 10:57 ` Richard Purdie
@ 2016-02-01 14:01 ` Hongxu Jia
2016-02-01 14:09 ` Richard Purdie
0 siblings, 1 reply; 22+ messages in thread
From: Hongxu Jia @ 2016-02-01 14:01 UTC (permalink / raw)
To: Richard Purdie, Khem Raj
Cc: Peter Kjellerstedt, openembedded-core@lists.openembedded.org
On 01/30/2016 06:57 PM, Richard Purdie wrote:
> On Fri, 2016-01-29 at 18:36 -0800, Khem Raj wrote:
>>> On Jan 29, 2016, at 5:25 PM, Hongxu Jia <hongxu.jia@windriver.com>
>>> wrote:
>>>
>>> On 01/30/2016 01:47 AM, Peter Kjellerstedt wrote:
>>>> 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
>>>
>>>> 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.
>> 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.
Got it, I will do it in V4.
//Hongxu
> Cheers,
>
> Richard
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-02-01 14:01 ` Hongxu Jia
@ 2016-02-01 14:09 ` Richard Purdie
2016-02-01 17:10 ` Khem Raj
2016-02-07 16:17 ` Hongxu Jia
0 siblings, 2 replies; 22+ messages in thread
From: Richard Purdie @ 2016-02-01 14:09 UTC (permalink / raw)
To: Hongxu Jia, Khem Raj
Cc: Peter Kjellerstedt, openembedded-core@lists.openembedded.org
On Mon, 2016-02-01 at 22:01 +0800, Hongxu Jia wrote:
> On 01/30/2016 06:57 PM, Richard Purdie wrote:
> > On Fri, 2016-01-29 at 18:36 -0800, Khem Raj wrote:
> > > > On Jan 29, 2016, at 5:25 PM, Hongxu Jia <
> > > > hongxu.jia@windriver.com>
> > > > wrote:
> > > >
> > > > On 01/30/2016 01:47 AM, Peter Kjellerstedt wrote:
> > > > > 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
> > > >
> > > > > 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.
> > > 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.
>
> 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
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-02-01 14:09 ` Richard Purdie
@ 2016-02-01 17:10 ` Khem Raj
2016-02-07 16:17 ` Hongxu Jia
1 sibling, 0 replies; 22+ messages in thread
From: Khem Raj @ 2016-02-01 17:10 UTC (permalink / raw)
To: Richard Purdie
Cc: Peter Kjellerstedt, openembedded-core@lists.openembedded.org
On Mon, Feb 1, 2016 at 6:09 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2016-02-01 at 22:01 +0800, Hongxu Jia wrote:
>> On 01/30/2016 06:57 PM, Richard Purdie wrote:
>> > On Fri, 2016-01-29 at 18:36 -0800, Khem Raj wrote:
>> > > > On Jan 29, 2016, at 5:25 PM, Hongxu Jia <
>> > > > hongxu.jia@windriver.com>
>> > > > wrote:
>> > > >
>> > > > On 01/30/2016 01:47 AM, Peter Kjellerstedt wrote:
>> > > > > 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
>> > > >
>> > > > > 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.
>> > > 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.
>>
>> 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,
> much of this issue goes away as Phil mentions.
>
> Cheers,
>
> Richard
>
>
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-02-01 14:09 ` Richard Purdie
2016-02-01 17:10 ` Khem Raj
@ 2016-02-07 16:17 ` Hongxu Jia
1 sibling, 0 replies; 22+ messages in thread
From: Hongxu Jia @ 2016-02-07 16:17 UTC (permalink / raw)
To: Richard Purdie, Khem Raj
Cc: Peter Kjellerstedt, openembedded-core@lists.openembedded.org
On 02/01/2016 10:09 PM, Richard Purdie wrote:
>> 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
> Cheers,
>
> Richard
>
>
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-29 17:35 ` [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to " Hongxu Jia
2016-01-29 17:47 ` Peter Kjellerstedt
@ 2016-01-30 11:43 ` Phil Blundell
2016-02-20 13:00 ` Martin Jansa
2 siblings, 0 replies; 22+ messages in thread
From: Phil Blundell @ 2016-01-30 11:43 UTC (permalink / raw)
To: Hongxu Jia; +Cc: openembedded-core
On Fri, 2016-01-29 at 12:35 -0500, Hongxu Jia wrote:
> +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.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-01-29 17:35 ` [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to " Hongxu Jia
2016-01-29 17:47 ` Peter Kjellerstedt
2016-01-30 11:43 ` Phil Blundell
@ 2016-02-20 13:00 ` Martin Jansa
2016-02-20 15:02 ` Khem Raj
2016-02-22 6:44 ` Hongxu Jia
2 siblings, 2 replies; 22+ messages in thread
From: Martin Jansa @ 2016-02-20 13:00 UTC (permalink / raw)
To: Hongxu Jia; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 8766 bytes --]
On Fri, Jan 29, 2016 at 12:35:55PM -0500, Hongxu Jia wrote:
> 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,
>
> 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]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> 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
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index bebaaf4..e2e55e8 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -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
> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
> index 80999c1..3a36e50 100644
> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
> @@ -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 = ""
> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-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
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
> @@ -0,0 +1,65 @@
> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +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 <hongxu.jia@windriver.com>
> +---
> + 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
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-02-20 13:00 ` Martin Jansa
@ 2016-02-20 15:02 ` Khem Raj
2016-02-22 6:44 ` Hongxu Jia
1 sibling, 0 replies; 22+ messages in thread
From: Khem Raj @ 2016-02-20 15:02 UTC (permalink / raw)
To: Martin Jansa; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 9127 bytes --]
> On Feb 20, 2016, at 5:00 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
>
> On Fri, Jan 29, 2016 at 12:35:55PM -0500, Hongxu Jia wrote:
>> 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’]
These should be ignored from checksum calculations on the same lines as —sysroot is ignored
> 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,
>
>
>>
>> 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]
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>> 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
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index bebaaf4..e2e55e8 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -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
>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
>> index 80999c1..3a36e50 100644
>> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
>> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
>> @@ -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 = ""
>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-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
>> --- /dev/null
>> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
>> @@ -0,0 +1,65 @@
>> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>> +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 <hongxu.jia@windriver.com>
>> +---
>> + 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
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
> --
> Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-02-20 13:00 ` Martin Jansa
2016-02-20 15:02 ` Khem Raj
@ 2016-02-22 6:44 ` Hongxu Jia
2016-02-22 15:35 ` Martin Jansa
1 sibling, 1 reply; 22+ messages in thread
From: Hongxu Jia @ 2016-02-22 6:44 UTC (permalink / raw)
To: Martin Jansa; +Cc: openembedded-core
On 02/20/2016 09:00 PM, Martin Jansa wrote:
> On Fri, Jan 29, 2016 at 12:35:55PM -0500, Hongxu Jia wrote:
>> 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
> 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,
>
>
>> 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]
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>> 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
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index bebaaf4..e2e55e8 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -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
>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
>> index 80999c1..3a36e50 100644
>> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
>> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
>> @@ -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 = ""
>> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-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
>> --- /dev/null
>> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
>> @@ -0,0 +1,65 @@
>> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>> +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 <hongxu.jia@windriver.com>
>> +---
>> + 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
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
2016-02-22 6:44 ` Hongxu Jia
@ 2016-02-22 15:35 ` Martin Jansa
0 siblings, 0 replies; 22+ messages in thread
From: Martin Jansa @ 2016-02-22 15:35 UTC (permalink / raw)
To: Hongxu Jia; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 10621 bytes --]
On Mon, Feb 22, 2016 at 02:44:41PM +0800, Hongxu Jia wrote:
> On 02/20/2016 09:00 PM, Martin Jansa wrote:
> > On Fri, Jan 29, 2016 at 12:35:55PM -0500, Hongxu Jia wrote:
> >> 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".
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.
> 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
>
>
> > 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,
> >
> >
> >> 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]
> >>
> >> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> >> ---
> >> 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
> >>
> >> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> >> index bebaaf4..e2e55e8 100644
> >> --- a/meta/conf/bitbake.conf
> >> +++ b/meta/conf/bitbake.conf
> >> @@ -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
> >> diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
> >> index 80999c1..3a36e50 100644
> >> --- a/meta/recipes-devtools/gcc/gcc-5.3.inc
> >> +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
> >> @@ -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 = ""
> >> diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-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
> >> --- /dev/null
> >> +++ b/meta/recipes-devtools/gcc/gcc-5.3/0048-add-option-gno-record-debug-prefix-map.patch
> >> @@ -0,0 +1,65 @@
> >> +From f1c5f8e9b568122c9a5afd323fd6d76250b83c94 Mon Sep 17 00:00:00 2001
> >> +From: Hongxu Jia <hongxu.jia@windriver.com>
> >> +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 <hongxu.jia@windriver.com>
> >> +---
> >> + 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
> >>
> >> --
> >> _______________________________________________
> >> Openembedded-core mailing list
> >> Openembedded-core@lists.openembedded.org
> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 3/5] mkelfimage: fix target cflags leaks to host
2016-01-29 17:35 [PATCH v3 0/5]use target path to replace build ones in debugging info Hongxu Jia
2016-01-29 17:35 ` [PATCH 1/5] base/bbclass: use target path as compile dir " Hongxu Jia
2016-01-29 17:35 ` [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to " Hongxu Jia
@ 2016-01-29 17:35 ` Hongxu Jia
2016-01-29 17:35 ` [PATCH 4/5] glibc.inc: do not immediate expand SELECTED_OPTIMIZATION Hongxu Jia
2016-01-29 17:35 ` [PATCH 5/5] systemtap_git.inc: " Hongxu Jia
4 siblings, 0 replies; 22+ messages in thread
From: Hongxu Jia @ 2016-01-29 17:35 UTC (permalink / raw)
To: openembedded-core, liezhi.yang, raj.khem, richard.purdie
The patch fix-makefile-to-find-libz.patch fixed native
compile failure; for target compile, it incorrectly
leaks CFLAGS to HOST_CFLAGS.
[YOCTO #3547]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/mkelfimage/mkelfimage_git.bb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
index e1c33a6..92435cd 100644
--- a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
@@ -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"
--
1.9.1
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 4/5] glibc.inc: do not immediate expand SELECTED_OPTIMIZATION
2016-01-29 17:35 [PATCH v3 0/5]use target path to replace build ones in debugging info Hongxu Jia
` (2 preceding siblings ...)
2016-01-29 17:35 ` [PATCH 3/5] mkelfimage: fix target cflags leaks to host Hongxu Jia
@ 2016-01-29 17:35 ` Hongxu Jia
2016-01-30 10:35 ` Phil Blundell
2016-01-29 17:35 ` [PATCH 5/5] systemtap_git.inc: " Hongxu Jia
4 siblings, 1 reply; 22+ messages in thread
From: Hongxu Jia @ 2016-01-29 17:35 UTC (permalink / raw)
To: openembedded-core, liezhi.yang, raj.khem, richard.purdie
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]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-core/glibc/glibc.inc | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 17fa2d5..7c4551a 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -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
--
1.9.1
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 5/5] systemtap_git.inc: do not immediate expand SELECTED_OPTIMIZATION
2016-01-29 17:35 [PATCH v3 0/5]use target path to replace build ones in debugging info Hongxu Jia
` (3 preceding siblings ...)
2016-01-29 17:35 ` [PATCH 4/5] glibc.inc: do not immediate expand SELECTED_OPTIMIZATION Hongxu Jia
@ 2016-01-29 17:35 ` Hongxu Jia
4 siblings, 0 replies; 22+ messages in thread
From: Hongxu Jia @ 2016-01-29 17:35 UTC (permalink / raw)
To: openembedded-core, liezhi.yang, raj.khem, richard.purdie
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]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-kernel/systemtap/systemtap_git.inc | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
index 7f9ae0b..656f15f 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.inc
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -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.")
+}
--
1.9.1
^ permalink raw reply related [flat|nested] 22+ messages in thread