setup-hooks/separate-debug-info.sh: make deterministic
If multiple files with the same build id were found, we silently randomly overwrote one with the other. Change the order to make the output deterministic, and emit a warning when overwriting.
This commit is contained in:
parent
645bc49f34
commit
9156daa547
|
@ -36,10 +36,14 @@ _separateDebugInfo() {
|
||||||
# architecture than we're building for. (This happens with
|
# architecture than we're building for. (This happens with
|
||||||
# firmware blobs in QEMU.)
|
# 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"
|
$OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
|
||||||
|
|
||||||
# Also a create a symlink <original-name>.debug.
|
# Also a create a symlink <original-name>.debug.
|
||||||
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
|
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
|
||||||
) || rmdir -p "$dst/${id:0:2}"
|
) || rmdir -p "$dst/${id:0:2}"
|
||||||
done < <(find "$prefix" -type f -print0)
|
done < <(find "$prefix" -type f -print0 | sort -z)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue