All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongxu Jia <hongxu.jia@windriver.com>
To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>,
	"liezhi.yang@windriver.com" <liezhi.yang@windriver.com>,
	"raj.khem@gmail.com" <raj.khem@gmail.com>,
	"richard.purdie@linuxfoundation.org"
	<richard.purdie@linuxfoundation.org>
Subject: Re: [PATCH 2/5] gcc-5.3.inc/base.bbclass: add gcc option to not record -fdebug-prefix-map to debugging info
Date: Sat, 30 Jan 2016 09:25:21 +0800	[thread overview]
Message-ID: <56AC1101.70209@windriver.com> (raw)
In-Reply-To: <718c652c42b84c58a04e9c33261b30ba@XBOX02.axis.com>

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



  reply	other threads:[~2016-01-30  1:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:48   ` Peter Kjellerstedt
2016-01-30  1:15     ` 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:47   ` Peter Kjellerstedt
2016-01-30  1:25     ` Hongxu Jia [this message]
2016-01-30  2:36       ` Khem Raj
2016-01-30 10:57         ` Richard Purdie
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
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
2016-02-22 15:35       ` Martin Jansa
2016-01-29 17:35 ` [PATCH 3/5] mkelfimage: fix target cflags leaks to host Hongxu Jia
2016-01-29 17:35 ` [PATCH 4/5] glibc.inc: do not immediate expand SELECTED_OPTIMIZATION Hongxu Jia
2016-01-30 10:35   ` Phil Blundell
2016-01-29 17:35 ` [PATCH 5/5] systemtap_git.inc: " Hongxu Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56AC1101.70209@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.com \
    --cc=raj.khem@gmail.com \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.