diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-07-25 05:50:20 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-08-01 14:28:44 +0300 |
commit | f459607da762d2b574583939ff2bb834d66a47f3 (patch) | |
tree | b76d9630097e1a425b250271cde74e2fd3573535 /abuild.in | |
parent | b217bbb2ea62dec889f0d275855ddf79b2bd9fb7 (diff) | |
download | abuild-f459607da762d2b574583939ff2bb834d66a47f3.tar.gz abuild-f459607da762d2b574583939ff2bb834d66a47f3.tar.bz2 abuild-f459607da762d2b574583939ff2bb834d66a47f3.tar.xz abuild-f459607da762d2b574583939ff2bb834d66a47f3.zip |
abuild: use proper strip for each subpkg according to it's arch
Diffstat (limited to 'abuild.in')
-rw-r--r-- | abuild.in | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -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 } |