All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dtc: improve reproducibility
@ 2021-01-20 18:20 Oleksiy Obitotskyy
  2021-01-20 21:21 ` [OE-core] " Richard Purdie
  2021-01-20 21:59 ` Otavio Salvador
  0 siblings, 2 replies; 6+ messages in thread
From: Oleksiy Obitotskyy @ 2021-01-20 18:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Oleksiy Obitotskyy

Makefile override CFLAGS, so -fmacro/debug-prefix-map
optiions was omitted and binaries contains absolute
patch to sources.

Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
---
 meta/recipes-kernel/dtc/dtc.inc               | 10 +++++-
 ...-Makefile-to-add-CFLAGS-not-override.patch | 36 +++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch

diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
index 0650e3c82e..59badd4951 100644
--- a/meta/recipes-kernel/dtc/dtc.inc
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -8,6 +8,14 @@ DEPENDS = "flex-native bison-native"
 SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
            file://make_install.patch \
            "
+
+def get_reproducibility_patches(d):
+     if bb.data.inherits_class("reproducible_build", d):
+        return "file://0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch"
+     return ""
+
+SRC_URI += "${@get_reproducibility_patches(d)}"
+
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
 
 EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
diff --git a/meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch b/meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch
new file mode 100644
index 0000000000..6ac83929b9
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch
@@ -0,0 +1,36 @@
+From d684b031967ee7055d5719476ef578fe2c37401c Mon Sep 17 00:00:00 2001
+From: Oleksiy Obitotskyy <oobitots@cisco.com>
+Date: Thu, 24 Sep 2020 05:12:42 -0700
+Subject: [PATCH] dtc: Fix Makefile to add CFLAGS not override
+
+Makefile override CFLAGS not extend them, so some of them
+missing. Sources builds out of kernel tree and probably not all
+options could be used (?). We need at least -fmacro-prefix-map/
+debug-prefix-map to eliminate absolute path in binaries.
+
+Upstream-Status: Pending
+Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index f729bf6..bb51a92 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,10 +16,10 @@ EXTRAVERSION =
+ LOCAL_VERSION =
+ CONFIG_LOCALVERSION =
+ 
+-CPPFLAGS = -I libfdt -I .
++CPPFLAGS += -I libfdt -I .
+ WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
+ 	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
+-CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS)
++CFLAGS += -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS)
+ 
+ BISON = bison
+ LEX = flex
+-- 
+2.19.0.dirty
+
-- 
2.26.2.Cisco


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

* Re: [OE-core] [PATCH] dtc: improve reproducibility
  2021-01-20 18:20 [PATCH] dtc: improve reproducibility Oleksiy Obitotskyy
@ 2021-01-20 21:21 ` Richard Purdie
  2021-01-20 21:59 ` Otavio Salvador
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2021-01-20 21:21 UTC (permalink / raw)
  To: oobitots, openembedded-core

On Wed, 2021-01-20 at 10:20 -0800, Oleksiy Obitotskyy via
lists.openembedded.org wrote:
> Makefile override CFLAGS, so -fmacro/debug-prefix-map
> optiions was omitted and binaries contains absolute
> patch to sources.
> 
> Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
> ---
>  meta/recipes-kernel/dtc/dtc.inc               | 10 +++++-
>  ...-Makefile-to-add-CFLAGS-not-override.patch | 36 +++++++++++++++++++
>  2 files changed, 45 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch
> 
> diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
> index 0650e3c82e..59badd4951 100644
> --- a/meta/recipes-kernel/dtc/dtc.inc
> +++ b/meta/recipes-kernel/dtc/dtc.inc
> @@ -8,6 +8,14 @@ DEPENDS = "flex-native bison-native"
>  SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
>             file://make_install.patch \
>             "
> +
> +def get_reproducibility_patches(d):
> +     if bb.data.inherits_class("reproducible_build", d):
> +        return "file://0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch"
> +     return ""
> +
> +SRC_URI += "${@get_reproducibility_patches(d)}"
> +
>  UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"

Thanks for looking at this, its good to get some of the remaining
issues sorted!

Is there a reason we can't always apply this patch?

Cheers,

Richard



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

* Re: [OE-core] [PATCH] dtc: improve reproducibility
  2021-01-20 18:20 [PATCH] dtc: improve reproducibility Oleksiy Obitotskyy
  2021-01-20 21:21 ` [OE-core] " Richard Purdie
@ 2021-01-20 21:59 ` Otavio Salvador
  2021-01-20 22:17   ` Khem Raj
  1 sibling, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2021-01-20 21:59 UTC (permalink / raw)
  To: oobitots; +Cc: Patches and discussions about the oe-core layer

Hello,

Em qua., 20 de jan. de 2021 às 15:20, Oleksiy Obitotskyy via
lists.openembedded.org <oobitots=cisco.com@lists.openembedded.org>
escreveu:
>
> Makefile override CFLAGS, so -fmacro/debug-prefix-map
> optiions was omitted and binaries contains absolute
> patch to sources.
>
> Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
> ---
>  meta/recipes-kernel/dtc/dtc.inc               | 10 +++++-
>  ...-Makefile-to-add-CFLAGS-not-override.patch | 36 +++++++++++++++++++
> ...

The patch can be applied unconditionally as it essentially allow new
flags to be added and should not harm. In fact, applying it seems to
be the correct fix IMO.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

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

* Re: [OE-core] [PATCH] dtc: improve reproducibility
  2021-01-20 21:59 ` Otavio Salvador
@ 2021-01-20 22:17   ` Khem Raj
  2021-01-21  7:26     ` Oleksiy Obitotskyy
  0 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2021-01-20 22:17 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: Oleksiy Obitotskyy, Patches and discussions about the oe-core layer

it perhaps should be sent upstream too.

On Wed, Jan 20, 2021 at 2:00 PM Otavio Salvador
<otavio.salvador@ossystems.com.br> wrote:
>
> Hello,
>
> Em qua., 20 de jan. de 2021 às 15:20, Oleksiy Obitotskyy via
> lists.openembedded.org <oobitots=cisco.com@lists.openembedded.org>
> escreveu:
> >
> > Makefile override CFLAGS, so -fmacro/debug-prefix-map
> > optiions was omitted and binaries contains absolute
> > patch to sources.
> >
> > Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
> > ---
> >  meta/recipes-kernel/dtc/dtc.inc               | 10 +++++-
> >  ...-Makefile-to-add-CFLAGS-not-override.patch | 36 +++++++++++++++++++
> > ...
>
> The patch can be applied unconditionally as it essentially allow new
> flags to be added and should not harm. In fact, applying it seems to
> be the correct fix IMO.
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
>
> 
>

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

* Re: [OE-core] [PATCH] dtc: improve reproducibility
  2021-01-20 22:17   ` Khem Raj
@ 2021-01-21  7:26     ` Oleksiy Obitotskyy
  2021-01-21  9:08       ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Oleksiy Obitotskyy @ 2021-01-21  7:26 UTC (permalink / raw)
  To: Khem Raj, Otavio Salvador, Richard Purdie
  Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

Hi,


Should I rework (add patch unconditional) and resubmit patch?
Or should I try to submit it to the dtc directly?

Regards,
Oleksiy
________________________________
From: Khem Raj <raj.khem@gmail.com>
Sent: Thursday, January 21, 2021 00:17
To: Otavio Salvador <otavio.salvador@ossystems.com.br>
Cc: Oleksiy Obitotskyi -X (oobitots - GLOBALLOGIC INC at Cisco) <oobitots@cisco.com>; Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] dtc: improve reproducibility

it perhaps should be sent upstream too.

On Wed, Jan 20, 2021 at 2:00 PM Otavio Salvador
<otavio.salvador@ossystems.com.br> wrote:
>
> Hello,
>
> Em qua., 20 de jan. de 2021 às 15:20, Oleksiy Obitotskyy via
> lists.openembedded.org <oobitots=cisco.com@lists.openembedded.org>
> escreveu:
> >
> > Makefile override CFLAGS, so -fmacro/debug-prefix-map
> > optiions was omitted and binaries contains absolute
> > patch to sources.
> >
> > Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
> > ---
> >  meta/recipes-kernel/dtc/dtc.inc               | 10 +++++-
> >  ...-Makefile-to-add-CFLAGS-not-override.patch | 36 +++++++++++++++++++
> > ...
>
> The patch can be applied unconditionally as it essentially allow new
> flags to be added and should not harm. In fact, applying it seems to
> be the correct fix IMO.
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
>
> 
>

[-- Attachment #2: Type: text/html, Size: 4094 bytes --]

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

* Re: [OE-core] [PATCH] dtc: improve reproducibility
  2021-01-21  7:26     ` Oleksiy Obitotskyy
@ 2021-01-21  9:08       ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2021-01-21  9:08 UTC (permalink / raw)
  To: Oleksiy Obitotskyi -X (oobitots - GLOBALLOGIC INC at Cisco),
	Khem Raj, Otavio Salvador
  Cc: Patches and discussions about the oe-core layer

On Thu, 2021-01-21 at 07:26 +0000, Oleksiy Obitotskyi -X (oobitots - GLOBALLOGIC INC at Cisco) wrote:
> Should I rework (add patch unconditional) and resubmit patch?
> Or should I try to submit it to the dtc directly?

Both would be ideal please!

Cheers,

Richard


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

end of thread, other threads:[~2021-01-21  9:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 18:20 [PATCH] dtc: improve reproducibility Oleksiy Obitotskyy
2021-01-20 21:21 ` [OE-core] " Richard Purdie
2021-01-20 21:59 ` Otavio Salvador
2021-01-20 22:17   ` Khem Raj
2021-01-21  7:26     ` Oleksiy Obitotskyy
2021-01-21  9:08       ` Richard Purdie

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.