commit:     1e8b41c1ec1fe0a622eafe91993edd4eb28fcb4e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 18 22:38:33 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Apr 18 22:38:33 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e8b41c1

sys-apps/sg3_utils: fix build w/newer glibc #580236

 .../sg3_utils/files/sg3_utils-1.42-sysmacros.patch | 31 ++++++++++++++++++++++
 sys-apps/sg3_utils/sg3_utils-1.42.ebuild           |  3 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/sys-apps/sg3_utils/files/sg3_utils-1.42-sysmacros.patch 
b/sys-apps/sg3_utils/files/sg3_utils-1.42-sysmacros.patch
new file mode 100644
index 0000000..e8440fb
--- /dev/null
+++ b/sys-apps/sg3_utils/files/sg3_utils-1.42-sysmacros.patch
@@ -0,0 +1,31 @@
+From 13ff34d408cf69339ce1f28756f5c7b5ad5f528b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <[email protected]>
+Date: Mon, 18 Apr 2016 18:36:09 -0400
+Subject: [PATCH] include sys/sysmacros.h for major/minor funcs
+
+These functions are not part of any official spec, and glibc has always
+kept them in sys/sysmacros.h.  As glibc moves to conform to POSIX, and
+more alternative C libraries come up, we need to include this header
+explicitly to get the prototypes.  Otherwise we fail to build like:
+
+sg_map26.o: In function 'nd_match_scandir_select':
+sg_map26.c:(.text+0x37b): undefined reference to 'major'
+---
+ include/sg_lib.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/sg_lib.h b/include/sg_lib.h
+index b3e741b..a0e483c 100644
+--- a/include/sg_lib.h
++++ b/include/sg_lib.h
+@@ -32,6 +32,7 @@
+ 
+ #include <stdio.h>
+ #include <stdint.h>
++#include <sys/sysmacros.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {
+-- 
+2.7.4
+

diff --git a/sys-apps/sg3_utils/sg3_utils-1.42.ebuild 
b/sys-apps/sg3_utils/sg3_utils-1.42.ebuild
index 081198b..7c366e7 100644
--- a/sys-apps/sg3_utils/sg3_utils-1.42.ebuild
+++ b/sys-apps/sg3_utils/sg3_utils-1.42.ebuild
@@ -20,7 +20,8 @@ RDEPEND=""
 PDEPEND=">=sys-apps/rescan-scsi-bus-1.24"
 
 src_prepare() {
-       epatch "${FILESDIR}"/${PN}-1.26-stdint.patch
+       epatch "${FILESDIR}"/${PN}-1.26-stdint.patch #580236
+       epatch "${FILESDIR}"/${PN}-1.42-sysmacros.patch #580236
 }
 
 src_configure() {

Reply via email to