diff options
author | Michael Weber <xmw@gentoo.org> | 2010-08-24 14:29:29 +0000 |
---|---|---|
committer | Michael Weber <xmw@gentoo.org> | 2010-08-24 14:29:29 +0000 |
commit | 100912b55be791db1dcebfb7458192cfda646ce5 (patch) | |
tree | 903ec8b598c6159bffcea8bb542dae17c2e114bb /dev-util | |
parent | Automated update of use.local.desc (diff) | |
download | gentoo-2-100912b55be791db1dcebfb7458192cfda646ce5.tar.gz gentoo-2-100912b55be791db1dcebfb7458192cfda646ce5.tar.bz2 gentoo-2-100912b55be791db1dcebfb7458192cfda646ce5.zip |
Initial comit for exmap
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-util')
-rw-r--r-- | dev-util/exmap/ChangeLog | 14 | ||||
-rw-r--r-- | dev-util/exmap/exmap-0.10.ebuild | 75 | ||||
-rw-r--r-- | dev-util/exmap/files/exmap-0.10-as-needed.patch | 21 | ||||
-rw-r--r-- | dev-util/exmap/files/exmap-0.10-fix64bit.patch | 24 | ||||
-rw-r--r-- | dev-util/exmap/files/exmap-0.10-gcc.patch | 68 | ||||
-rw-r--r-- | dev-util/exmap/files/exmap-0.10-gcc45.patch | 11 | ||||
-rw-r--r-- | dev-util/exmap/files/exmap-0.10-kernel.patch | 50 | ||||
-rw-r--r-- | dev-util/exmap/files/exmap-0.10-makefiles.patch | 115 | ||||
-rw-r--r-- | dev-util/exmap/metadata.xml | 10 |
9 files changed, 388 insertions, 0 deletions
diff --git a/dev-util/exmap/ChangeLog b/dev-util/exmap/ChangeLog new file mode 100644 index 000000000000..cbacab78f7b5 --- /dev/null +++ b/dev-util/exmap/ChangeLog @@ -0,0 +1,14 @@ +# ChangeLog for dev-util/exmap +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-util/exmap/ChangeLog,v 1.1 2010/08/24 14:29:29 xmw Exp $ + +*exmap-0.10 (24 Aug 2010) + + 24 Aug 2010; Michael Weber (xmw) <xmw@gentoo.org> +exmap-0.10.ebuild, + +files/exmap-0.10-as-needed.patch, +files/exmap-0.10-fix64bit.patch, + +files/exmap-0.10-gcc.patch, +files/exmap-0.10-gcc45.patch, + +files/exmap-0.10-kernel.patch, +files/exmap-0.10-makefiles.patch, + +metadata.xml: + Initial commit for exmap. Fixes bug #158382, thanks to Paul Pacheco and + all the other contributors there. + diff --git a/dev-util/exmap/exmap-0.10.ebuild b/dev-util/exmap/exmap-0.10.ebuild new file mode 100644 index 000000000000..1998e1e661ae --- /dev/null +++ b/dev-util/exmap/exmap-0.10.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-util/exmap/exmap-0.10.ebuild,v 1.1 2010/08/24 14:29:29 xmw Exp $ + +EAPI=2 + +inherit eutils linux-mod + +DESCRIPTION="A memory analysis kernel module with userland tool" +HOMEPAGE="http://www.berthels.co.uk/exmap/" +SRC_URI="http://www.berthels.co.uk/${PN}/download/${P}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="gtk" + +RDEPEND="dev-libs/libpcre + gtk? ( x11-libs/gtk+:2 )" +DEPEND="${RDEPEND} + dev-libs/boost + dev-util/pkgconfig" + +MODULE_NAMES="exmap(misc:${S}/kernel)" +BUILD_TARGETS="clean kernel_modules" + +src_prepare() { + # patch find_task_by_pid to pid_task and &proc_root to NULL + epatch "${FILESDIR}/${P}-kernel.patch" + + # use $(MAKE), remove -g on CXXFLAGS, clean up CXX/LD invocations + epatch "${FILESDIR}/${P}-makefiles.patch" + + # somthing strange between linux-mod supplied ARCH and old kernels + # which leads to arch/x86/Makefile: file/dir x86 not found + if kernel_is lt 2 6 25 ; then + sed -i -e 's:\$(MAKE):unset ARCH ; \$(MAKE):' kernel/Makefile || die + fi + + # new gcc include behavior + epatch "${FILESDIR}/${P}-gcc.patch" + + # gcc4.5 fails on return false as std::string + epatch "${FILESDIR}/${P}-gcc45.patch" + + # fix for 64bit from http://www.kdedevelopers.org/node/4166 + epatch "${FILESDIR}/${P}-fix64bit.patch" + + # fix underlinking with -Wl,--as-needed + epatch "${FILESDIR}/${P}-as-needed.patch" + + rm -v src/{*.so,munged-ls-threeloads,prelinked-amule} || die +} + +src_compile() { + export KERNEL_DIR + linux-mod_src_compile + + emake CXX="$(tc-getCXX)" LD="$(tc-getLD)" -C jutil || die + emake CXX="$(tc-getCXX)" LD="$(tc-getLD)" -C src $(use gtk || echo exmtool) || die +} + +src_install() { + linux-mod_src_install + + dobin src/exmtool || die + use gtk && { dobin src/gexmap || die ; } + dodoc TODO README || die +} + +pkg_postinst() { + linux-mod_pkg_postinst + + elog "Please load the exmap kernel module before running exmtool or gexmap." +} diff --git a/dev-util/exmap/files/exmap-0.10-as-needed.patch b/dev-util/exmap/files/exmap-0.10-as-needed.patch new file mode 100644 index 000000000000..72671b31fc70 --- /dev/null +++ b/dev-util/exmap/files/exmap-0.10-as-needed.patch @@ -0,0 +1,21 @@ +--- src/Makefile 2010-08-09 01:17:29.000000000 +0200 ++++ src/Makefile 2010-08-09 01:21:13.000000000 +0200 +@@ -42,15 +42,15 @@ + OBJS += $(TR_OBJ) + TESTS += t_range + +-TE_OBJ = t_elf.o Elf.o Range.o ++TE_OBJ = t_elf.o Elf.o Range.o ../jutil/Pcre.o + OBJS += $(TE_OBJ) + TESTS += t_elf + +-TP_OBJ = t_pcre.o ++TP_OBJ = t_pcre.o ../jutil/Pcre.o + OBJS += $(TP_OBJ) + TESTS += t_pcre + +-TX_OBJ = t_exmap.o $(EXMAP_OBJ) ++TX_OBJ = t_exmap.o ../jutil/Pcre.o $(EXMAP_OBJ) + OBJS += $(TX_OBJ) + TESTS += t_exmap + diff --git a/dev-util/exmap/files/exmap-0.10-fix64bit.patch b/dev-util/exmap/files/exmap-0.10-fix64bit.patch new file mode 100644 index 000000000000..8f886f1fe9a7 --- /dev/null +++ b/dev-util/exmap/files/exmap-0.10-fix64bit.patch @@ -0,0 +1,24 @@ +I quite frankly don't entirely understand this code, but exmap's debug +output on i586 and x86_64 pointed out these differences and this makes +it work. + +--- exmap-0.10/src/Exmap.cpp.sav 2006-09-28 18:52:25.000000000 +0200 ++++ exmap-0.10/src/Exmap.cpp 2010-01-02 17:45:49.787955568 +0100 +@@ -450,7 +450,7 @@ void Vma::add_pages(const list<Page> &pa + + bool Vma::is_vdso() + { +- return fname() == "[vdso]"; ++ return fname() == "[vdso]" || fname() == "[vsyscall]"; + } + + bool Vma::is_file_backed() +@@ -1495,7 +1495,7 @@ bool MapCalculator::calc_map_for_seg(con + + filevmas.pop_front(); + dbg << pref.str() << "consuming vma\n"; +- if (!filevmas.empty() && !filevmas.front()->is_file_backed()) { ++ while (!filevmas.empty() && !filevmas.front()->is_file_backed()) { + filevmas.pop_front(); + dbg << pref.str() << "consuming anon vma\n"; + } diff --git a/dev-util/exmap/files/exmap-0.10-gcc.patch b/dev-util/exmap/files/exmap-0.10-gcc.patch new file mode 100644 index 000000000000..fd73371529bc --- /dev/null +++ b/dev-util/exmap/files/exmap-0.10-gcc.patch @@ -0,0 +1,68 @@ +diff -ru exmap-0.10/work/exmap-0.10/jutil/jutil.cpp exm/work/exmap-0.10/jutil/jutil.cpp +--- jutil/jutil.cpp 2006-09-28 18:52:25.000000000 +0200 ++++ jutil/jutil.cpp 2010-02-15 15:35:43.000000000 +0100 +@@ -3,6 +3,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> ++#include <cstring> + #include <limits.h> + #include <dirent.h> + +diff -ru exmap-0.10/work/exmap-0.10/jutil/jutil.hpp exm/work/exmap-0.10/jutil/jutil.hpp +--- jutil/jutil.hpp 2006-09-28 18:52:25.000000000 +0200 ++++ jutil/jutil.hpp 2010-02-15 15:40:02.000000000 +0100 +@@ -3,6 +3,7 @@ + + #include <iostream> + #include <string> ++#include <cstdlib> + #include <list> + #include <map> + +diff -ru exmap-0.10/work/exmap-0.10/src/exmtool.cpp exm/work/exmap-0.10/src/exmtool.cpp +--- src/exmtool.cpp 2006-09-28 18:52:25.000000000 +0200 ++++ src/exmtool.cpp 2010-02-15 15:34:04.000000000 +0100 +@@ -5,6 +5,7 @@ + + #include <sstream> + #include <iostream> ++#include <cstring> + #include <vector> + + using namespace std; +@@ -19,9 +18,9 @@ + + struct command + { +- char *command; ++ const char *command; + Handler handler; +- char *usage; ++ const char *usage; + } cmd_handles[] = { + { "procs", + do_procs, + +diff -ru exmap-0.10/work/exmap-0.10/src/Elf.cpp norg/work/exmap-0.10/src/Elf.cpp +--- src/Elf.cpp 2006-09-28 18:52:25.000000000 +0200 ++++ src/Elf.cpp 2010-02-15 16:55:37.000000000 +0100 +@@ -4,6 +4,7 @@ + #include "Elf.hpp" + + #include <sstream> ++#include <cstring> + #include <unistd.h> // getpagesize() + + using namespace std; + +diff -ru exmap-0.10/jutil/TestRunner.cpp.orig exmap-0.10/jutil/TestRunner.cpp +--- jutil/TestRunner.cpp.orig 2010-02-15 22:00:03.000000000 +0100 ++++ jutil/TestRunner.cpp 2010-02-15 22:00:19.000000000 +0100 +@@ -1,5 +1,6 @@ + #include "TestRunner.hpp" + #include "Pcre.hpp" ++#include <cstdio> + + using namespace std; + diff --git a/dev-util/exmap/files/exmap-0.10-gcc45.patch b/dev-util/exmap/files/exmap-0.10-gcc45.patch new file mode 100644 index 000000000000..a9ed3419e774 --- /dev/null +++ b/dev-util/exmap/files/exmap-0.10-gcc45.patch @@ -0,0 +1,11 @@ +--- src/Elf.cpp 2010-05-14 01:40:27.000000000 +0200 ++++ src/Elf.cpp 2010-05-14 01:46:06.000000000 +0200 +@@ -579,7 +579,7 @@ + std::string Section::find_string(istream &is, int index) + { + if (!is_string_table() || index < 0) { +- return false; ++ return NULL; + } + + int offset = _sectstruct->offset() + index; diff --git a/dev-util/exmap/files/exmap-0.10-kernel.patch b/dev-util/exmap/files/exmap-0.10-kernel.patch new file mode 100644 index 000000000000..8bc58737b6d5 --- /dev/null +++ b/dev-util/exmap/files/exmap-0.10-kernel.patch @@ -0,0 +1,50 @@ +Tested with linux-2.6.16-gentoo-r13, linux-2.6.25-gentoo-r9, linux-2.6.26-gentoo-r4, linux-2.6.27-gentoo-r10, +linux-2.6.28-gentoo-r6, linux-2.6.29-gentoo-r6, linux-2.6.30-gentoo-r9, linux-2.6.32-gentoo-r4, linux-2.6.32-gentoo-r5 + +diff -ru exmap-0.10.orig/work/exmap-0.10/kernel/exmap.c exmap-0.10/work/exmap-0.10/kernel/exmap.c +--- kernel/exmap.c 2006-09-28 18:52:25.000000000 +0200 ++++ kernel/exmap.c 2010-02-17 16:15:04.000000000 +0100 +@@ -392,7 +392,11 @@ + struct task_struct *tsk; + int errcode = -EINVAL; + ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ tsk = pid_task(find_pid_ns(pid, &init_pid_ns), PIDTYPE_PID); ++ #else + tsk = find_task_by_pid(pid); ++ #endif + if (tsk == NULL) { + printk (KERN_ALERT + "/proc/%s: can't find task for pid %d\n", +@@ -507,7 +511,11 @@ + NULL); + + if (exmap_proc_file == NULL) { ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++ remove_proc_entry (PROCFS_NAME, NULL); ++ #else + remove_proc_entry (PROCFS_NAME, &proc_root); ++ #endif + printk (KERN_ALERT "/proc/%s: could not initialize\n", + PROCFS_NAME); + return -ENOMEM; +@@ -523,7 +523,9 @@ + + exmap_proc_file->read_proc = procfile_read; + exmap_proc_file->write_proc = procfile_write; ++ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,29) + exmap_proc_file->owner = THIS_MODULE; ++ #endif + + /* exmap_proc_file->mode = S_IFREG | S_IRUGO; */ + /* TODO - this is quite probably a security problem */ +@@ -532,5 +540,9 @@ + void cleanup_module () + { + printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME); ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++ remove_proc_entry (PROCFS_NAME, NULL); ++ #else + remove_proc_entry (PROCFS_NAME, &proc_root); ++ #endif + } diff --git a/dev-util/exmap/files/exmap-0.10-makefiles.patch b/dev-util/exmap/files/exmap-0.10-makefiles.patch new file mode 100644 index 000000000000..e3841c60566d --- /dev/null +++ b/dev-util/exmap/files/exmap-0.10-makefiles.patch @@ -0,0 +1,115 @@ +diff -ru exmap-0.10.orig/work/exmap-0.10/jutil/Makefile exmap-0.10/work/exmap-0.10/jutil/Makefile +--- jutil/Makefile 2006-09-28 18:52:25.000000000 +0200 ++++ jutil/Makefile 2010-02-17 17:31:56.000000000 +0100 +@@ -12,21 +12,20 @@ + OBJ += $(ETOBJ) + EXES += egtest + +-CXX=g++ +-CXXFLAGS=-Wall -Werror -g -I. +-LD=g++ +-LDFLAGS=-lpcre ++CXX = g++ ++CXXFLAGS += -Wall -Werror -I. ++LD = ld + + build: $(LIBS) $(EXES) + + trun: $(TROBJ) $(JLIB) +- $(LD) $(TROBJ) -o trun $(LDFLAGS) -ljutil -L. ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(TROBJ) -o trun -ljutil -lpcre -L. + + $(JLIB): $(JOBJ) + ar rs $(JLIB) $(JOBJ) + + egtest: $(ETOBJ) +- $(LD) $(ETOBJ) -o egtest $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(ETOBJ) -o egtest $(LDFLAGS) + + clean: + rm -f $(OBJ) $(EXES) $(JLIB) *~ +diff -ru exmap-0.10.orig/work/exmap-0.10/kernel/Makefile exmap-0.10/work/exmap-0.10/kernel/Makefile +--- kernel/Makefile 2006-09-28 18:52:25.000000000 +0200 ++++ kernel/Makefile 2010-02-17 17:30:06.000000000 +0100 +@@ -7,7 +7,7 @@ + build: kernel_modules + + kernel_modules: +- make -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) modules ++ $(MAKE) -C ${KERNEL_DIR} M=$(CURDIR) modules + + clean: +- make -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean ++ $(MAKE) -C ${KERNEL_DIR} M=$(CURDIR) clean +Only in exmap-0.10/work/exmap-0.10/kernel/.tmp_versions: exmap.mod +diff -ru exmap-0.10.orig/work/exmap-0.10/src/Makefile exmap-0.10/work/exmap-0.10/src/Makefile +--- src/Makefile 2006-09-28 18:52:25.000000000 +0200 ++++ src/Makefile 2010-02-17 17:33:38.000000000 +0100 +@@ -1,5 +1,5 @@ + CXX=g++ +-LD=g++ ++LD=ld + JUTILDIR=../jutil + + #CXXFLAGS += -pg +@@ -11,11 +11,12 @@ + + EXMAP_OBJ=Exmap.o Range.o Elf.o + +-CXXFLAGS += -g -Wall -Werror -I$(JUTILDIR) +-LDFLAGS += -lpcre -ljutil -L$(JUTILDIR) ++CXXFLAGS += -Wall -Werror -I$(JUTILDIR) ++LDFLAGS += -L$(JUTILDIR) ++LIBS += -lpcre -ljutil + + GTKCXXFLAGS = `pkg-config --cflags gtkmm-2.4` +-GTKLDFLAGS = `pkg-config --libs gtkmm-2.4` ++GTKLIBS = `pkg-config --libs gtkmm-2.4` + + # ------------------------------------------------------------ + +@@ -76,34 +77,34 @@ + $(JUTILDIR)/trun $(TESTS) + + gexmap: $(GEM_OBJ) +- $(LD) -o gexmap $(GEM_OBJ) $(LDFLAGS) $(GTKLDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o gexmap $(GEM_OBJ) $(LIBS) $(GTKLIBS) + + gexmap.o: gexmap.cpp +- $(CC) $(CXXFLAGS) $(GTKCXXFLAGS) -c $< ++ $(CXX) $(CXXFLAGS) $(GTKCXXFLAGS) -c $< + + exmtool: $(CL_OBJ) +- $(LD) -o exmtool $(CL_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o exmtool $(CL_OBJ) $(LIBS) + + elftool: $(ET_OBJ) +- $(LD) -o elftool $(ET_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o elftool $(ET_OBJ) $(LIBS) + + showproc: $(SP_OBJ) +- $(LD) -o showproc $(SP_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o showproc $(SP_OBJ) $(LIBS) + + t_range: $(TR_OBJ) +- $(LD) -o t_range $(TR_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_range $(TR_OBJ) $(LIBS) + + t_elf: $(TE_OBJ) +- $(LD) -o t_elf $(TE_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_elf $(TE_OBJ) $(LIBS) + + t_pcre: $(TP_OBJ) +- $(LD) -o t_pcre $(TP_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_pcre $(TP_OBJ) $(LIBS) + + t_exmap: $(TX_OBJ) +- $(LD) -o t_exmap $(TX_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_exmap $(TX_OBJ) $(LIBS) + + t_artsd: $(TA_OBJ) +- $(LD) -o t_artsd $(TA_OBJ) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_artsd $(TA_OBJ) $(LIBS) + + clean: cleantags cleandoc + rm -f $(OBJS) $(EXES) $(SHLIBS) $(EXTRA_DEL_FILES) diff --git a/dev-util/exmap/metadata.xml b/dev-util/exmap/metadata.xml new file mode 100644 index 000000000000..3cce2cd0af2f --- /dev/null +++ b/dev-util/exmap/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>no-herd</herd> +<maintainer> +<email>xmw@gentoo.org</email> +<name>Michael Weber (xmw)</name> +</maintainer> +</pkgmetadata> + |