]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lib/oe/package: Ensure strip breaks hardlinks
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Jan 2015 11:34:50 +0000 (11:34 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Jan 2015 11:35:28 +0000 (11:35 +0000)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oe/package.py

index ea6feaaea4fab390185aec13d5f364dbda34c3a6..7c728fcd231c426e6e7d489eeb64ac18c9122a88 100644 (file)
@@ -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)