From aa2caeb2d3160091527b237e9526b37ea98cf5a9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 28 Dec 2014 10:36:45 +0100 Subject: [PATCH] efivar: portability patch to unbreak musl builds. --- srcpkgs/efivar/patches/portability.patch | 28 ++++++++++++++++++++++++ srcpkgs/efivar/template | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/efivar/patches/portability.patch diff --git a/srcpkgs/efivar/patches/portability.patch b/srcpkgs/efivar/patches/portability.patch new file mode 100644 index 0000000000..e8b31dd96e --- /dev/null +++ b/srcpkgs/efivar/patches/portability.patch @@ -0,0 +1,28 @@ +Portability fixes: + +- Initialize outbuf with the expected size! fixes a segfault with musl. +- Really use __builtin_va_arg_pack_len(). + +--- src/makeguids.c 2014-12-28 10:30:36.731270900 +0100 ++++ src/makeguids.c 2014-12-28 10:26:24.743259656 +0100 +@@ -100,7 +100,7 @@ main(int argc, char *argv[]) + err(1, "makeguids: could not read \"%s\"", argv[1]); + + /* strictly speaking, this *has* to be too large. */ +- struct guidname *outbuf = calloc(inlen, sizeof (char)); ++ struct guidname *outbuf = calloc(inlen, sizeof (struct guidname)); + if (!outbuf) + err(1, "makeguids"); + +--- src/efivar.h 2014-12-28 10:30:36.731270900 +0100 ++++ src/efivar.h 2014-12-28 10:26:57.359261112 +0100 +@@ -85,7 +85,7 @@ efi_set_variable(efi_guid_t guid, const + return -1; + } + +- if (__va_arg_pack_len() == 0) ++ if (__builtin_va_arg_pack_len() == 0) + return _efi_set_variable(guid, name, data, data_size, + attributes, 0644); + + diff --git a/srcpkgs/efivar/template b/srcpkgs/efivar/template index f4c1ede7a4..8004d73ab2 100644 --- a/srcpkgs/efivar/template +++ b/srcpkgs/efivar/template @@ -1,7 +1,7 @@ # Template file for 'efivar' pkgname=efivar version=0.15 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="git" makedepends="popt-devel" @@ -10,7 +10,7 @@ maintainer="Juan RP " license="LGPL-2.1" homepage="https://github.com/vathpela/efivar" -only_for_archs="i686 x86_64" +only_for_archs="i686 i686 x86_64 x86_64-musl" do_fetch() { git clone -b ${version} git://github.com/vathpela/efivar ${pkgname}-${version}