[oe-commits] Richard Purdie : lib/oe/package: Ensure strip breaks hardlinks

git at git.openembedded.org git at git.openembedded.org
Wed Feb 11 17:40:40 UTC 2015


Module: openembedded-core.git
Branch: dizzy
Commit: a7d0115d286e0b6c7d1f22a201e61a2360e40eb2
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a7d0115d286e0b6c7d1f22a201e61a2360e40eb2

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Wed Jan 21 11:34:50 2015 +0000

lib/oe/package: Ensure strip breaks hardlinks

Normally, strip preserves hardlinks which in the case of the way our hardlink
rather than copy functionality works, is a disadvantage and leads to non-deterministic
builds. This adds a move into place after the strip operation to ensure hardlinks
are broken and we bring back build determinism.

(From OE-Core rev: 7c0fd561bad0250a00cef63e3d787573112a59cf)

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808 at gmail.com>

---

 meta/lib/oe/package.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index f8b5322..a26a631 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -30,7 +30,8 @@ def runstrip(arg):
     elif elftype & 8 or elftype & 4:
         extraflags = "--remove-section=.comment --remove-section=.note"
 
-    stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+    # Use mv to break hardlinks
+    stripcmd = "'%s' %s '%s' -o '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file)
     bb.debug(1, "runstrip: %s" % stripcmd)
 
     ret = subprocess.call(stripcmd, shell=True)



More information about the Openembedded-commits mailing list