From 01ed479a8e270be8bdc36b1accd4b484a9107f51 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 4 May 2021 11:44:34 +0200 Subject: libre: linux-libre-64: fix strip Without that fix, on Parabola armv7h we have: | Stripping vmlinux... | strip: /build/linux-libre-64/pkg/linux-libre-64-headers/usr/lib/modules/5.11.11-gnu-2-64-ARCH/build/vmlinux: file format not recognized | ==> ERROR: A failure occurred in package_linux-libre-64-headers(). | Aborting... ==> Copying log and package files out of the chroot... And after entering the chroot again, running file on vmlinux in usr/lib/modules/5.11.11-gnu-2-64-ARCH/build/ in build/linux-libre-64/pkg/linux-libre-64-headers/ gives the following: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=61b2acea5733ab812f33e872c462a54e7e71fbeb, not stripped So the file is not recognized because we use the host strip instead of the cross compiler's strip. Signed-off-by: Denis 'GNUtoo' Carikli --- libre/linux-libre-64/PKGBUILD | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'libre/linux-libre-64') diff --git a/libre/linux-libre-64/PKGBUILD b/libre/linux-libre-64/PKGBUILD index 78e7933d5..233d390b0 100644 --- a/libre/linux-libre-64/PKGBUILD +++ b/libre/linux-libre-64/PKGBUILD @@ -9,7 +9,7 @@ _replacesoldmodules=() # '%' gets replaced with kernel suffix pkgbase=linux-libre-64 pkgver=5.11.11 -pkgrel=2 +pkgrel=3 pkgdesc="64bit Linux-libre for Parabola $CARCH" rcnver=5.11.11 rcnrel=armv7-x14 @@ -118,6 +118,8 @@ case "$CARCH" in armv7h) KARCH=arm64;CROSS_COMPILE=aarch64-linux-gnu-;; esac +export STRIP=${CROSS_COMPILE}strip + export KBUILD_BUILD_HOST=parabola export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" @@ -306,18 +308,18 @@ _package-headers() { while read -rd '' file; do case "$(file -bi "$file")" in application/x-sharedlib\;*) # Libraries (.so) - strip -v $STRIP_SHARED "$file" ;; + ${STRIP} -v $STRIP_SHARED "$file" ;; application/x-archive\;*) # Libraries (.a) - strip -v $STRIP_STATIC "$file" ;; + ${STRIP} -v $STRIP_STATIC "$file" ;; application/x-executable\;*) # Binaries - strip -v $STRIP_BINARIES "$file" ;; + ${STRIP} -v $STRIP_BINARIES "$file" ;; application/x-pie-executable\;*) # Relocatable binaries - strip -v $STRIP_SHARED "$file" ;; + ${STRIP} -v $STRIP_SHARED "$file" ;; esac done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0) echo "Stripping vmlinux..." - strip -v $STRIP_STATIC "$builddir/vmlinux" + ${STRIP} -v $STRIP_STATIC "$builddir/vmlinux" echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" -- cgit v1.2.3