Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

estrip: avoid calling scanelf twice #794

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/estrip
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,9 @@ while read -r x ; do
done < <(
# Use sort -u to eliminate duplicates for bug #445336.
(
scanelf -yqRBF '#k%F' -k '.symtab' "$@"
find "$@" -type f ! -type l -name '*.a'
cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \
| sed -e "s:^:${ED}:"
thesamesam marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@heroxbd heroxbd Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build-info/NEEDED is with EPREFIX. The following sed with ED gives double prefix.

) | LC_ALL=C sort -u
)
else
Expand Down
29 changes: 15 additions & 14 deletions bin/misc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ install_qa_check() {
"${PORTAGE_BIN_PATH}"/ecompress --dequeue
fi

# If binpkg-dostrip is enabled, apply stripping before creating
# the binary package.
# Note: disabling it won't help with packages calling prepstrip directly.
if has binpkg-dostrip ${FEATURES}; then
export STRIP_MASK
if ___eapi_has_dostrip; then
"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
"${PORTAGE_BIN_PATH}"/estrip --dequeue
else
prepallstrip
fi
fi

if has chflags $FEATURES ; then
# Restore all the file flags that were saved earlier on.
mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
Expand Down Expand Up @@ -249,6 +235,21 @@ install_qa_check() {
fi
fi

# If binpkg-dostrip is enabled, apply stripping before creating
# the binary package.
# Note: disabling it won't help with packages calling prepstrip directly.
# We do this after the scanelf bits so that we can reuse the data. bug #749624.
if has binpkg-dostrip ${FEATURES}; then
export STRIP_MASK
if ___eapi_has_dostrip; then
"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
"${PORTAGE_BIN_PATH}"/estrip --dequeue
else
prepallstrip
fi
fi

# Portage regenerates this on the installed system.
rm -f "${ED%/}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!"
}
Expand Down