jobcore/pacman/pacman-split-off-strip-debug.patch
2024-03-01 22:02:29 +02:00

50 lines
1.5 KiB
Diff

From 7a4fff3310ba2eadd3d5428cbb92e58eb2ee853b Mon Sep 17 00:00:00 2001
From: Morten Linderud <morten@linderud.pw>
Date: Wed, 21 Dec 2022 17:52:57 +0100
Subject: [PATCH] strip: split off file stripping and debug package creation
Some projects might duplicate the file in multiple locations for one
reason or another. When debug packages are enabled, `makepkg` will only
strip the first occurrence of the binary and abort early on all the
other binaries.
Signed-off-by: Morten Linderud <morten@linderud.pw>
---
scripts/libmakepkg/tidy/strip.sh.in | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in
index e904080c9..6c435058a 100644
--- a/scripts/libmakepkg/tidy/strip.sh.in
+++ b/scripts/libmakepkg/tidy/strip.sh.in
@@ -66,7 +66,7 @@ package_source_files() {
done < <(source_files "$binary")
}
-strip_file() {
+collect_debug_symbols() {
local binary=$1; shift
if check_option "debug" "y"; then
@@ -118,7 +118,10 @@ strip_file() {
ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug"
fi
fi
+}
+strip_file(){
+ local binary=$1; shift
local tempfile=$(mktemp "$binary.XXXXXX")
if strip "$@" "$binary" -o "$tempfile"; then
cat "$tempfile" > "$binary"
@@ -174,6 +177,7 @@ tidy_strip() {
*)
continue ;;
esac
+ collect_debug_symbols "$binary"
strip_file "$binary" ${strip_flags}
(( STRIPLTO )) && strip_lto "$binary"
done
--
GitLab