summaryrefslogtreecommitdiffstats
path: root/bin/prepstrip
diff options
context:
space:
mode:
Diffstat (limited to 'bin/prepstrip')
-rwxr-xr-xbin/prepstrip10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/prepstrip b/bin/prepstrip
index 343a53353..47130e694 100755
--- a/bin/prepstrip
+++ b/bin/prepstrip
@@ -24,6 +24,16 @@ save_elf_debug() {
mkdir -p $(dirname ${y})
${CHOST}-objcopy --only-keep-debug ${x} ${y}.debug
${CHOST}-objcopy --add-gnu-debuglink=${y}.debug ${x}
+
+ [ "${FEATURES//*installsources*/true}" != "true" ] && return 0
+
+ if [ -x /usr/bin/debugedit ] ; then
+ debugedit -b ${WORKDIR} -d /usr/src/debug/${P} -l ${T}/debug.sources "$x"
+ if [ -s ${T}/debug.sources ]; then
+ [ -d ${D}/usr/src/debug/${P} ] || mkdir -p ${D}/usr/src/debug/${P}
+ cat ${T}/debug.sources | (cd ${WORKDIR}; LANG=C sort -z -u | xargs -0 -- cp --parents -p --target-directory="${D}/usr/src/debug/${P}" )
+ fi
+ fi
}
for x in $(scanelf -yRBF%F "$@") $(for y in "$@"; do find $y -type f -name '*.a' -print0 ; done); do