From 6148701714b9d10fc51cf9eb503673f84b767bc0 Mon Sep 17 00:00:00 2001
From: Robert Piasek <dagger@gentoo.org>
Date: Fri, 9 Jan 2009 16:17:04 +0000
Subject: Initial upload of openmoko-target

---
 dev-util/strace/Manifest                           |  6 +++
 dev-util/strace/files/strace-4.5.12-libaio.patch   | 60 ++++++++++++++++++++++
 .../strace/files/strace-4.5.12-superh-update.patch | 24 +++++++++
 .../files/strace-dont-use-REG_SYSCALL-for-sh.patch | 10 ++++
 .../strace/files/strace-fix-arm-bad-syscall.patch  | 20 ++++++++
 dev-util/strace/strace-4.5.15.ebuild               | 50 ++++++++++++++++++
 6 files changed, 170 insertions(+)
 create mode 100644 dev-util/strace/Manifest
 create mode 100644 dev-util/strace/files/strace-4.5.12-libaio.patch
 create mode 100644 dev-util/strace/files/strace-4.5.12-superh-update.patch
 create mode 100644 dev-util/strace/files/strace-dont-use-REG_SYSCALL-for-sh.patch
 create mode 100644 dev-util/strace/files/strace-fix-arm-bad-syscall.patch
 create mode 100644 dev-util/strace/strace-4.5.15.ebuild

(limited to 'dev-util')

diff --git a/dev-util/strace/Manifest b/dev-util/strace/Manifest
new file mode 100644
index 0000000..5ebe231
--- /dev/null
+++ b/dev-util/strace/Manifest
@@ -0,0 +1,6 @@
+AUX strace-4.5.12-libaio.patch 1552 RMD160 d4084416ed298ae07ea672569d04a22feb2f9188 SHA1 eec055eacba686d98bd36556be28eca96596b995 SHA256 6ea8fe265b9161ca708aa3b5fd31eee4584b9c7fcf829dcd8624a965fb048a78
+AUX strace-4.5.12-superh-update.patch 540 RMD160 4a021623687f0bbb6dc1e102ab5e304fea123857 SHA1 17c911fef9c8fb9cad0f9f671372ec4b9b29dd43 SHA256 267d553bec04725e3d723b3afe825c8307774d75c9f9424c6801048fc85712b9
+AUX strace-dont-use-REG_SYSCALL-for-sh.patch 630 RMD160 77a2ba5b252632970baafdb11ba7841a28b1fbec SHA1 d3cd6b7f22174a25a386deedd1441517106c528e SHA256 5a3f73e6671753d990b0782aa91b8f3204cc2857b9e45e20a2b87471207c17a3
+AUX strace-fix-arm-bad-syscall.patch 560 RMD160 56cbe4c575118f78efa40abc7fc84852e30d502c SHA1 d9c4a8687cff9d68ebf892880073bc5585dd87e7 SHA256 b7f57f8fc46af991046e87a6afd2468f337f4ba42f8b4a78fdb8278c47b92aa9
+DIST strace-4.5.15.tar.bz2 455607 RMD160 0c6aaa8820a0985d89b21a5da9578b27435c8906 SHA1 a6bd153eeb1a25a50bb5a1d92887a4911ec9ad48 SHA256 ba8c492c1b2033d4e2131f05df9e3780d4bc35bea87aa32a6052dd53a814e288
+EBUILD strace-4.5.15.ebuild 1238 RMD160 6c48013746829f09479fe0c73564a2ec6c6f3796 SHA1 1b3776fb67470ce4730a46baebae913b7e3b7263 SHA256 a62978f00f8ca61d6344e150f1b664d8aa9d711fb53a812828217e8b121c06e7
diff --git a/dev-util/strace/files/strace-4.5.12-libaio.patch b/dev-util/strace/files/strace-4.5.12-libaio.patch
new file mode 100644
index 0000000..e24d3c3
--- /dev/null
+++ b/dev-util/strace/files/strace-4.5.12-libaio.patch
@@ -0,0 +1,60 @@
+Make libaio support a proper option and update the checks to support
+both new and old versions of libaio.
+
+http://bugs.gentoo.org/103427
+
+--- strace/configure.ac
++++ strace/configure.ac
+@@ -170,6 +170,26 @@
+ 		  struct stat.st_rdev])
+ AC_STAT64
+ 
++AC_ARG_ENABLE(libaio,
++	AC_HELP_STRING([--enable-libaio],[enable support for libaio @<:@default=auto@:>@]),
++	[enable_libaio=$enableval],
++	[enable_libaio=auto]
++)
++if test "x$enable_libaio" != "xno" ; then
++	AC_CHECK_HEADER([libaio.h],[have_libaio=yes],[have_libaio=no])
++	if test "x$enable_libaio$have_libaio" = "xyesno" ; then
++		AC_MSG_ERROR(Could not detect libaio.h)
++	elif test "x$have_libaio" = "xyes" ; then
++		AC_DEFINE(HAVE_LIBAIO_H, 1, [System has libaio.h])
++		AC_CHECK_MEMBERS([
++			struct iocb.data,
++			struct iocb.aio_data,
++			struct iocb.key,
++			struct iocb.aio_key],
++		[], [], [#include <libaio.h>])
++	fi
++fi
++
+ AC_TYPE_SIGNAL
+ AC_TYPE_UID_T
+ AC_TYPE_MODE_T
+--- strace/desc.c
++++ strace/desc.c
+@@ -767,7 +767,11 @@
+ 					continue;
+ 				}
+ 				tprintf("{%p, %u, %hu, %hu, %d}",
++#ifdef HAVE_STRUCT_IOCB_AIO_DATA
++					iocb.aio_data, iocb.aio_data,
++#else
+ 					iocb.data, iocb.key,
++#endif
+ 					iocb.aio_lio_opcode,
+ 					iocb.aio_reqprio, iocb.aio_fildes);
+ 			}
+@@ -793,7 +797,11 @@
+ #ifdef HAVE_LIBAIO_H
+ 		if (umove(tcp, tcp->u_arg[1], &iocb) == 0) {
+ 			tprintf("{%p, %u, %hu, %hu, %d}, ",
++#ifdef HAVE_STRUCT_IOCB_AIO_DATA
++				iocb.aio_data, iocb.aio_data,
++#else
+ 				iocb.data, iocb.key,
++#endif
+ 				iocb.aio_lio_opcode,
+ 				iocb.aio_reqprio, iocb.aio_fildes);
+ 		} else
diff --git a/dev-util/strace/files/strace-4.5.12-superh-update.patch b/dev-util/strace/files/strace-4.5.12-superh-update.patch
new file mode 100644
index 0000000..d402997
--- /dev/null
+++ b/dev-util/strace/files/strace-4.5.12-superh-update.patch
@@ -0,0 +1,24 @@
+Fix configure script to work with targets like 'sh4-unknown-linux-gnu'
+
+--- configure.ac
++++ configure.ac
+@@ -91,14 +91,14 @@
+ 	arch=hppa
+ 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
+ 	;;
+-sh)
+-	arch=sh
+-	AC_DEFINE([SH], 1, [Define for the SH architecture.])
+-	;;
+-sh64)
++sh64*)
+ 	arch=sh64
+ 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
+ 	;;
++sh*)
++	arch=sh
++	AC_DEFINE([SH], 1, [Define for the SH architecture.])
++	;;
+ x86?64*)
+ 	arch=x86_64
+ 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
diff --git a/dev-util/strace/files/strace-dont-use-REG_SYSCALL-for-sh.patch b/dev-util/strace/files/strace-dont-use-REG_SYSCALL-for-sh.patch
new file mode 100644
index 0000000..9030ecc
--- /dev/null
+++ b/dev-util/strace/files/strace-dont-use-REG_SYSCALL-for-sh.patch
@@ -0,0 +1,10 @@
+--- strace/process.c
++++ strace/process.c
+@@ -2663,7 +2663,6 @@ const struct xlat struct_user_offsets[] 
+        { 4*REG_GBR,            "4*REG_GBR"                             },
+        { 4*REG_MACH,           "4*REG_MACH"                            },
+        { 4*REG_MACL,           "4*REG_MACL"                            },
+-       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
+        { 4*REG_FPUL,           "4*REG_FPUL"                            },
+        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
+        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
diff --git a/dev-util/strace/files/strace-fix-arm-bad-syscall.patch b/dev-util/strace/files/strace-fix-arm-bad-syscall.patch
new file mode 100644
index 0000000..125440d
--- /dev/null
+++ b/dev-util/strace/files/strace-fix-arm-bad-syscall.patch
@@ -0,0 +1,20 @@
+http://www.fluff.org/ben/patches/strace/
+
+--- strace-4.5.12-orig/syscall.c	2005-06-08 21:45:28.000000000 +0100
++++ strace-4.5.12/syscall.c	2005-10-25 19:26:39.000000000 +0100
+@@ -1013,6 +1013,15 @@ struct tcb *tcp;
+ 		/*
+ 		 * Note: we only deal with only 32-bit CPUs here.
+ 		 */
++
++		if (!(tcp->flags & TCB_INSYSCALL) &&
++		    (tcp->flags & TCB_WAITEXECVE)) {
++			/* caught a fake syscall from the execve's exit */
++			tcp->flags &= ~TCB_WAITEXECVE;
++			return 0;
++		}
++ 
++
+ 		if (regs.ARM_cpsr & 0x20) {
+ 			/*
+ 			 * Get the Thumb-mode system call number
diff --git a/dev-util/strace/strace-4.5.15.ebuild b/dev-util/strace/strace-4.5.15.ebuild
new file mode 100644
index 0000000..cfc760c
--- /dev/null
+++ b/dev-util/strace/strace-4.5.15.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/strace/strace-4.5.15.ebuild,v 1.1 2007/01/17 06:45:56 vapier Exp $
+
+inherit flag-o-matic autotools
+
+DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="http://sourceforge.net/projects/strace/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="static aio"
+
+DEPEND="aio? ( dev-libs/libaio )"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	#epatch "${FILESDIR}"/${PN}-4.5.11-fbsd.patch
+
+	# Fix SuperH support
+	epatch "${FILESDIR}"/strace-dont-use-REG_SYSCALL-for-sh.patch
+	epatch "${FILESDIR}"/${PN}-4.5.12-superh-update.patch
+
+	# Fix building on older ARM machines
+	epatch "${FILESDIR}"/strace-fix-arm-bad-syscall.patch
+
+	# Fix libaio support #103427
+	epatch "${FILESDIR}"/${PN}-4.5.12-libaio.patch
+
+	eautoreconf
+}
+
+src_compile() {
+	filter-lfs-flags
+
+	use static && append-ldflags -static
+
+	econf $(use_enable aio libaio) || die
+	emake || die
+}
+
+src_install() {
+	emake install DESTDIR="${D}" || die
+	dodoc ChangeLog CREDITS NEWS PORTING README* TODO
+}
+
-- 
cgit v1.2.3-65-gdbad