[oe] [PATCH] package.bbclass: introduce KEEP_GNU_DEBUGLINK

Roman I Khimov khimov at altell.ru
Fri Jul 17 11:20:12 UTC 2009


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





More information about the Openembedded-devel mailing list