abuild: use proper strip for each subpkg according to it's arch
This commit is contained in:
parent
b217bbb2ea
commit
f459607da7
23
abuild.in
23
abuild.in
|
@ -132,13 +132,6 @@ default_sanitycheck() {
|
|||
esac
|
||||
done
|
||||
|
||||
# check if CARCH, CBUILD, CHOST and CTARGET is set
|
||||
[ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
|
||||
|
||||
if [ -z "$CARCH" ]; then
|
||||
die "Please fix CHOST, or set CARCH in abuild.conf"
|
||||
fi
|
||||
|
||||
for i in $install; do
|
||||
local n=${i%.*}
|
||||
local suff=${i##*.}
|
||||
|
@ -1502,10 +1495,10 @@ default_dbg() {
|
|||
mkdir -p $dstdir
|
||||
fi
|
||||
cd $srcdir
|
||||
objcopy --only-keep-debug $srcfile $dstfile
|
||||
objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
|
||||
${CROSS_COMPILE}objcopy --only-keep-debug $srcfile $dstfile
|
||||
${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
|
||||
mv $dstfile $dstdir
|
||||
strip $srcfile
|
||||
${CROSS_COMPILE}strip $srcfile
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
@ -1934,12 +1927,20 @@ stripbin() {
|
|||
return 0
|
||||
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 --etype "ET_DYN,ET_EXEC" . \
|
||||
| sed -e 's:^ET_DYN ::' -e 's:^ET_EXEC ::' \
|
||||
| while read filename; do
|
||||
XATTR=$(getfattr --match="" --dump "${filename}")
|
||||
${CROSS_COMPILE}strip "${filename}"
|
||||
"${stripcmd}" "${filename}"
|
||||
[ -n "$XATTR" ] && (echo "$XATTR" | setfattr --restore=-)
|
||||
done
|
||||
}
|
||||
|
|
|
@ -106,6 +106,7 @@ readconfig() {
|
|||
|
||||
[ -z "$CARCH" ] && CARCH="$(hostspec_to_arch $CHOST)"
|
||||
[ -z "$CLIBC" ] && CLIBC="$(hostspec_to_libc $CHOST)"
|
||||
[ -z "$CBUILD_ARCH" ] && CBUILD_ARCH="$(hostspec_to_arch $CBUILD)"
|
||||
[ -z "$CTARGET_ARCH" ] && CTARGET_ARCH="$(hostspec_to_arch $CTARGET)"
|
||||
[ -z "$CTARGET_LIBC" ] && CTARGET_LIBC="$(hostspec_to_libc $CTARGET)"
|
||||
|
||||
|
|
Loading…
Reference in New Issue