google-breakpad: Integration into Makefile and Config.in
cover google-breakpad: Integration into Makefile and Config.in
Changes v5 -> v6
google-breakpad: new package has been accepted.
Moved parts from makefile into google-breakpad.mk and defined
the call to gen-symy.sh as a new variable in google-breakpas.mk. This seems to be more compatible with fabios series, as suggested by Arnout and Thomas.
Changed integration in Config.in, by adding an enable google breakpad
option which expands to a list to insert filenames as suggested by Arnout and Thomas.
Removed creation of tmp directory in gen-symy.sh as sugested
by Arnout, since this is not necessary.
Changes v4 -> v5 (All suggested by Yann E. MORIN)
Fixed some typo
Reorganized patch structure
which parts belong to 'new package' and which parts belong to 'intergration into Makefile and Config.in'
Changed and Rewrote gen-symy.sh - script
Passing $(EXTRA_ENV)
Adapted a proposed solution from Yann E. MORIN, which uses ls instead of find commands
Made better descriptions for users in:
Config.in
package/google-breakpad/Config.in
Changes v3 -> v4
Fixed minor issue in google-breakpad_gen-syms.sh
Had to remove -print from find command
Changes v2 -> v3 (All suggested by thomas.petazzoni at free-electrons.com)
Removed dependency of BR2_ENABLE_DEBUG, but added comment,
that this flag might have to be set in order to use breakpad properly.
Removed "find -name ..." for libs and binaries by generic patterns,
such as "*.so" and so forth. This will never work properly. Instead I added a list to insert libs and binaries, that will be symbol- dumped and prepared for breakpad (see Config.in patch v3 2/2)
Changed storage path for dumps from: $(TARGET_DIR).. to
$(STAGING_DIR)/usr/share/google-breakpad-symbols/
Removed most logic from Makefile. Added script instead, which is
called by Makefile
Added dependency for compatible targets: ARM, i386, MIPS... Set fixed version for checkout (instead of head)
Fixed typos, and some minor mistakes
Changes v1 -> v2 (All suggested by maxime.hadjinlian at gmail.com)
Added dependency from BR2_ENABLE_DEBUG
Removed symbolstore.py -> Its all done in Makefile now Removed new Target -> It in target-finalize before stripping now Added LICENSE and LICENSE_FILE to *.mk
Pascal Huerst (1):
google-breakpad: Integration into Makefile and Config.in
Config.in | 28 ++++++++++++++++++++++++++++ package/google-breakpad/gen-syms.sh | 25 +++++++++++++++++++++++++ package/google-breakpad/google-breakpad.mk | 8 ++++++++ 3 files changed, 61 insertions(+) create mode 100755 package/google-breakpad/gen-syms.sh
Signature · 1 line
1.9.3
PATCH 1/1 google-breakpad: Integration into Makefile and Config.in
--- Config.in | 28 ++++++++++++++++++++++++++++ package/google-breakpad/gen-syms.sh | 25 +++++++++++++++++++++++++ package/google-breakpad/google-breakpad.mk | 8 ++++++++ 3 files changed, 61 insertions(+) create mode 100755 package/google-breakpad/gen-syms.sh
Config.in +28 -0
@@ -484,6 +484,34 @@ config BR2_OPTIMIZE_S endchoice +config BR2_GOOGLE_BREAKPAD_ENABLE + bool "Enable google-breakpad support" + select BR2_PACKAGE_GOOGLE_BREAKPAD + help + This option will enable the use of google breakpad, a library and tool + suite that allows you to distribute an application to users with + compiler-provided debugging information removed, record crashes in + compact "minidump" files, send them back to your server and produce + C and C++ stack traces from these minidumps. Breakpad can also write + minidumps on request for programs that have not crashed. + +if BR2_GOOGLE_BREAKPAD_ENABLE + +config BR2_GOOGLE_BREAKPAD_INCLUDE_FILES + string "List of executables and libraries to extract symbols from" + default "" + help + You may specify a space-separated list of binaries and libraries + with full paths relative to $(TARGET_DIR) of which debug symbols + will be dumped for further use with google breakpad. + + A directory structure that can be used by minidump-stackwalk will + be created at: + + $(STAGING_DIR)/usr/share/google-breakpad-symbols + +endif + config BR2_ENABLE_SSP bool "build code with Stack Smashing Protection" depends on BR2_TOOLCHAIN_HAS_SSP
package/google-breakpad/gen-syms.sh new file +25 -0
@@ -0,0 +1,25 @@ +#!/bin/sh +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}" + +for FILE in $(eval ls "${TARGET_DIR}/${@}"); do + if [ -d "${FILE}" ]; then + printf "Error: '%s' is a directory\n" "${FILE}" >&2 + exit 1 + fi + if dump_syms "${FILE}" > "${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 + printf "Error dumping symbols for: '%s'\n" "${FILE}" >&2 + exit 1 + fi +done +rm -rf "${SYMBOLS_DIR}/tmp"
package/google-breakpad/google-breakpad.mk +8 -0
@@ -14,5 +14,13 @@ GOOGLE_BREAKPAD_INSTALL_STAGING = YES GOOGLE_BREAKPAD_LICENSE = BSD-3c GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE +#ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y) +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))
Signature · 1 line
1.9.3
PATCH 1/1 google-breakpad: Integration into Makefile and Config.in
Pascal, All,
On 2014-07-15 12:00 +0200, Pascal Huerst spake thusly:
Quoted 8 lines
Signed-off-by Pascal Huerst <[email protected]>--- Config.in | 28 ++++++++++++++++++++++++++++ package/google-breakpad/gen-syms.sh | 25 +++++++++++++++++++++++++ package/google-breakpad/google-breakpad.mk | 8 ++++++++ 3 files changed, 61 insertions(+) create mode 100755 package/google-breakpad/gen-syms.sh
[--SNIP--]
Quoted 6 lines
package/google-breakpad/gen-syms.sh new file +0
-0
package/google-breakpad/gen-syms.sh line 10
Quoted 10 lines
package/google-breakpad/gen-syms.sh new file +10
-0@@ -0,0 +1,25 @@ +#!/bin/sh +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}" + +for FILE in $(eval ls "${TARGET_DIR}/${@}"); do
Why do you use eval here?
Quoted 20 lines
package/google-breakpad/gen-syms.sh new file +15
-0+ if [ -d "${FILE}" ]; then + printf "Error: '%s' is a directory\n" "${FILE}" >&2 + exit 1 + fi + if dump_syms "${FILE}" > "${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 + printf "Error dumping symbols for: '%s'\n" "${FILE}" >&2 + exit 1 + fi +done +rm -rf "${SYMBOLS_DIR}/tmp"package/google-breakpad/google-breakpad.mk +0
-0
package/google-breakpad/google-breakpad.mk GOOGLE_BREAKPAD_INSTALL_STAGING = YES · line 17
Quoted 4 lines
package/google-breakpad/google-breakpad.mk +1
-0@@ -14,5 +14,13 @@ GOOGLE_BREAKPAD_INSTALL_STAGING = YES GOOGLE_BREAKPAD_LICENSE = BSD-3c GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE +#ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y)
Did you forget to un-comment this line?
package/google-breakpad/google-breakpad.mk GOOGLE_BREAKPAD_INSTALL_STAGING = YES · line 23
Quoted 6 lines
package/google-breakpad/google-breakpad.mk +6
-0+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
Ditto.
Regards,
Yann E. MORIN.
Quoted 10 lines
package/google-breakpad/google-breakpad.mk +1
-0+ $(eval $(autotools-package)) $(eval $(host-autotools-package))Signature · 6 lines
1.9.3 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 google-breakpad: Integration into Makefile and Config.in
Hey Yann, all,
Quoted 22 lines · Yann E. MORIN
Pascal, All,
On 2014-07-15 12:00 +0200, Pascal Huerst spake thusly:
Quoted 8 lines
Signed-off-by Pascal Huerst <[email protected]>--- Config.in | 28 ++++++++++++++++++++++++++++ package/google-breakpad/gen-syms.sh | 25 +++++++++++++++++++++++++ package/google-breakpad/google-breakpad.mk | 8 ++++++++ 3 files changed, 61 insertions(+) create mode 100755 package/google-breakpad/gen-syms.sh[--SNIP--]
Quoted 10 lines
package/google-breakpad/gen-syms.sh new file +4
-0@@ -0,0 +1,25 @@ +#!/bin/sh +STAGING_DIR="${1}" +TARGET_DIR="${2}" +shift 2
Quoted 8 lines
package/google-breakpad/gen-syms.sh line 10
Quoted 6 lines
package/google-breakpad/gen-syms.sh new file +6
-0+ +SYMBOLS_DIR="${STAGING_DIR}/usr/share/google-breakpad-symbols" +rm -rf "${SYMBOLS_DIR}" +mkdir -p "${SYMBOLS_DIR}" + +for FILE in $(eval ls "${TARGET_DIR}/${@}"); doWhy do you use eval here?
If I remove eval it does not work, but I don't know why?
Quoted 23 lines
Quoted 23 lines
package/google-breakpad/gen-syms.sh new file +15
-0+ if [ -d "${FILE}" ]; then + printf "Error: '%s' is a directory\n" "${FILE}" >&2 + exit 1 + fi + if dump_syms "${FILE}" > "${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 + printf "Error dumping symbols for: '%s'\n" "${FILE}" >&2 + exit 1 + fi +done +rm -rf "${SYMBOLS_DIR}/tmp"package/google-breakpad/google-breakpad.mk +0
-0@@ -14,5 +14,13 @@ GOOGLE_BREAKPAD_INSTALL_STAGING = YES GOOGLE_BREAKPAD_LICENSE = BSD-3c GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE
Quoted 3 lines
package/google-breakpad/google-breakpad.mk GOOGLE_BREAKPAD_INSTALL_STAGING = YES · line 17
Quoted 1 line
package/google-breakpad/google-breakpad.mk +1
-0+#ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y)Did you forget to un-comment this line?
Oh... you're right, fixed that.
Quoted 8 lines
package/google-breakpad/google-breakpad.mk GOOGLE_BREAKPAD_INSTALL_STAGING = YES · line 23
Quoted 6 lines
package/google-breakpad/google-breakpad.mk +6
-0+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 +#endifDitto.
yes, again!
Quoted 14 lines
Regards,
Yann E. MORIN.Quoted 10 lines
package/google-breakpad/google-breakpad.mk +1
-0+ $(eval $(autotools-package)) $(eval $(host-autotools-package))Signature · 6 lines
1.9.3 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot