public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-libs/efivar/, sys-libs/efivar/files/
Date: Fri, 20 Mar 2015 18:23:35 +0000 (UTC)	[thread overview]
Message-ID: <1426875884.02d2b5c49a36b119da7e66c8c1499d38c1ce3e03.blueness@gentoo> (raw)

commit:     02d2b5c49a36b119da7e66c8c1499d38c1ce3e03
Author:     layman <layman <AT> localhost>
AuthorDate: Fri Mar 20 03:01:03 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Mar 20 18:24:44 2015 +0000
URL:        https://gitweb.gentoo.org/proj/hardened-dev.git/commit/?id=02d2b5c4

sys-libs/efivar: fix compilation against musl

 sys-libs/efivar/efivar-0.15-r99.ebuild             | 28 +++++++++++++++++++++
 .../efivar/files/efivar-0.15-portability.patch     | 29 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/sys-libs/efivar/efivar-0.15-r99.ebuild b/sys-libs/efivar/efivar-0.15-r99.ebuild
new file mode 100644
index 0000000..f08fe58
--- /dev/null
+++ b/sys-libs/efivar/efivar-0.15-r99.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/efivar/efivar-0.15.ebuild,v 1.5 2015/02/28 13:25:44 ago Exp $
+
+EAPI=5
+
+inherit multilib toolchain-funcs eutils
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/vathpela/efivar"
+SRC_URI="https://github.com/vathpela/${PN}/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+RDEPEND="dev-libs/popt"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+	epatch "${FILESDIR}/${PN}-0.15-portability.patch" || die
+}
+
+src_configure() {
+	tc-export CC
+	export libdir="/usr/$(get_libdir)"
+}
+

diff --git a/sys-libs/efivar/files/efivar-0.15-portability.patch b/sys-libs/efivar/files/efivar-0.15-portability.patch
new file mode 100644
index 0000000..2c824a0
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-0.15-portability.patch
@@ -0,0 +1,29 @@
+Portability fixes:
+
+- Initialize outbuf with the expected size! fixes a segfault with musl.
+- Really use __builtin_va_arg_pack_len().
+
+--- a/src/efivar.h
++++ b/src/efivar.h
+@@ -85,7 +85,7 @@ efi_set_variable(efi_guid_t guid, const char *name,
+ 		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/src/makeguids.c b/src/makeguids.c
+index 321a7e7..7d68b8a 100644
+--- a/src/makeguids.c
++++ b/src/makeguids.c
+@@ -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");
+ 


                 reply	other threads:[~2015-03-20 18:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426875884.02d2b5c49a36b119da7e66c8c1499d38c1ce3e03.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox