public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] binutils: reproducibility: reuse debug-prefix-map for stabs
@ 2020-11-10 18:14 Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco)
  2020-11-10 18:47 ` [OE-core] " Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco) @ 2020-11-10 18:14 UTC (permalink / raw)
  To: openembedded-core

powerpc 32bit Linux Kernel widely uses .stabs pseudo-op to
produce debugging information in stabs format. Faced an issue
that during Linux Kernel build with Yocto build system for 32bit
powerpc platform resulting vmlinux contains absolute path in
.stabstr section that cannot be remapped with -fdebug-prefix-map
option.

Yocto uses scripts/mkmakefile Linux Kernel build approach that
allows to store all generated files outside of kernel source
tree. With this approach each compilier invocation is performed
with an absolute path to a file that will be compiled and this
absolute path is recorded in init stab. There is no way to remap
this path.

Reuse remap_debug_filename api to make -fdebug-prefix-map flag
aplicable for init stab.

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
---
 meta/recipes-devtools/binutils/binutils-2.35.inc   |  1 +
 ...-reproducibility-for-stabs-debugging-data.patch | 35 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.35.inc b/meta/recipes-devtools/binutils/binutils-2.35.inc
index 5ae9ec4..bc9107b 100644
--- a/meta/recipes-devtools/binutils/binutils-2.35.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.35.inc
@@ -41,5 +41,6 @@ SRC_URI = "\
      file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
      file://0015-sync-with-OE-libtool-changes.patch \
      file://0016-Check-for-clang-before-checking-gcc-version.patch \
+     file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
new file mode 100644
index 0000000..42e0c1c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
@@ -0,0 +1,35 @@
+From aa6586e80fc6fcd739aa959a71e4cf064cdef072 Mon Sep 17 00:00:00 2001
+From: Denys Zagorui <dzagorui@cisco.com>
+Date: Mon, 9 Nov 2020 15:39:10 +0000
+Subject: [PATCH] gas: improve reproducibility for stabs debugging data format
+
+	* config/obj-elf (obj_elf_init_stab_section): Improve
+	reproducibility for stabs debugging data format
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0541201782c006c09d029d18a45c6e743cfea906]
+---
+ gas/config/obj-elf.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
+index de22b5a1da..2025df8542 100644
+--- a/gas/config/obj-elf.c
++++ b/gas/config/obj-elf.c
+@@ -2374,12 +2374,13 @@ obj_elf_init_stab_section (segT seg)
+   p = frag_more (12);
+   /* Zero it out.  */
+   memset (p, 0, 12);
+-  file = as_where (NULL);
++  file = remap_debug_filename (as_where (NULL));
+   stabstr_name = concat (segment_name (seg), "str", (char *) NULL);
+   stroff = get_stab_string_offset (file, stabstr_name, TRUE);
+   know (stroff == 1 || (stroff == 0 && file[0] == '\0'));
+   md_number_to_chars (p, stroff, 4);
+   seg_info (seg)->stabu.p = p;
++  xfree ((char *) file);
+ }
+ 
+ #endif
+-- 
+2.20.1
+
-- 
2.7.4


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

* Re: [OE-core] [PATCH] binutils: reproducibility: reuse debug-prefix-map for stabs
  2020-11-10 18:14 [PATCH] binutils: reproducibility: reuse debug-prefix-map for stabs Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco)
@ 2020-11-10 18:47 ` Khem Raj
  2020-11-10 20:08   ` Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco)
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2020-11-10 18:47 UTC (permalink / raw)
  To: dzagorui; +Cc: Patches and discussions about the oe-core layer

This looks good. Can you also propose it for dunfell?

On Tue, Nov 10, 2020 at 10:14 AM Denys Zagorui -X (dzagorui -
GLOBALLOGIC INC@Cisco) via lists.openembedded.org
<dzagorui=cisco.com@lists.openembedded.org> wrote:
>
> powerpc 32bit Linux Kernel widely uses .stabs pseudo-op to
> produce debugging information in stabs format. Faced an issue
> that during Linux Kernel build with Yocto build system for 32bit
> powerpc platform resulting vmlinux contains absolute path in
> .stabstr section that cannot be remapped with -fdebug-prefix-map
> option.
>
> Yocto uses scripts/mkmakefile Linux Kernel build approach that
> allows to store all generated files outside of kernel source
> tree. With this approach each compilier invocation is performed
> with an absolute path to a file that will be compiled and this
> absolute path is recorded in init stab. There is no way to remap
> this path.
>
> Reuse remap_debug_filename api to make -fdebug-prefix-map flag
> aplicable for init stab.
>
> Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
> ---
>  meta/recipes-devtools/binutils/binutils-2.35.inc   |  1 +
>  ...-reproducibility-for-stabs-debugging-data.patch | 35 ++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
>
> diff --git a/meta/recipes-devtools/binutils/binutils-2.35.inc b/meta/recipes-devtools/binutils/binutils-2.35.inc
> index 5ae9ec4..bc9107b 100644
> --- a/meta/recipes-devtools/binutils/binutils-2.35.inc
> +++ b/meta/recipes-devtools/binutils/binutils-2.35.inc
> @@ -41,5 +41,6 @@ SRC_URI = "\
>       file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
>       file://0015-sync-with-OE-libtool-changes.patch \
>       file://0016-Check-for-clang-before-checking-gcc-version.patch \
> +     file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
>  "
>  S  = "${WORKDIR}/git"
> diff --git a/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
> new file mode 100644
> index 0000000..42e0c1c
> --- /dev/null
> +++ b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
> @@ -0,0 +1,35 @@
> +From aa6586e80fc6fcd739aa959a71e4cf064cdef072 Mon Sep 17 00:00:00 2001
> +From: Denys Zagorui <dzagorui@cisco.com>
> +Date: Mon, 9 Nov 2020 15:39:10 +0000
> +Subject: [PATCH] gas: improve reproducibility for stabs debugging data format
> +
> +       * config/obj-elf (obj_elf_init_stab_section): Improve
> +       reproducibility for stabs debugging data format
> +
> +Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0541201782c006c09d029d18a45c6e743cfea906]
> +---
> + gas/config/obj-elf.c | 3 ++-
> + 1 file changed, 2 insertions(+), 1 deletion(-)
> +
> +diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
> +index de22b5a1da..2025df8542 100644
> +--- a/gas/config/obj-elf.c
> ++++ b/gas/config/obj-elf.c
> +@@ -2374,12 +2374,13 @@ obj_elf_init_stab_section (segT seg)
> +   p = frag_more (12);
> +   /* Zero it out.  */
> +   memset (p, 0, 12);
> +-  file = as_where (NULL);
> ++  file = remap_debug_filename (as_where (NULL));
> +   stabstr_name = concat (segment_name (seg), "str", (char *) NULL);
> +   stroff = get_stab_string_offset (file, stabstr_name, TRUE);
> +   know (stroff == 1 || (stroff == 0 && file[0] == '\0'));
> +   md_number_to_chars (p, stroff, 4);
> +   seg_info (seg)->stabu.p = p;
> ++  xfree ((char *) file);
> + }
> +
> + #endif
> +--
> +2.20.1
> +
> --
> 2.7.4
>
>
> 
>

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

* Re: [OE-core] [PATCH] binutils: reproducibility: reuse debug-prefix-map for stabs
  2020-11-10 18:47 ` [OE-core] " Khem Raj
@ 2020-11-10 20:08   ` Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco)
  0 siblings, 0 replies; 3+ messages in thread
From: Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco) @ 2020-11-10 20:08 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

Yes, i'll propose it for dunfell also
________________________________________
From: Khem Raj <raj.khem@gmail.com>
Sent: Tuesday, November 10, 2020 8:47 PM
To: Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco)
Cc: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH] binutils: reproducibility: reuse debug-prefix-map for stabs

This looks good. Can you also propose it for dunfell?

On Tue, Nov 10, 2020 at 10:14 AM Denys Zagorui -X (dzagorui -
GLOBALLOGIC INC@Cisco) via lists.openembedded.org
<dzagorui=cisco.com@lists.openembedded.org> wrote:
>
> powerpc 32bit Linux Kernel widely uses .stabs pseudo-op to
> produce debugging information in stabs format. Faced an issue
> that during Linux Kernel build with Yocto build system for 32bit
> powerpc platform resulting vmlinux contains absolute path in
> .stabstr section that cannot be remapped with -fdebug-prefix-map
> option.
>
> Yocto uses scripts/mkmakefile Linux Kernel build approach that
> allows to store all generated files outside of kernel source
> tree. With this approach each compilier invocation is performed
> with an absolute path to a file that will be compiled and this
> absolute path is recorded in init stab. There is no way to remap
> this path.
>
> Reuse remap_debug_filename api to make -fdebug-prefix-map flag
> aplicable for init stab.
>
> Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
> ---
>  meta/recipes-devtools/binutils/binutils-2.35.inc   |  1 +
>  ...-reproducibility-for-stabs-debugging-data.patch | 35 ++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
>
> diff --git a/meta/recipes-devtools/binutils/binutils-2.35.inc b/meta/recipes-devtools/binutils/binutils-2.35.inc
> index 5ae9ec4..bc9107b 100644
> --- a/meta/recipes-devtools/binutils/binutils-2.35.inc
> +++ b/meta/recipes-devtools/binutils/binutils-2.35.inc
> @@ -41,5 +41,6 @@ SRC_URI = "\
>       file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
>       file://0015-sync-with-OE-libtool-changes.patch \
>       file://0016-Check-for-clang-before-checking-gcc-version.patch \
> +     file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
>  "
>  S  = "${WORKDIR}/git"
> diff --git a/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
> new file mode 100644
> index 0000000..42e0c1c
> --- /dev/null
> +++ b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
> @@ -0,0 +1,35 @@
> +From aa6586e80fc6fcd739aa959a71e4cf064cdef072 Mon Sep 17 00:00:00 2001
> +From: Denys Zagorui <dzagorui@cisco.com>
> +Date: Mon, 9 Nov 2020 15:39:10 +0000
> +Subject: [PATCH] gas: improve reproducibility for stabs debugging data format
> +
> +       * config/obj-elf (obj_elf_init_stab_section): Improve
> +       reproducibility for stabs debugging data format
> +
> +Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0541201782c006c09d029d18a45c6e743cfea906]
> +---
> + gas/config/obj-elf.c | 3 ++-
> + 1 file changed, 2 insertions(+), 1 deletion(-)
> +
> +diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
> +index de22b5a1da..2025df8542 100644
> +--- a/gas/config/obj-elf.c
> ++++ b/gas/config/obj-elf.c
> +@@ -2374,12 +2374,13 @@ obj_elf_init_stab_section (segT seg)
> +   p = frag_more (12);
> +   /* Zero it out.  */
> +   memset (p, 0, 12);
> +-  file = as_where (NULL);
> ++  file = remap_debug_filename (as_where (NULL));
> +   stabstr_name = concat (segment_name (seg), "str", (char *) NULL);
> +   stroff = get_stab_string_offset (file, stabstr_name, TRUE);
> +   know (stroff == 1 || (stroff == 0 && file[0] == '\0'));
> +   md_number_to_chars (p, stroff, 4);
> +   seg_info (seg)->stabu.p = p;
> ++  xfree ((char *) file);
> + }
> +
> + #endif
> +--
> +2.20.1
> +
> --
> 2.7.4
>
>
> 
>

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

end of thread, other threads:[~2020-11-10 20:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-10 18:14 [PATCH] binutils: reproducibility: reuse debug-prefix-map for stabs Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco)
2020-11-10 18:47 ` [OE-core] " Khem Raj
2020-11-10 20:08   ` Denys Zagorui -X (dzagorui - GLOBALLOGIC INC@Cisco)

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