[oe-commits] Khem Raj : ltrace_0.5.3.bb: New recipe for 0.5.3

git version control git at git.openembedded.org
Sun Oct 25 09:15:26 UTC 2009


Module: openembedded.git
Branch: koen/static-libs-rework
Commit: b85b779688f0abc389e3c25d06b54de8b86385c1
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=b85b779688f0abc389e3c25d06b54de8b86385c1

Author: Khem Raj <raj.khem at gmail.com>
Date:   Sat Oct 24 12:04:44 2009 -0700

ltrace_0.5.3.bb: New recipe for 0.5.3

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 conf/checksums.ini                               |    8 ++
 recipes/ltrace/files/add-sysdep.patch            |   13 ++++
 recipes/ltrace/files/ltrace-compile.patch        |   80 ++++++++++++++++++++++
 recipes/ltrace/files/ltrace-mips-remove-CP.patch |   12 +++
 recipes/ltrace/files/ltrace-mips.patch           |   36 ++++++++++
 recipes/ltrace/ltrace_0.5.3.bb                   |   73 ++++++++++++++++++++
 6 files changed, 222 insertions(+), 0 deletions(-)

diff --git a/conf/checksums.ini b/conf/checksums.ini
index a2d7bda..fb7ff91 100644
--- a/conf/checksums.ini
+++ b/conf/checksums.ini
@@ -16958,6 +16958,14 @@ sha256=28bbab4a69a3c78539b2588d2219327009d93cafc74fb59b9a4ea5f5b794f8db
 md5=8dbadad76ee360c2ed2caa915f5b1c8e
 sha256=28bbab4a69a3c78539b2588d2219327009d93cafc74fb59b9a4ea5f5b794f8db
 
+[ftp://ftp.us.debian.org/debian/pool/main/l/ltrace/ltrace_0.5.3-2.diff.gz]
+md5=969baa0900646c0262b2d505b9fef154
+sha256=f647d7c2f2b0d1dbddd632f3a17fef670aed3ebf5fbe6c1633337acac1eba8e3
+
+[ftp://ftp.us.debian.org/debian/pool/main/l/ltrace/ltrace_0.5.3.orig.tar.gz]
+md5=3fa7fe715ab879db08bd06d1d59fd90f
+sha256=5c6627d6d5a98a92ca4661cfc16378b182cc46a9ec479ebf7e6121ee3fe2be32
+
 [http://ltt.polymtl.ca/lttng/ltt-control-0.12-21062006.tar.gz]
 md5=053abb5ce58363ae09340e00de28c520
 sha256=c53f07c095642303e22b283212bb0da45020b0714e24310ed0e396c560a78e1f
diff --git a/recipes/ltrace/files/add-sysdep.patch b/recipes/ltrace/files/add-sysdep.patch
new file mode 100644
index 0000000..1d0432f
--- /dev/null
+++ b/recipes/ltrace/files/add-sysdep.patch
@@ -0,0 +1,13 @@
+Index: ltrace-0.5.3/Makefile.in
+===================================================================
+--- ltrace-0.5.3.orig/Makefile.in	2009-10-23 22:06:08.130304691 -0700
++++ ltrace-0.5.3/Makefile.in	2009-10-23 22:06:53.160369614 -0700
+@@ -39,6 +39,8 @@ ltrace:		main.o libltrace.a
+ libltrace.a: 	sysdeps/sysdep.o $(OBJ)
+ 		$(AR) rcv $@ $^
+ 
++$(OBJ):		sysdeps/sysdep.o
++
+ sysdeps/sysdep.o: dummy
+ 		$(MAKE) -C sysdeps/$(OS)
+ 
diff --git a/recipes/ltrace/files/ltrace-compile.patch b/recipes/ltrace/files/ltrace-compile.patch
new file mode 100644
index 0000000..8323a5c
--- /dev/null
+++ b/recipes/ltrace/files/ltrace-compile.patch
@@ -0,0 +1,80 @@
+Index: ltrace-0.5.3/common.h
+===================================================================
+--- ltrace-0.5.3.orig/common.h	2009-10-23 23:13:45.700282578 -0700
++++ ltrace-0.5.3/common.h	2009-10-23 23:14:13.550371553 -0700
+@@ -1,3 +1,5 @@
++#ifndef COMMON_H
++#define COMMON_H
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <stdio.h>
+@@ -251,3 +253,5 @@ extern void * sym2addr(Process *, struct
+ #if 0				/* not yet */
+ extern int umoven(Process * proc, void * addr, int len, void * laddr);
+ #endif
++#endif
++
+Index: ltrace-0.5.3/configure
+===================================================================
+--- ltrace-0.5.3.orig/configure	2009-10-23 23:13:45.630316494 -0700
++++ ltrace-0.5.3/configure	2009-10-23 23:13:59.672869527 -0700
+@@ -30,7 +30,7 @@ int main () {
+   return cplus_demangle();
+ }
+ EOF
+-if gcc conftest.c -liberty 2>/dev/null
++if $CC conftest.c -liberty 2>/dev/null
+ then
+   HAVE_LIBIBERTY=1
+   echo "yes"
+@@ -48,7 +48,7 @@ int main () {
+   return __cxa_demangle();
+ }
+ EOF
+-if gcc conftest.c -lsupc++ 2>/dev/null
++if $CC conftest.c -lsupc++ 2>/dev/null
+ then
+   HAVE_LIBSUPC__=1
+   echo "yes"
+@@ -67,7 +67,7 @@ int main () {
+   return 0;
+ }
+ EOF
+-if gcc conftest.c 2>/dev/null
++if $CC conftest.c 2>/dev/null
+ then
+   HAVE_ELF_C_READ_MMAP=1
+   echo "yes"
+@@ -77,15 +77,12 @@ else
+ fi
+ rm -f conftest.c a.out
+ 
+-CC=gcc
+-CPPFLAGS=' -I /usr/include/libelf'
+ CFLAGS='-g -O2'
+ LIBS='-lelf -lsupc++ -liberty '
+-INSTALL='/usr/bin/install -c'
++INSTALL='$/usr/bin/install -c'
+ iquote='-iquote '
+ iquoteend=''
+ 
+-prefix=/usr/local
+ sysconfdir='${prefix}/etc'
+ bindir='${prefix}/bin'
+ mandir='${prefix}/share/man'
+Index: ltrace-0.5.3/debug.h
+===================================================================
+--- ltrace-0.5.3.orig/debug.h	2009-10-23 23:13:45.670276809 -0700
++++ ltrace-0.5.3/debug.h	2009-10-23 23:14:26.440319785 -0700
+@@ -1,3 +1,5 @@
++#ifndef DEBUG_H
++#define DEBUG_H
+ #include <features.h>
+ 
+ /* debug levels:
+@@ -14,4 +16,4 @@ void debug_(int level, const char *file,
+ int xinfdump(long, void *, int);
+ 
+ # define debug(level, expr...) debug_(level, __FILE__, __LINE__, expr)
+-
++#endif
diff --git a/recipes/ltrace/files/ltrace-mips-remove-CP.patch b/recipes/ltrace/files/ltrace-mips-remove-CP.patch
new file mode 100644
index 0000000..2af193d
--- /dev/null
+++ b/recipes/ltrace/files/ltrace-mips-remove-CP.patch
@@ -0,0 +1,12 @@
+Index: ltrace-0.5.3/sysdeps/linux-gnu/mipsel/trace.c
+===================================================================
+--- ltrace-0.5.3.orig/sysdeps/linux-gnu/mipsel/trace.c	2009-10-23 23:15:59.822783128 -0700
++++ ltrace-0.5.3/sysdeps/linux-gnu/mipsel/trace.c	2009-10-23 23:16:10.441268788 -0700
+@@ -127,7 +127,6 @@ gimme_arg(enum tof type, Process *proc, 
+ 			return ret;
+ 		} else {
+ 			// If we need this, I think we can look at [sp+16] for arg_num==4.
+-			CP;
+ 			return 0;
+ 		}
+ 	}
diff --git a/recipes/ltrace/files/ltrace-mips.patch b/recipes/ltrace/files/ltrace-mips.patch
new file mode 100644
index 0000000..6df5e21
--- /dev/null
+++ b/recipes/ltrace/files/ltrace-mips.patch
@@ -0,0 +1,36 @@
+Index: ltrace-0.5.3/sysdeps/linux-gnu/mipsel/plt.c
+===================================================================
+--- ltrace-0.5.3.orig/sysdeps/linux-gnu/mipsel/plt.c	2009-10-23 23:25:59.292780574 -0700
++++ ltrace-0.5.3/sysdeps/linux-gnu/mipsel/plt.c	2009-10-23 23:26:22.671522220 -0700
+@@ -1,4 +1,4 @@
+-#include <debug.h>
++#include "debug.h"
+ #include <gelf.h>
+ #include <sys/ptrace.h>
+ #include "common.h"
+Index: ltrace-0.5.3/sysdeps/linux-gnu/mipsel/regs.c
+===================================================================
+--- ltrace-0.5.3.orig/sysdeps/linux-gnu/mipsel/regs.c	2009-10-23 23:25:59.312777529 -0700
++++ ltrace-0.5.3/sysdeps/linux-gnu/mipsel/regs.c	2009-10-23 23:26:08.190311896 -0700
+@@ -4,7 +4,6 @@
+ #include <sys/types.h>
+ #include <sys/ptrace.h>
+ #include <asm/ptrace.h>
+-#include <linux/user.h>
+ 
+ #include "common.h"
+ #include "mipsel.h"
+Index: ltrace-0.5.3/handle_event.c
+===================================================================
+--- ltrace-0.5.3.orig/handle_event.c	2009-10-23 23:29:48.780274445 -0700
++++ ltrace-0.5.3/handle_event.c	2009-10-23 23:37:32.260284055 -0700
+@@ -573,7 +573,8 @@ handle_breakpoint(Event *event) {
+ 			void *old_addr;
+ 			struct library_symbol *sym= event->proc->callstack[i].c_un.libfunc;
+ 			assert(sym);
+-			old_addr = dict_find_entry(event->proc->breakpoints, sym2addr(event->proc, sym))->addr;
++			struct Breakpoint *tbp = dict_find_entry(event->proc->breakpoints, sym2addr(event->proc, sym));
++			old_addr = tbp->addr;
+ 			addr=sym2addr(event->proc,sym);
+ 			assert(old_addr !=0 && addr !=0);
+ 			if(addr != old_addr){
diff --git a/recipes/ltrace/ltrace_0.5.3.bb b/recipes/ltrace/ltrace_0.5.3.bb
new file mode 100644
index 0000000..a6916be
--- /dev/null
+++ b/recipes/ltrace/ltrace_0.5.3.bb
@@ -0,0 +1,73 @@
+DESCRIPTION = "ltrace shows runtime library call information for dynamically linked executables."
+HOMEPAGE = "http://ltrace.alioth.debian.org"
+SECTION = "devel"
+DEPENDS = "libelf"
+LICENSE = "GPLv2"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/l/ltrace/ltrace_${PV}.orig.tar.gz \
+           ${DEBIAN_MIRROR}/main/l/ltrace/ltrace_${PV}-2.diff.gz;patch=1 \
+	   file://add-sysdep.patch;patch=1 \
+	   file://ltrace-compile.patch;patch=1 \
+	   file://ltrace-mips-remove-CP.patch;patch=1 \
+	   file://ltrace-mips.patch;patch=1 \
+	  "
+inherit autotools
+
+PARALLEL_MAKE = ""
+EXTRA_OEMAKE = "INSTALL_FILE='$(INSTALL) -p -m 0644' \
+		INSTALL_PROGRAM='$(INSTALL) -p -m 0755' \
+		INSTALL_SCRIPT='$(INSTALL) -p -m 0755' \
+		INSTALL_DIR='$(INSTALL) -p -d -m 0755' "
+
+export TARGET_CFLAGS = "${SELECTED_OPTIMIZATION} -isystem ${STAGING_INCDIR}"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_configure_prepend() {
+	case ${TARGET_ARCH} in
+		arm*)  ln -sf ./linux-gnu sysdeps/linux-gnueabi ;;
+		mips)  ln -sf ./mipsel sysdeps/linux-gnu/mips ;;
+	esac
+	sed -e 's:uname -m:echo @HOST_CPU@:' \
+		sysdeps/linux-gnu/Makefile > sysdeps/linux-gnu/Makefile.in
+
+}
+
+do_compile() {
+	case ${TARGET_ARCH} in
+		alpha*)   LTRACE_ARCH=alpha ;;
+		arm*)     LTRACE_ARCH=arm ;;
+		cris*)    LTRACE_ARCH=cris ;;
+		hppa*)    LTRACE_ARCH=parisc ;;
+		i*86*)    LTRACE_ARCH=i386 ;;
+		ia64*)    LTRACE_ARCH=ia64 ;;
+		mips*)    LTRACE_ARCH=mips ;;
+		m68k*)    LTRACE_ARCH=m68k ;;
+		powerpc*) LTRACE_ARCH=ppc ;;
+		s390*)    LTRACE_ARCH=s390 ;;
+		sh*)      LTRACE_ARCH=sh ;;
+		sparc64*) LTRACE_ARCH=sparc64 ;;
+		sparc*)   LTRACE_ARCH=sparc ;;
+		x86_64*)  LTRACE_ARCH=x86_64 ;;
+	esac
+	oe_runmake LDFLAGS=${TARGET_LDFLAGS} LIBS="-lsupc++ -liberty -Wl,-Bstatic -lelf -Wl,-Bdynamic" ${EXTRA_OEMAKE} ARCH=${LTRACE_ARCH}
+}
+
+do_install() {
+	case ${TARGET_ARCH} in
+		alpha*)   LTRACE_ARCH=alpha ;;
+		arm*)     LTRACE_ARCH=arm ;;
+		cris*)    LTRACE_ARCH=cris ;;
+		hppa*)    LTRACE_ARCH=parisc ;;
+		i*86*)    LTRACE_ARCH=i386 ;;
+		ia64*)    LTRACE_ARCH=ia64 ;;
+		mips*)    LTRACE_ARCH=mips ;;
+		m68k*)    LTRACE_ARCH=m68k ;;
+		powerpc*) LTRACE_ARCH=ppc ;;
+		s390*)    LTRACE_ARCH=s390 ;;
+		sh*)      LTRACE_ARCH=sh ;;
+		sparc64*) LTRACE_ARCH=sparc64 ;;
+		sparc*)   LTRACE_ARCH=sparc ;;
+		x86_64*)  LTRACE_ARCH=x86_64 ;;
+	esac
+	oe_runmake install ${EXTRA_OEMAKE} ARCH=${LTRACE_ARCH} INSTALL=${STAGING_BINDIR_NATIVE}/install DESTDIR=${D}
+}





More information about the Openembedded-commits mailing list