Merge branch 'cross-strip' into 'master'

Draft: abuild: simplify cross strip

See merge request alpine/abuild!287
This commit is contained in:
Sertonix 2024-04-26 21:13:13 +00:00
commit 7628aef580
1 changed files with 1 additions and 8 deletions

View File

@ -2646,13 +2646,6 @@ stripbin() {
fi
cd "${subpkgdir:-$pkgdir}" || return 1
local stripcmd=strip
case "${subpkgarch:-$pkgarch}" in
$CBUILD_ARCH) stripcmd="strip" ;;
$CARCH) stripcmd="${CHOST}-strip" ;;
$CTARGET_ARCH) stripcmd="${CTARGET}-strip" ;;
esac
msg "Stripping binaries"
scanelf --recursive --nobanner --osabi --etype "ET_DYN,ET_EXEC" . \
| while read type osabi filename; do
@ -2662,7 +2655,7 @@ stripbin() {
[ "$osabi" != "STANDALONE" ] || continue
local XATTR=$(getfattr --match="" --dump "${filename}")
"${stripcmd}" "${filename}"
${CROSS_COMPILE}strip "${filename}"
if [ -n "$XATTR" ]; then
echo "$XATTR" | "$SETFATTR" --restore=-
fi