aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-preserve-xattrs-when-creating-dbg.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/abuild/0001-abuild-preserve-xattrs-when-creating-dbg.patch')
-rw-r--r--main/abuild/0001-abuild-preserve-xattrs-when-creating-dbg.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/abuild/0001-abuild-preserve-xattrs-when-creating-dbg.patch b/main/abuild/0001-abuild-preserve-xattrs-when-creating-dbg.patch
new file mode 100644
index 0000000000..4fd1058bf4
--- /dev/null
+++ b/main/abuild/0001-abuild-preserve-xattrs-when-creating-dbg.patch
@@ -0,0 +1,41 @@
+From 9d2567f1e6ff75bb5c9dc34b354bdb3d1f02b343 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Thu, 9 Feb 2017 11:30:03 +0000
+Subject: [PATCH] abuild: preserve xattrs when creating -dbg
+
+---
+ abuild.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/abuild.in b/abuild.in
+index a71a2dd..19dedda 100644
+--- a/abuild.in
++++ b/abuild.in
+@@ -1532,10 +1532,12 @@ default_dbg() {
+ mkdir -p $dstdir
+ fi
+ cd $srcdir
++ local XATTR=$(getfattr --match="" --dump "${srcfile}")
+ ${CROSS_COMPILE}objcopy --only-keep-debug $srcfile $dstfile
+ ${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
+ mv $dstfile $dstdir
+ ${CROSS_COMPILE}strip $srcfile
++ [ -n "$XATTR" ] && { echo "$XATTR" | setfattr --restore=-; }
+ done
+ return 0
+ }
+@@ -1978,9 +1980,9 @@ stripbin() {
+ 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}")
++ local XATTR=$(getfattr --match="" --dump "${filename}")
+ "${stripcmd}" "${filename}"
+- [ -n "$XATTR" ] && (echo "$XATTR" | setfattr --restore=-)
++ [ -n "$XATTR" ] && { echo "$XATTR" | setfattr --restore=-; }
+ done
+ }
+
+--
+2.11.1
+