From a96f3c86c03deb09d87dd69ba24c0f29b7cd488d Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 3 Jan 2017 14:45:04 -0700 Subject: [PATCH] Revert "Drop now-unnecessary -dbg bits" This reverts commit 91b303278497e23fb4644aabb0b70e541f71c7c0. We need these explicitly listed in order to ensure we don't just package the files, but extract them from the sysroot. The best approach would be to identify elf binaries the way package.bbclass does, and extract the debuglink path to determine the files to include, but that can be a future enhancement. JIRA: SB-8524 Signed-off-by: Christopher Larson --- classes/external-toolchain.bbclass | 23 ++++++++++++++++++++ recipes-external/gcc/gcc-runtime-external.bb | 1 + recipes-external/gcc/libgcc-external.bb | 1 + 3 files changed, 25 insertions(+) diff --git a/classes/external-toolchain.bbclass b/classes/external-toolchain.bbclass index fb5842a..9eb64f3 100644 --- a/classes/external-toolchain.bbclass +++ b/classes/external-toolchain.bbclass @@ -137,6 +137,29 @@ FILES_${PN}-staticdev = "" FILES_${PN}-doc = "" FILES_${PN}-locale = "" +def debug_paths(d): + l = d.createCopy() + l.finalize() + paths = [] + exclude = [ + l.getVar('datadir', True), + l.getVar('includedir', True), + ] + for p in l.getVar('PACKAGES', True).split(): + if p.endswith('-dbg'): + continue + for f in (l.getVar('FILES_%s' % p, True) or '').split(): + if any((f == x or f.startswith(x + '/')) for x in exclude): + continue + d = os.path.dirname(f) + b = os.path.basename(f) + paths.append('/usr/lib/debug{0}/{1}.debug'.format(d, b)) + paths.append('{0}/.debug/{1}'.format(d, b)) + paths.append('{0}/.debug/{1}.debug'.format(d, b)) + return set(paths) + +FILES_${PN}-dbg = "${@' '.join(debug_paths(d))}" + # do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata" # do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" # do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" diff --git a/recipes-external/gcc/gcc-runtime-external.bb b/recipes-external/gcc/gcc-runtime-external.bb index 72aef4c..af9a6e9 100644 --- a/recipes-external/gcc/gcc-runtime-external.bb +++ b/recipes-external/gcc/gcc-runtime-external.bb @@ -45,6 +45,7 @@ do_install_extra () { done } +FILES_${PN}-dbg += "${datadir}/gdb/python/libstdcxx" FILES_libstdc++-dev = "\ ${includedir}/c++ \ ${libdir}/libstdc++.so \ diff --git a/recipes-external/gcc/libgcc-external.bb b/recipes-external/gcc/libgcc-external.bb index 11579d8..7bb7020 100644 --- a/recipes-external/gcc/libgcc-external.bb +++ b/recipes-external/gcc/libgcc-external.bb @@ -33,3 +33,4 @@ FILES_${PN}-dev = "${base_libdir}/libgcc_s.so \ ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/libgcov.a \ " INSANE_SKIP_${PN}-dev += "staticdev" +FILES_${PN}-dbg += "${base_libdir}/.debug/libgcc_s.so.*.debug"