Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 432450 Details for
Bug 581470
sys-boot/vboot-utils-42_p20150219 with musl - fatal error: execinfo.h: No such file or directory
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Upstream patch
vboot-utils-42_p20150219-execinfo.patch (text/plain), 2.74 KB, created by
Felix Janda
on 2016-04-28 18:52:47 UTC
(
hide
)
Description:
Upstream patch
Filename:
MIME Type:
Creator:
Felix Janda
Created:
2016-04-28 18:52:47 UTC
Size:
2.74 KB
patch
obsolete
>From 58cb8c532b0909edb34d17c7fd32b0559b917eb9 Mon Sep 17 00:00:00 2001 >From: Doug Evans <dje@google.com> >Date: Thu, 19 Nov 2015 15:57:23 -0800 >Subject: [PATCH] Port to musl: musl doesn't have execinfo.h. > >Change-Id: Idc2f18880581d3a2e67185becee8b77cfa5cdf04 >Reviewed-on: https://chromium-review.googlesource.com/313388 >Commit-Ready: Doug Evans <dje@google.com> >Tested-by: Doug Evans <dje@google.com> >Reviewed-by: Randall Spangler <rspangler@chromium.org> >--- > Makefile | 5 +++++ > firmware/stub/vboot_api_stub_sf.c | 15 +++++++++++++++ > 2 files changed, 20 insertions(+) > >diff --git a/Makefile b/Makefile >index d066916..944ae73 100644 >--- a/Makefile >+++ b/Makefile >@@ -205,6 +205,11 @@ ifdef HAVE_MACOS > CFLAGS += -DHAVE_MACOS -Wno-deprecated-declarations > endif > >+# Musl doesn't have execinfo.h. >+ifndef HAVE_MUSL >+ CFLAGS += -DHAVE_EXECINFO_H >+endif >+ > # And a few more default utilities > LD = ${CC} > CXX ?= g++ >diff --git a/firmware/stub/vboot_api_stub_sf.c b/firmware/stub/vboot_api_stub_sf.c >index 3c5ec85..76d45ee 100644 >--- a/firmware/stub/vboot_api_stub_sf.c >+++ b/firmware/stub/vboot_api_stub_sf.c >@@ -5,7 +5,12 @@ > * Stub implementations of firmware-provided API functions. > */ > >+/* Musl doesn't have execinfo.h. >+ TODO(dje): Add a replacement (libunwind) if/when fnl needs it. */ >+#ifdef HAVE_EXECINFO_H > #include <execinfo.h> >+#endif >+ > #include <stdint.h> > > #define _STUB_IMPLEMENTATION_ >@@ -26,12 +31,15 @@ struct alloc_node { > struct alloc_node *next; > void *ptr; > size_t size; >+#ifdef HAVE_EXECINFO_H > void *bt_buffer[MAX_STACK_LEVELS]; > int bt_levels; >+#endif > }; > > static struct alloc_node *alloc_head; > >+#ifdef HAVE_EXECINFO_H > static void print_stacktrace(void) > { > void *buffer[MAX_STACK_LEVELS]; >@@ -40,6 +48,7 @@ static void print_stacktrace(void) > // print to stderr (fd = 2), and remove this function from the trace > backtrace_symbols_fd(buffer + 1, levels - 1, 2); > } >+#endif > > void *VbExMalloc(size_t size) > { >@@ -57,7 +66,9 @@ void *VbExMalloc(size_t size) > node->next = alloc_head; > node->ptr = p; > node->size = size; >+#ifdef HAVE_EXECINFO_H > node->bt_levels = backtrace(node->bt_buffer, MAX_STACK_LEVELS); >+#endif > alloc_head = node; > > return p; >@@ -86,7 +97,9 @@ void VbExFree(void *ptr) > } else { > fprintf(stderr, "\n>>>>>> Invalid VbExFree() %p\n", ptr); > fflush(stderr); >+#ifdef HAVE_EXECINFO_H > print_stacktrace(); >+#endif > /* > * Fall through and do the free() so we get normal error > * handling. >@@ -118,8 +131,10 @@ int vboot_api_stub_check_memory(void) > next = node->next; > fprintf(stderr, "\nptr=%p, size=%zd\n", node->ptr, node->size); > fflush(stderr); >+#ifdef HAVE_EXECINFO_H > backtrace_symbols_fd(node->bt_buffer + 1, node->bt_levels - 1, > 2); >+#endif > free(node); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 581470
: 432450