summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-13 19:47:13 +0000
committerMike Frysinger <vapier@gentoo.org>2012-05-13 19:47:13 +0000
commit4c62ec377ecd2199ff1f3df1eeabb036940a6713 (patch)
treec2f6c1bc3825d6f7ba1447c1d2deead240a79f57 /dev-util
parentkeyword ~amd64-fbsd (diff)
downloadgentoo-2-4c62ec377ecd2199ff1f3df1eeabb036940a6713.tar.gz
gentoo-2-4c62ec377ecd2199ff1f3df1eeabb036940a6713.tar.bz2
gentoo-2-4c62ec377ecd2199ff1f3df1eeabb036940a6713.zip
Fix building with glibc-2.15 and old kernel headers #414637 by toogle.
(Portage version: 2.2.0_alpha102/cvs/Linux x86_64)
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/strace/ChangeLog6
-rw-r--r--dev-util/strace/files/strace-4.7-glibc-2.15.patch53
-rw-r--r--dev-util/strace/strace-4.7.ebuild4
3 files changed, 61 insertions, 2 deletions
diff --git a/dev-util/strace/ChangeLog b/dev-util/strace/ChangeLog
index 59bcb60d6945..c719c8e32eb5 100644
--- a/dev-util/strace/ChangeLog
+++ b/dev-util/strace/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-util/strace
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/strace/ChangeLog,v 1.175 2012/05/02 21:59:12 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/strace/ChangeLog,v 1.176 2012/05/13 19:47:13 vapier Exp $
+
+ 13 May 2012; Mike Frysinger <vapier@gentoo.org>
+ +files/strace-4.7-glibc-2.15.patch, strace-4.7.ebuild:
+ Fix building with glibc-2.15 and old kernel headers #414637 by toogle.
*strace-4.7 (02 May 2012)
diff --git a/dev-util/strace/files/strace-4.7-glibc-2.15.patch b/dev-util/strace/files/strace-4.7-glibc-2.15.patch
new file mode 100644
index 000000000000..c23a86ff98a1
--- /dev/null
+++ b/dev-util/strace/files/strace-4.7-glibc-2.15.patch
@@ -0,0 +1,53 @@
+https://bugs.gentoo.org/414637
+
+From 302e8ec6cd62912a3cd6494ce6702f4ad8dae0e2 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 4 May 2012 19:30:59 -0400
+Subject: [PATCH] util: fix building when glibc has a stub process_vm_readv
+
+If you have a newer glibc which provides process_vm_readv, but it is built
+against older kernel headers which lack __NR_process_vm_readv, the library
+will contain a stub implementation that just returns ENOSYS. Autoconf
+checks for this case explicitly and will declare it as unavailable. So we
+end up in a case where the headers provide the prototype, but autoconf has
+not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again:
+
+util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration
+/usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here
+
+So rename our local function to something unique, and add a define so the
+callers all hit the right place.
+
+* util.c (strace_process_vm_readv): Rename from process_vm_readv.
+(process_vm_readv): Define to strace_process_vm_readv.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ util.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index d347bd8..f27acdf 100644
+--- a/util.c
++++ b/util.c
+@@ -735,7 +735,8 @@ static bool process_vm_readv_not_supported = 0;
+
+ #if defined(__NR_process_vm_readv)
+ static bool process_vm_readv_not_supported = 0;
+-static ssize_t process_vm_readv(pid_t pid,
++/* Have to avoid duplicating with the C library headers. */
++static ssize_t strace_process_vm_readv(pid_t pid,
+ const struct iovec *lvec,
+ unsigned long liovcnt,
+ const struct iovec *rvec,
+@@ -744,6 +745,7 @@ static ssize_t process_vm_readv(pid_t pid,
+ {
+ return syscall(__NR_process_vm_readv, (long)pid, lvec, liovcnt, rvec, riovcnt, flags);
+ }
++#define process_vm_readv strace_process_vm_readv
+ #else
+ static bool process_vm_readv_not_supported = 1;
+ # define process_vm_readv(...) (errno = ENOSYS, -1)
+--
+1.7.9.7
+
diff --git a/dev-util/strace/strace-4.7.ebuild b/dev-util/strace/strace-4.7.ebuild
index eceadf626634..86659664de04 100644
--- a/dev-util/strace/strace-4.7.ebuild
+++ b/dev-util/strace/strace-4.7.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/strace/strace-4.7.ebuild,v 1.1 2012/05/02 21:59:12 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/strace/strace-4.7.ebuild,v 1.2 2012/05/13 19:47:13 vapier Exp $
EAPI="4"
@@ -33,6 +33,8 @@ src_prepare() {
[[ ! -e CREDITS ]] && cp CREDITS{.in,}
fi
+ epatch "${FILESDIR}"/${P}-glibc-2.15.patch #414637
+
filter-lfs-flags # configure handles this sanely
use static && append-ldflags -static