Merge pull request #227762 from raboof/separate-debug-info-deterministically

setup-hooks/separate-debug-info.sh: make deterministic
This commit is contained in:
Guillaume Girol 2023-04-23 13:41:09 +00:00 committed by GitHub
commit 56009de17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,10 +36,14 @@ _separateDebugInfo() {
# architecture than we're building for. (This happens with
# firmware blobs in QEMU.)
(
if [ -f "$dst/${id:0:2}/${id:2}.debug" ]
then
echo "separate-debug-info: warning: multiple files with build id $id found, overwriting"
fi
$OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
# Also a create a symlink <original-name>.debug.
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
) || rmdir -p "$dst/${id:0:2}"
done < <(find "$prefix" -type f -print0)
done < <(find "$prefix" -type f -print0 | sort -z)
}