aboutsummaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorGravatar Pascal Huerst <pascal.huerst@gmail.com>2014-07-31 22:08:55 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-31 23:10:19 +0200
commit09a1a10f4828be8a76cf2b9c6aa6a401a6dbcfc5 (patch)
treeafa380948ac9c77ee9087c3f1ee2bd558b443b10 /package
parentdc6576e7baaca3c3ea47d5091eb29862c0de4c5e (diff)
downloadbuildroot-09a1a10f4828be8a76cf2b9c6aa6a401a6dbcfc5.tar.gz
buildroot-09a1a10f4828be8a76cf2b9c6aa6a401a6dbcfc5.tar.bz2
google-breakpad: integration into Makefile and Config.in
Add a new config option that allows to specify a list of files to dump symbols from, and generate a database of symbols, in stagins/usr/share/google-breakpad/. Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com> [yann.morin.1998@free.fr: add dependency on the host variant; fix script; add commit log] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: remove leftover debugging, rewrap Config.in help text, propagate dependencies correctly.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package')
-rwxr-xr-xpackage/google-breakpad/gen-syms.sh34
-rw-r--r--package/google-breakpad/google-breakpad.mk9
2 files changed, 43 insertions, 0 deletions
diff --git a/package/google-breakpad/gen-syms.sh b/package/google-breakpad/gen-syms.sh
new file mode 100755
index 0000000000..2bc0afafb6
--- /dev/null
+++ b/package/google-breakpad/gen-syms.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+NAME="${0##*/}"
+STAGING_DIR="${1}"
+TARGET_DIR="${2}"
+shift 2
+
+SYMBOLS_DIR="${STAGING_DIR}/usr/share/google-breakpad-symbols"
+rm -rf "${SYMBOLS_DIR}"
+mkdir -p "${SYMBOLS_DIR}"
+
+error() {
+ fmt="${1}"; shift
+ printf "%s: ${fmt}" "${NAME}" "${@}" >&2
+ exit 1
+}
+
+for FILE in ${@}; do
+ f="${TARGET_DIR}${FILE}"
+ if [ ! -e "${f}" ]; then
+ error "%s: No such file or directory\n" "${FILE}"
+ fi
+ if [ -d "${f}" ]; then
+ error "%s: Is a directory\n" "${FILE}"
+ fi
+ if dump_syms "${f}" > "${SYMBOLS_DIR}/tmp.sym" 2>/dev/null; then
+ hash=$(head -n1 "${SYMBOLS_DIR}/tmp.sym" | cut -d ' ' -f 4);
+ filename=$(basename "${FILE}");
+ mkdir -p "${SYMBOLS_DIR}/${filename}/${hash}"
+ mv "${SYMBOLS_DIR}/tmp.sym" "${SYMBOLS_DIR}/${filename}/${hash}/${filename}.sym";
+ else
+ error "Error dumping symbols for: '%s'\n" "${FILE}"
+ fi
+done
+rm -rf "${SYMBOLS_DIR}/tmp"
diff --git a/package/google-breakpad/google-breakpad.mk b/package/google-breakpad/google-breakpad.mk
index bf857ba80c..add5d7a34f 100644
--- a/package/google-breakpad/google-breakpad.mk
+++ b/package/google-breakpad/google-breakpad.mk
@@ -14,5 +14,14 @@ GOOGLE_BREAKPAD_INSTALL_STAGING = YES
GOOGLE_BREAKPAD_LICENSE = BSD-3c
GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE
+ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y)
+GOOGLE_BREAKPAD_DEPENDENCIES = host-google-breakpad
+define GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
+ $(EXTRA_ENV) package/google-breakpad/gen-syms.sh $(STAGING_DIR) \
+ $(TARGET_DIR) $(call qstrip,$(BR2_GOOGLE_BREAKPAD_INCLUDE_FILES))
+endef
+TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
+endif
+
$(eval $(autotools-package))
$(eval $(host-autotools-package))