summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-06-03 10:29:47 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-04 09:09:34 +0100
commitde86bfeda6e3845336a0b56c883b49219967128f (patch)
tree54b301dda038a25f0a10acaeae2aff2c93819af0
parent222d485e4eb789307093d57cb3c8d373c2e695b8 (diff)
downloadopenembedded-core-contrib-de86bfeda6e3845336a0b56c883b49219967128f.tar.gz
classes/package: Sort ELF file list
Sorts the list of detected ELF files by path before processing. This ensures that when multiple files are hardlinked together the first one found is always the same. This is required to have reproducible builds. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 4c0a859536..0694855504 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1005,6 +1005,12 @@ python split_and_strip_files () {
symlinks[file] = target
results = oe.utils.multiprocess_launch(oe.package.is_elf, checkelf.keys(), d)
+
+ # Sort results by file path. This ensures that the files are always
+ # processed in the same order, which is important to make sure builds
+ # are reproducible when dealing with hardlinks
+ results.sort(key=lambda x: x[0])
+
for (file, elf_file) in results:
# It's a file (or hardlink), not a link
# ...but is it ELF, and is it already stripped?