diff --git a/srcpkgs/vboot-utils/patches/fix-musl.patch b/srcpkgs/vboot-utils/patches/fix-musl.patch new file mode 100644 index 0000000000..1819bdc2a5 --- /dev/null +++ b/srcpkgs/vboot-utils/patches/fix-musl.patch @@ -0,0 +1,49 @@ +--- firmware/stub/vboot_api_stub_sf.c.orig ++++ firmware/stub/vboot_api_stub_sf.c +@@ -5,7 +5,9 @@ + * Stub implementations of firmware-provided API functions. + */ + ++#if defined(__GLIBC__) + #include ++#endif + #include + + #define _STUB_IMPLEMENTATION_ +@@ -34,11 +36,13 @@ static struct alloc_node *alloc_head; + + static void print_stacktrace(void) + { ++#if defined(__GLIBC__) + void *buffer[MAX_STACK_LEVELS]; + int levels = backtrace(buffer, MAX_STACK_LEVELS); + + // 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 +61,11 @@ void *VbExMalloc(size_t size) + node->next = alloc_head; + node->ptr = p; + node->size = size; ++#if defined(__GLIBC__) + node->bt_levels = backtrace(node->bt_buffer, MAX_STACK_LEVELS); ++#else ++ node->bt_levels = 0; ++#endif + alloc_head = node; + + return p; +@@ -118,8 +126,10 @@ int vboot_api_stub_check_memory(void) + next = node->next; + fprintf(stderr, "\nptr=%p, size=%zd\n", node->ptr, node->size); + fflush(stderr); ++#if defined(__GLIBC__) + backtrace_symbols_fd(node->bt_buffer + 1, node->bt_levels - 1, + 2); ++#endif + free(node); + } + diff --git a/srcpkgs/vboot-utils/template b/srcpkgs/vboot-utils/template index 05437d02cf..e1f2c0af14 100644 --- a/srcpkgs/vboot-utils/template +++ b/srcpkgs/vboot-utils/template @@ -1,8 +1,8 @@ # Template file for 'vboot-utils' pkgname=vboot-utils version=45.7262 +revision=3 _githash=0e8c964915fffb58032bb59bdb31949de718ca90 -revision=2 hostmakedepends="pkg-config git" makedepends="libressl-devel libuuid-devel liblzma-devel libyaml-devel" short_desc="Verified boot kernel utilities" @@ -12,9 +12,9 @@ homepage="https://chromium.googlesource.com/chromiumos/platform/vboot_reference. CFLAGS='-D_GNU_SOURCE -Wno-error' do_fetch() { - git clone https://chromium.googlesource.com/chromiumos/platform/vboot_reference.git $pkgname-$version || true - cd $pkgname-$version - git checkout $_githash + git clone https://chromium.googlesource.com/chromiumos/platform/vboot_reference.git $pkgname-$version || true + cd $pkgname-$version + git checkout $_githash } do_build() {