All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK
@ 2009-07-17 11:20 Roman I Khimov
  2009-07-17 12:22 ` Andrea Adami
  2009-07-17 14:58 ` Khem Raj
  0 siblings, 2 replies; 5+ messages in thread
From: Roman I Khimov @ 2009-07-17 11:20 UTC (permalink / raw)
  To: openembedded-devel

Currently we're keeping .gnu_debuglink section in files after stripping them.
It makes binaries from successive builds a bit different, which is not good
in situations where you want them to be exactly the same (identical checksums).

So, introducing KEEP_GNU_DEBUGLINK which can be set to zero to disable this
behavior and get identical result on successive builds for most of the
packages.
---
 classes/package.bbclass |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/classes/package.bbclass b/classes/package.bbclass
index f6bd7c5..5425789 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -192,7 +192,9 @@ def runstrip(file, d):
 
     os.system("%s'%s' --only-keep-debug '%s' '%s'" % (pathprefix, objcopy, file, debugfile))
     ret = os.system("%s%s" % (pathprefix, stripcmd))
-    os.system("%s'%s' --add-gnu-debuglink='%s' '%s'" % (pathprefix, objcopy, debugfile, file))
+    debuglink = bb.data.getVar('KEEP_GNU_DEBUGLINK', d, 1) or '1'
+    if debuglink != '0':
+        os.system("%s'%s' --add-gnu-debuglink='%s' '%s'" % (pathprefix, objcopy, debugfile, file))
 
     if newmode:
         os.chmod(file, origmode)
-- 
1.6.3.3




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

* Re: [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK
  2009-07-17 11:20 [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK Roman I Khimov
@ 2009-07-17 12:22 ` Andrea Adami
  2009-07-17 14:58 ` Khem Raj
  1 sibling, 0 replies; 5+ messages in thread
From: Andrea Adami @ 2009-07-17 12:22 UTC (permalink / raw)
  To: openembedded-devel

Ah, that's explain the different checksums then...
Nice catch, thx.

BTW Gentoo offers the interesting "splitdebug" option see:
http://www.gentoo.org/proj/en/qa/backtraces.xml

Regards
Andrea



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

* Re: [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK
  2009-07-17 11:20 [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK Roman I Khimov
  2009-07-17 12:22 ` Andrea Adami
@ 2009-07-17 14:58 ` Khem Raj
  2009-07-17 17:50   ` Roman I Khimov
  1 sibling, 1 reply; 5+ messages in thread
From: Khem Raj @ 2009-07-17 14:58 UTC (permalink / raw)
  To: openembedded-devel

On (17/07/09 15:20), Roman I Khimov wrote:
> Currently we're keeping .gnu_debuglink section in files after stripping them.
> It makes binaries from successive builds a bit different, which is not good
> in situations where you want them to be exactly the same (identical checksums).
> 
> So, introducing KEEP_GNU_DEBUGLINK which can be set to zero to disable this
> behavior and get identical result on successive builds for most of the
> packages.

you lose debugging these binaries if you remove this section. So may be
there should be options like DEBUG_STRIP, STRIP and NO_STRIP and only one of
which could be used.

Thx

-Khem



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

* Re: [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK
  2009-07-17 14:58 ` Khem Raj
@ 2009-07-17 17:50   ` Roman I Khimov
  2009-07-17 18:49     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Roman I Khimov @ 2009-07-17 17:50 UTC (permalink / raw)
  To: openembedded-devel

On Пятница 17 июля 2009 18:58:37 Khem Raj wrote:
> On (17/07/09 15:20), Roman I Khimov wrote:
> > Currently we're keeping .gnu_debuglink section in files after stripping
> > them. It makes binaries from successive builds a bit different, which is
> > not good in situations where you want them to be exactly the same
> > (identical checksums).
> >
> > So, introducing KEEP_GNU_DEBUGLINK which can be set to zero to disable
> > this behavior and get identical result on successive builds for most of
> > the packages.
>
> you lose debugging these binaries if you remove this section. 

Yep.

> So may be
> there should be options like DEBUG_STRIP, STRIP and NO_STRIP and only one
> of which could be used.

As of now, we have INHIBIT_PACKAGE_STRIP that switches stripping, but it has 
strong on/off semantics, so I don't think we can change that. We can replace 
it with some common PACKAGE_STRIP setting that would work like this:

# No stripping
PACKAGE_STRIP=no
# Strip but leave .gnu_debuglink for debugging
PACKAGE_STRIP=debug
# Strip everything
PACKAGE_STRIP=full

But that's more intrusive and will force distro and local config updates. I 
can do it if everyone is OK with such change.

And, BTW, we also have DEBUG_BUILD setting, although that just switches 
compile flags from what I see.



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

* Re: [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK
  2009-07-17 17:50   ` Roman I Khimov
@ 2009-07-17 18:49     ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2009-07-17 18:49 UTC (permalink / raw)
  To: openembedded-devel

On (17/07/09 21:50), Roman I Khimov wrote:
> On Пятница 17 июля 2009 18:58:37 Khem Raj wrote:
> > On (17/07/09 15:20), Roman I Khimov wrote:
> > > Currently we're keeping .gnu_debuglink section in files after stripping
> > > them. It makes binaries from successive builds a bit different, which is
> > > not good in situations where you want them to be exactly the same
> > > (identical checksums).
> > >
> > > So, introducing KEEP_GNU_DEBUGLINK which can be set to zero to disable
> > > this behavior and get identical result on successive builds for most of
> > > the packages.
> >
> > you lose debugging these binaries if you remove this section. 
> 
> Yep.
> 
> > So may be
> > there should be options like DEBUG_STRIP, STRIP and NO_STRIP and only one
> > of which could be used.
> 
> As of now, we have INHIBIT_PACKAGE_STRIP that switches stripping, but it has 
> strong on/off semantics, so I don't think we can change that. We can replace 
> it with some common PACKAGE_STRIP setting that would work like this:
> 
> # No stripping
> PACKAGE_STRIP=no
> # Strip but leave .gnu_debuglink for debugging
> PACKAGE_STRIP=debug
> # Strip everything
> PACKAGE_STRIP=full
> 
> But that's more intrusive and will force distro and local config updates. I 
> can do it if everyone is OK with such change.

go for it

> 
> And, BTW, we also have DEBUG_BUILD setting, although that just switches 
> compile flags from what I see.
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

end of thread, other threads:[~2009-07-17 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-17 11:20 [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK Roman I Khimov
2009-07-17 12:22 ` Andrea Adami
2009-07-17 14:58 ` Khem Raj
2009-07-17 17:50   ` Roman I Khimov
2009-07-17 18:49     ` Khem Raj

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.