From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22767 invoked by alias); 3 Jan 2010 21:32:44 -0000 Received: (qmail 22345 invoked by uid 22791); 3 Jan 2010 21:32:40 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from av6-2-sn3.vrr.skanova.net (HELO av6-2-sn3.vrr.skanova.net) (81.228.9.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 03 Jan 2010 21:32:33 +0000 Received: by av6-2-sn3.vrr.skanova.net (Postfix, from userid 502) id 375AF3842E; Sun, 3 Jan 2010 22:32:30 +0100 (CET) Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av6-2-sn3.vrr.skanova.net (Postfix) with ESMTP id C0B993842C; Sun, 3 Jan 2010 22:32:29 +0100 (CET) Received: from isengard (90-224-113-214-no111.tbcn.telia.com [90.224.113.214]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id BAA5A37E43; Sun, 3 Jan 2010 22:32:26 +0100 (CET) Received: by isengard (Postfix, from userid 1000) id 93C7E36A0C0; Sun, 3 Jan 2010 22:25:17 +0100 (CET) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 1] debug/ltrace: Add support for ltrace-0.5.3 X-Mercurial-Node: d284ddf7e1b40cedcea0d6e0cf54b59a1a1b737a Message-Id: In-Reply-To: References: User-Agent: Mercurial-patchbomb/1.3.1 Date: Sun, 03 Jan 2010 21:32:00 -0000 From: Joachim Nilsson To: "Yann E. MORIN" Cc: crossgcc@sourceware.org Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00013.txt.bz2 # HG changeset patch # User Joachim Nilsson # Date 1262533618 -3600 # Node ID d284ddf7e1b40cedcea0d6e0cf54b59a1a1b737a # Parent 6b1e8a28dc60954371416a074ed906e244816763 debug/ltrace: Add support for ltrace-0.5.3 >From this version of ltrace the maintainer has removed support for GNU Autotools, so the patch sets needed to be reworked. Included is the latest Debian patch, by the Debian ltrace maintainer Juan Cespedes , the OpenEmbedded patches for cross compiling, by Khem Raj and a further set of patches by Joachim Nilsson for crosstool-NG. diff --git a/config/debug/ltrace.in b/config/debug/ltrace.in --- a/config/debug/ltrace.in +++ b/config/debug/ltrace.in @@ -14,6 +14,12 @@ # Don't remove next line # CT_INSERT_VERSION_BELOW +config LTRACE_V_0_5_3 + bool + prompt "0.5.3 (EXPERIMENTAL)" + depends on EXPERIMENTAL + select LTRACE_0_5_3_or_later + config LTRACE_V_0_5_2 bool prompt "0.5.2" @@ -39,7 +45,12 @@ string # Don't remove next line # CT_INSERT_VERSION_STRING_BELOW + default "0.5.3" if LTRACE_V_0_5_3 default "0.5.2" if LTRACE_V_0_5_2 default "0.5.1" if LTRACE_V_0_5_1 default "0.5" if LTRACE_V_0_5 default "0.4" if LTRACE_V_0_4 + +config LTRACE_0_5_3_or_later + bool + default n diff --git a/patches/ltrace/0.5.3/100-allow-cross-compile.patch b/patches/ltrace/0.5.3/100-allow-cross-compile.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/100-allow-cross-compile.patch @@ -0,0 +1,84 @@ +This patch is courtesy of OpenEmbedded, by Khem Raj + +http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=b85b779688f0abc389e3c25d06b54de8b86385c1 + +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 + #include + #include +@@ -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='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 + + /* 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/patches/ltrace/0.5.3/110-alpha-support.patch b/patches/ltrace/0.5.3/110-alpha-support.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/110-alpha-support.patch @@ -0,0 +1,11 @@ +diff -ru ltrace-0.5.3.orig/sysdeps/linux-gnu/Makefile ltrace-0.5.3/sysdeps/linux-gnu/Makefile +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/Makefile 2009-07-25 17:13:02.000000000 +0200 ++++ ltrace-0.5.3/sysdeps/linux-gnu/Makefile 2010-01-01 22:20:45.000000000 +0100 +@@ -2,6 +2,7 @@ + -e s/i.86/i386/ \ + -e s/sun4u/sparc64/ \ + -e s/sparc64/sparc/ \ ++ -e s/alpha.*/alpha/ \ + -e s/arm.*/arm/ \ + -e s/sa110/arm/ \ + -e s/ppc64/ppc/ \ diff --git a/patches/ltrace/0.5.3/120-debian-ltrace_0.5.3-2.patch b/patches/ltrace/0.5.3/120-debian-ltrace_0.5.3-2.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/120-debian-ltrace_0.5.3-2.patch @@ -0,0 +1,78 @@ +Debian patch courtesy of the Debian ltrace maintainer Juan Cespedes + +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/breakpoint.c ++++ ltrace-0.5.3/sysdeps/linux-gnu/breakpoint.c +@@ -6,8 +6,6 @@ + #include "common.h" + #include "arch.h" + +-static unsigned char break_insn[] = BREAKPOINT_VALUE; +- + #ifdef ARCH_HAVE_ENABLE_BREAKPOINT + extern void arch_enable_breakpoint(pid_t, Breakpoint *); + void +@@ -20,6 +18,9 @@ + arch_enable_breakpoint(pid, sbp); + } + #else ++ ++static unsigned char break_insn[] = BREAKPOINT_VALUE; ++ + void + enable_breakpoint(pid_t pid, Breakpoint *sbp) { + unsigned int i, j; +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/arm/breakpoint.c ++++ ltrace-0.5.3/sysdeps/linux-gnu/arm/breakpoint.c +@@ -24,10 +24,7 @@ + + #include + #include "config.h" +-#include "arch.h" +-#include "options.h" +-#include "output.h" +-#include "debug.h" ++#include "common.h" + + void + arch_enable_breakpoint(pid_t pid, Breakpoint *sbp) { +@@ -59,8 +56,6 @@ + void + arch_disable_breakpoint(pid_t pid, const Breakpoint *sbp) { + unsigned int i, j; +- const unsigned char break_insn[] = BREAKPOINT_VALUE; +- const unsigned char thumb_break_insn[] = THUMB_BREAKPOINT_VALUE; + + debug(1, "arch_disable_breakpoint(%d,%p)", pid, sbp->addr); + +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/ia64/plt.c ++++ ltrace-0.5.3/sysdeps/linux-gnu/ia64/plt.c +@@ -1,4 +1,5 @@ + #include ++#include + #include "common.h" + + /* A bundle is 128 bits */ +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/ia64/breakpoint.c ++++ ltrace-0.5.3/sysdeps/linux-gnu/ia64/breakpoint.c +@@ -6,10 +6,7 @@ + + #include + #include +-#include "arch.h" +-#include "options.h" +-#include "output.h" +-#include "debug.h" ++#include "common.h" + + static long long + extract_bit_field(char *bundle, int from, int len) { +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/ia64/regs.c ++++ ltrace-0.5.3/sysdeps/linux-gnu/ia64/regs.c +@@ -7,7 +7,6 @@ + #include + + #include +-#include "debug.h" + #include "common.h" + + void * diff --git a/patches/ltrace/0.5.3/130-add-sysdep.patch b/patches/ltrace/0.5.3/130-add-sysdep.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/130-add-sysdep.patch @@ -0,0 +1,17 @@ +This patch is courtesy of OpenEmbedded, by Khem Raj + +http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=b85b779688f0abc389e3c25d06b54de8b86385c1 + +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/patches/ltrace/0.5.3/140-mips-remove-CP.patch b/patches/ltrace/0.5.3/140-mips-remove-CP.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/140-mips-remove-CP.patch @@ -0,0 +1,16 @@ +This patch is courtesy of OpenEmbedded, by Khem Raj + +http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=b85b779688f0abc389e3c25d06b54de8b86385c1 + +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/patches/ltrace/0.5.3/140-mips.patch b/patches/ltrace/0.5.3/140-mips.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/140-mips.patch @@ -0,0 +1,40 @@ +This patch is courtesy of OpenEmbedded, by Khem Raj + +http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=b85b779688f0abc389e3c25d06b54de8b86385c1 + +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 ++#include "debug.h" + #include + #include + #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 + #include + #include +-#include + + #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/patches/ltrace/0.5.3/150-allow-configurable-arch.patch b/patches/ltrace/0.5.3/150-allow-configurable-arch.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/150-allow-configurable-arch.patch @@ -0,0 +1,48 @@ +This patch is to ensure the proper ARCH is selected when cross compiling. Make +sure to call the configure script with, e.g., HOST=arm ./configure to select +the arm sysdeps. + + Joachim Nilsson + +diff -ru ltrace-0.5.3.orig/configure ltrace-0.5.3/configure +--- ltrace-0.5.3.orig/configure 2010-01-02 11:05:55.000000000 +0100 ++++ ltrace-0.5.3/configure 2010-01-02 20:49:11.000000000 +0100 +@@ -110,7 +110,7 @@ + # + # Makefile.in -> Makefile + # +-x_subst_vars='PACKAGE_VERSION HOST_OS INSTALL CC CPPFLAGS CFLAGS LDFLAGS LIBS iquote iquoteend prefix sysconfdir mandir docdir' ++x_subst_vars='PACKAGE_VERSION HOST HOST_OS INSTALL CC CPPFLAGS CFLAGS LDFLAGS LIBS iquote iquoteend prefix sysconfdir mandir docdir' + + for i in $x_subst_vars + do +Only in ltrace-0.5.3: configure~ +diff -ru ltrace-0.5.3.orig/Makefile.in ltrace-0.5.3/Makefile.in +--- ltrace-0.5.3.orig/Makefile.in 2010-01-02 11:05:55.000000000 +0100 ++++ ltrace-0.5.3/Makefile.in 2010-01-03 01:28:41.000000000 +0100 +@@ -1,10 +1,12 @@ + # + # ltrace's Makefile.in + # +- ++MY_TARGET = @HOST@ ++ifdef MY_TARGET ++ARCH = $(MY_TARGET) ++endif + #OS := $(shell uname -s) + OS := @HOST_OS@ +- + TOPDIR = $(shell pwd) + + prefix = @prefix@ +Only in ltrace-0.5.3: Makefile.in~ +diff -ru ltrace-0.5.3.orig/sysdeps/linux-gnu/Makefile ltrace-0.5.3/sysdeps/linux-gnu/Makefile +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/Makefile 2010-01-02 11:05:55.000000000 +0100 ++++ ltrace-0.5.3/sysdeps/linux-gnu/Makefile 2010-01-02 20:49:51.000000000 +0100 +@@ -1,4 +1,4 @@ +-ARCH := $(shell uname -m | sed \ ++ARCH ?= $(shell uname -m | sed \ + -e s/i.86/i386/ \ + -e s/sun4u/sparc64/ \ + -e s/sparc64/sparc/ \ +Only in ltrace-0.5.3/sysdeps/linux-gnu: Makefile~ diff --git a/patches/ltrace/0.5.3/160-fix-missing-ptrace-defines.patch b/patches/ltrace/0.5.3/160-fix-missing-ptrace-defines.patch new file mode 100644 --- /dev/null +++ b/patches/ltrace/0.5.3/160-fix-missing-ptrace-defines.patch @@ -0,0 +1,72 @@ +This patch tries to fix the issue when PTRACE_EVENT_FORK is not found in the standard +system headers. The begininngs of this was already in place in trace.c, this patch +only takes that idea and puts it in a shared include file for trace.c *and* events.c. +The latter of which otherwise fails to build on Arm. + + Joachim Nilsson + +diff -ruN ltrace-0.5.3.orig/sysdeps/linux-gnu/events.c ltrace-0.5.3/sysdeps/linux-gnu/events.c +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/events.c 2009-07-25 17:13:02.000000000 +0200 ++++ ltrace-0.5.3/sysdeps/linux-gnu/events.c 2010-01-03 14:33:46.000000000 +0100 +@@ -7,9 +7,8 @@ + #include + #include + #include +-#include + +-#include "common.h" ++#include "trace.h" + + static Event event; + +diff -ruN ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.c ltrace-0.5.3/sysdeps/linux-gnu/trace.c +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.c 2009-07-25 17:13:02.000000000 +0200 ++++ ltrace-0.5.3/sysdeps/linux-gnu/trace.c 2010-01-03 14:33:38.000000000 +0100 +@@ -5,10 +5,9 @@ + #include + #include + #include +-#include "ptrace.h" + #include + +-#include "common.h" ++#include "trace.h" + + /* If the system headers did not provide the constants, hard-code the normal + values. */ +diff -ruN ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.h ltrace-0.5.3/sysdeps/linux-gnu/trace.h +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.h 1970-01-01 01:00:00.000000000 +0100 ++++ ltrace-0.5.3/sysdeps/linux-gnu/trace.h 2010-01-03 14:33:26.000000000 +0100 +@@ -0,0 +1,32 @@ ++/* If the system headers did not provide the constants, hard-code the normal values. */ ++#ifndef __SYSDEPS_TRACE_H__ ++#define __SYSDEPS_TRACE_H__ ++ ++#include "ptrace.h" ++#include "common.h" ++ ++#ifndef PTRACE_EVENT_FORK ++#warning PTRACE_EVENT_FORK not found... redefining. ++#define PTRACE_OLDSETOPTIONS 21 ++#define PTRACE_SETOPTIONS 0x4200 ++#define PTRACE_GETEVENTMSG 0x4201 ++ ++/* options set using PTRACE_SETOPTIONS */ ++#define PTRACE_O_TRACESYSGOOD 0x00000001 ++#define PTRACE_O_TRACEFORK 0x00000002 ++#define PTRACE_O_TRACEVFORK 0x00000004 ++#define PTRACE_O_TRACECLONE 0x00000008 ++#define PTRACE_O_TRACEEXEC 0x00000010 ++#define PTRACE_O_TRACEVFORKDONE 0x00000020 ++#define PTRACE_O_TRACEEXIT 0x00000040 ++ ++/* Wait extended result codes for the above trace options. */ ++#define PTRACE_EVENT_FORK 1 ++#define PTRACE_EVENT_VFORK 2 ++#define PTRACE_EVENT_CLONE 3 ++#define PTRACE_EVENT_EXEC 4 ++#define PTRACE_EVENT_VFORK_DONE 5 ++#define PTRACE_EVENT_EXIT 6 ++ ++#endif /* PTRACE_EVENT_FORK */ ++#endif /* __SYSDEPS_TRACE_H__ */ diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh --- a/scripts/build/debug/400-ltrace.sh +++ b/scripts/build/debug/400-ltrace.sh @@ -27,11 +27,19 @@ CT_Pushd "${CT_BUILD_DIR}/build-ltrace" CT_DoLog EXTRA "Configuring ltrace" - CT_DoExecLog ALL \ - ./configure \ - --build=${CT_BUILD} \ - --host=${CT_TARGET} \ - --prefix=/usr + # ltrace-0.5.3, and later, don't use GNU Autotools configure script anymore + if [ "${CT_LTRACE_0_5_3_or_later}" = "y" ]; then + CC=${CT_TARGET}-${CT_CC} \ + HOST=${CT_ARCH} \ + CFLAGS="${CT_TARGET_CFLAGS}" \ + CT_DoExecLog ALL ./configure --prefix=/usr + else + CT_DoExecLog ALL \ + ./configure \ + --build=${CT_BUILD} \ + --host=${CT_TARGET} \ + --prefix=/usr + fi CT_DoLog EXTRA "Building ltrace" CT_DoExecLog ALL make -- For unsubscribe information see http://sourceware.org/lists.html#faq