Skip to content

Commit

Permalink
misc-functions.sh: Sort NEEDED and NEEDED.ELF.2
Browse files Browse the repository at this point in the history
I've noticed that scalelf doesn't produce deterministic output. This
change adds a sort to the NEEDED and NEEDED.ELF.2 files to remove a
source of non-determinism when building binpkgs.

This change was cherry picked from:
https://chromium-review.googlesource.com/c/chromiumos/third_party/portage_tool/+/4018820/2/bin/misc-functions.sh

Bug: https://bugs.gentoo.org/914441
Signed-off-by: Raul E Rangel <[email protected]>
  • Loading branch information
Raul E Rangel committed Apr 24, 2024
1 parent 08a2bc3 commit 226706b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/misc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ install_qa_check() {
echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
echo "${arch#EM_};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
done <<< ${scanelf_output}

# scanelf's output ordering is non-deterministic.
local needed
for needed in "${PORTAGE_BUILDDIR}"/build-info/NEEDED{,.ELF.2}; do
LC_ALL=C sort -o "${needed}" "${needed}"
done
fi

[[ -n "${QA_SONAME_NO_SYMLINK}" ]] && \
Expand Down

0 comments on commit 226706b

Please sign in to comment.