From 6638e92f6a6c49f57bd1909e8e05a11d5c7abaf7 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 13 Jul 2013 14:43:54 +0200 Subject: [PATCH 1/1] - new - libname patch renames too common library name: libcommon to libdyncommon - link patch fixed interlibrary linking --- dyninst-libname.patch | 174 ++++++++++++++++++++++++++++++++++++++++++ dyninst-link.patch | 86 +++++++++++++++++++++ dyninst.spec | 146 +++++++++++++++++++++++++++++++++++ 3 files changed, 406 insertions(+) create mode 100644 dyninst-libname.patch create mode 100644 dyninst-link.patch create mode 100644 dyninst.spec diff --git a/dyninst-libname.patch b/dyninst-libname.patch new file mode 100644 index 0000000..d352a82 --- /dev/null +++ b/dyninst-libname.patch @@ -0,0 +1,174 @@ +--- DyninstAPI-8.1.2/common/make.module.tmpl.orig 2013-06-07 19:29:26.000000000 +0200 ++++ DyninstAPI-8.1.2/common/make.module.tmpl 2013-07-12 16:01:20.253626485 +0200 +@@ -29,9 +29,9 @@ + + ifndef TARGET + ifndef STATIC_COMPS +-TARGET = libcommon.so ++TARGET = libdyncommon.so + else +-TARGET = libcommon.a ++TARGET = libdyncommon.a + endif + endif + +--- DyninstAPI-8.1.2/instructionAPI/make.module.tmpl.orig 2013-06-07 19:29:35.000000000 +0200 ++++ DyninstAPI-8.1.2/instructionAPI/make.module.tmpl 2013-07-12 17:17:31.730101306 +0200 +@@ -16,7 +16,7 @@ + CFLAGS += $(USEFULWARNINGS) $(DEFINES) + CXXFLAGS += $(USEFULWARNINGS) $(DEFINES) + +-LDFLAGS += -lcommon ++LDFLAGS += -ldyncommon + + ifndef TARGET + ifdef STATIC_COMPS +--- DyninstAPI-8.1.2/symtabAPI/make.module.tmpl.orig 2013-06-07 19:29:41.000000000 +0200 ++++ DyninstAPI-8.1.2/symtabAPI/make.module.tmpl 2013-07-12 17:53:04.256678481 +0200 +@@ -45,7 +45,7 @@ + endif + endif + +-LDFLAGS += -L../../common/$(PLATFORM) -lcommon ++LDFLAGS += -L../../common/$(PLATFORM) -ldyncommon + + ifdef LIBDWARF_PLATFORM + LDFLAGS += -L../../dwarf/$(PLATFORM) -ldynDwarf +--- DyninstAPI-8.1.2/parseAPI/make.module.tmpl.orig 2013-06-07 19:29:36.000000000 +0200 ++++ DyninstAPI-8.1.2/parseAPI/make.module.tmpl 2013-07-12 18:27:24.943258667 +0200 +@@ -30,7 +30,7 @@ + CFLAGS += $(USEFULWARNINGS) -I$(TO_CORE)/../include + CXXFLAGS += $(USEFULWARNINGS) -I$(TO_CORE)/../include + +-LDFLAGS += -L../../common/$(PLATFORM) -lcommon -L../../symlite/$(PLATFORM) -lsymLite ++LDFLAGS += -L../../common/$(PLATFORM) -ldyncommon -L../../symlite/$(PLATFORM) -lsymLite + + ifneq (x$(WITHOUT_SYMTAB_API),xtrue) + LDFLAGS += -L../../symtabAPI/$(PLATFORM) -lsymtabAPI +--- DyninstAPI-8.1.2/patchAPI/make.module.tmpl.orig 2013-06-07 19:29:38.000000000 +0200 ++++ DyninstAPI-8.1.2/patchAPI/make.module.tmpl 2013-07-12 19:13:56.526474847 +0200 +@@ -14,7 +14,7 @@ + CFLAGS += $(USEFULWARNINGS) -I$(TO_CORE)/../include + CXXFLAGS += $(USEFULWARNINGS) -I$(TO_CORE)/../include + +-LDFLAGS += -L../../common/$(PLATFORM) -L../../symtabAPI/$(PLATFORM) -L../../parseAPI/$(PLATFORM) -L../../instructionAPI/$(PLATFORM) -lcommon -lsymtabAPI -linstructionAPI -lparseAPI ++LDFLAGS += -L../../common/$(PLATFORM) -L../../symtabAPI/$(PLATFORM) -L../../parseAPI/$(PLATFORM) -L../../instructionAPI/$(PLATFORM) -ldyncommon -lsymtabAPI -linstructionAPI -lparseAPI + + LDFLAGS += $(LIBDIR) + ifndef USES_NATIVE_CC +--- DyninstAPI-8.1.2/Makefile.orig 2013-06-07 19:29:23.000000000 +0200 ++++ DyninstAPI-8.1.2/Makefile 2013-07-12 20:16:12.919651379 +0200 +@@ -166,14 +166,14 @@ + @echo $(Everything) + + PKGCONFIG_CFLAGS = $(CXX_REQ_FLAGS) -I$(includedir) +-PKGCONFIG_LIBS = -L$(libdir) -ldyninstAPI -lstackwalk -lpcontrol -lpatchAPI -lparseAPI -linstructionAPI -lsymtabAPI -lsymLite -ldynDwarf -ldynElf -lcommon ++PKGCONFIG_LIBS = -ldyninstAPI -lstackwalk -lpcontrol -lpatchAPI -lparseAPI -linstructionAPI -lsymtabAPI -lsymLite -ldynDwarf -ldynElf -ldyncommon + + ifdef LIBDWARF_PLATFORM + PKGCONFIG_CFLAGS += -I$(LIBDWARF_INC) + ifeq (xtrue,x$(LIBDWARF_STATIC)) + PKGCONFIG_LIBS += -rdynamic -Wl,--whole-archive + endif +-PKGCONFIG_LIBS += -L$(LIBDWARF_LIB) -ldwarf ++PKGCONFIG_LIBS += -ldwarf + ifeq (xtrue,x$(LIBDWARF_STATIC)) + PKGCONFIG_LIBS += -Wl,--no-whole-archive + endif +@@ -181,7 +181,7 @@ + + ifdef LIBELF_PLATFORM + PKGCONFIG_CFLAGS += -I$(LIBELF_INC) +-PKGCONFIG_LIBS += -L$(LIBELF_LIB) -lelf ++PKGCONFIG_LIBS += -lelf + endif + + ifdef USE_LIBIBERTY +--- DyninstAPI-8.1.2/proccontrol/i386-unknown-linux2.4/Makefile.orig 2013-06-07 19:29:38.000000000 +0200 ++++ DyninstAPI-8.1.2/proccontrol/i386-unknown-linux2.4/Makefile 2013-07-12 20:17:24.109648392 +0200 +@@ -11,7 +11,7 @@ + + TARGET = libpcontrol.so + +-LDFLAGS += $(LIBDIR) -lcommon ++LDFLAGS += $(LIBDIR) -ldyncommon + + SRCS = ../src/linux.C \ + ../src/unix.C \ +--- DyninstAPI-8.1.2/proccontrol/x86_64-unknown-linux2.4/Makefile.orig 2013-06-07 19:29:39.000000000 +0200 ++++ DyninstAPI-8.1.2/proccontrol/x86_64-unknown-linux2.4/Makefile 2013-07-13 12:37:17.537181065 +0200 +@@ -11,7 +11,7 @@ + + TARGET = libpcontrol.so + +-LDFLAGS += $(LIBDIR) -lcommon ++LDFLAGS += $(LIBDIR) -ldyncommon + + SRCS = ../src/linux.C \ + ../src/unix.C \ +--- DyninstAPI-8.1.2/proccontrol/ppc32_linux/Makefile.orig 2013-06-07 19:29:38.000000000 +0200 ++++ DyninstAPI-8.1.2/proccontrol/ppc32_linux/Makefile 2013-07-13 12:37:42.067180035 +0200 +@@ -11,7 +11,7 @@ + + TARGET = libpcontrol.so + +-LDFLAGS += $(LIBDIR) -lcommon ++LDFLAGS += $(LIBDIR) -ldyncommon + + SRCS = ../src/linux.C \ + ../src/unix.C \ +--- DyninstAPI-8.1.2/proccontrol/ppc64_linux/Makefile.orig 2013-06-07 19:29:38.000000000 +0200 ++++ DyninstAPI-8.1.2/proccontrol/ppc64_linux/Makefile 2013-07-13 12:37:59.953845953 +0200 +@@ -11,7 +11,7 @@ + + TARGET = libpcontrol.so + +-LDFLAGS += $(LIBDIR) -lcommon ++LDFLAGS += $(LIBDIR) -ldyncommon + + SRCS = ../src/linux.C \ + ../src/unix.C \ +--- DyninstAPI-8.1.2/stackwalk/i386-unknown-linux2.4/Makefile.orig 2013-06-07 19:29:40.000000000 +0200 ++++ DyninstAPI-8.1.2/stackwalk/i386-unknown-linux2.4/Makefile 2013-07-12 20:35:22.019603157 +0200 +@@ -17,7 +17,7 @@ + # Now make any necessary architecture specific changes to variables: + include ../make.module.tmpl + +-LDFLAGS += $(LIBDIR) -lcommon -ldl ++LDFLAGS += $(LIBDIR) -ldyncommon -ldl + + SRCS += ../src/linux-swk.C \ + ../src/linuxbsd-x86-swk.C \ +--- DyninstAPI-8.1.2/stackwalk/x86_64-unknown-linux2.4/Makefile.orig 2013-06-07 19:29:40.000000000 +0200 ++++ DyninstAPI-8.1.2/stackwalk/x86_64-unknown-linux2.4/Makefile 2013-07-13 12:38:20.397178429 +0200 +@@ -11,7 +11,7 @@ + + include ../../make.config + +-LDFLAGS += -lcommon ++LDFLAGS += -ldyncommon + + SRCS = ../src/linux-swk.C \ + ../src/linuxbsd-x86-swk.C \ +--- DyninstAPI-8.1.2/stackwalk/ppc32_linux/Makefile.orig 2013-06-07 19:29:40.000000000 +0200 ++++ DyninstAPI-8.1.2/stackwalk/ppc32_linux/Makefile 2013-07-13 12:38:44.507177415 +0200 +@@ -14,7 +14,7 @@ + + # Now make any necessary architecture specific changes to variables: + +-LDFLAGS += $(LIBDIR) -lcommon -ldl ++LDFLAGS += $(LIBDIR) -ldyncommon -ldl + + SRCS = ../src/linux-swk.C \ + ../src/linux-ppc-swk.C \ +--- DyninstAPI-8.1.2/stackwalk/ppc64_linux/Makefile.orig 2013-06-07 19:29:40.000000000 +0200 ++++ DyninstAPI-8.1.2/stackwalk/ppc64_linux/Makefile 2013-07-13 12:39:03.747176611 +0200 +@@ -14,7 +14,7 @@ + + # Now make any necessary architecture specific changes to variables: + +-LDFLAGS += $(LIBDIR) -lcommon -ldl ++LDFLAGS += $(LIBDIR) -ldyncommon -ldl + + SRCS = ../src/linux-swk.C \ + ../src/linux-ppc-swk.C \ diff --git a/dyninst-link.patch b/dyninst-link.patch new file mode 100644 index 0000000..c0afdf0 --- /dev/null +++ b/dyninst-link.patch @@ -0,0 +1,86 @@ +--- DyninstAPI-8.1.2/proccontrol/make.module.tmpl.orig 2013-06-07 19:29:38.000000000 +0200 ++++ DyninstAPI-8.1.2/proccontrol/make.module.tmpl 2013-07-12 15:56:32.196971904 +0200 +@@ -94,4 +94,4 @@ + LDFLAGS += -L../../elf/$(PLATFORM) -ldynElf + endif + +-LDFLAGS += ${EXTRA_LIBS} ++LDFLAGS += ${EXTRA_LIBS} -lpthread +--- DyninstAPI-8.1.2/dwarf/make.module.tmpl.orig 2013-06-07 19:29:28.000000000 +0200 ++++ DyninstAPI-8.1.2/dwarf/make.module.tmpl 2013-07-12 16:02:51.443622660 +0200 +@@ -32,7 +32,7 @@ + + LDFLAGS += $(LIBDIR) + LD = $(GXX) +-LDFLAGS += -shared $(G_PTHREAD_LD) ++LDFLAGS += -shared $(G_PTHREAD_LD) -L../../elf/$(PLATFORM) -ldynElf -L../../common/$(PLATFORM) -ldyncommon + CFLAGS += + CXXFLAGS += $(G_PTHREAD) + TFLAGS += +--- DyninstAPI-8.1.2/elf/make.module.tmpl.orig 2013-06-07 19:29:34.000000000 +0200 ++++ DyninstAPI-8.1.2/elf/make.module.tmpl 2013-07-12 16:04:12.173619270 +0200 +@@ -41,7 +41,7 @@ + + LDFLAGS += $(LIBDIR) + LD = $(GXX) +-LDFLAGS += -shared $(G_PTHREAD_LD) ++LDFLAGS += -shared $(G_PTHREAD_LD) -L../../common/$(PLATFORM) -ldyncommon + CFLAGS += + CXXFLAGS += $(G_PTHREAD) + TFLAGS += +--- DyninstAPI-8.1.2/symlite/make.module.tmpl.orig 2013-06-07 19:29:40.000000000 +0200 ++++ DyninstAPI-8.1.2/symlite/make.module.tmpl 2013-07-12 16:05:24.890282886 +0200 +@@ -43,7 +43,7 @@ + + LDFLAGS += $(LIBDIR) + LD = $(GXX) +-LDFLAGS += -shared $(G_PTHREAD_LD) ++LDFLAGS += -shared $(G_PTHREAD_LD) -L../../common/$(PLATFORM) -ldyncommon + CFLAGS += + CXXFLAGS += $(G_PTHREAD) + TFLAGS += +--- DyninstAPI-8.1.2/stackwalk/make.module.tmpl.orig 2013-06-07 19:29:40.000000000 +0200 ++++ DyninstAPI-8.1.2/stackwalk/make.module.tmpl 2013-07-12 16:07:28.643611026 +0200 +@@ -86,7 +86,7 @@ + LDFLAGS += -L../../symlite/$(PLATFORM) -lsymLite + endif + +-LDFLAGS += -L../../proccontrol/$(PLATFORM) -lpcontrol ++LDFLAGS += -L../../proccontrol/$(PLATFORM) -lpcontrol -L../../symlite/$(PLATFORM) -lsymLite + + IFLAGS += -I../$(PLATFORM) -I../src -I../h -I../../proccontrol/h -I../../symtabAPI/h -I../../parseAPI/h -I../../instructionAPI/h + +--- DyninstAPI-8.1.2/dyninstAPI/make.module.tmpl.orig 2013-06-07 19:29:29.000000000 +0200 ++++ DyninstAPI-8.1.2/dyninstAPI/make.module.tmpl 2013-07-12 16:08:30.446941764 +0200 +@@ -46,7 +46,7 @@ + USES_DWARF_DEBUG = true + USES_LIBELF = true + +-LDFLAGS += -lpthread -lstackwalk -lpcontrol -lpatchAPI -lparseAPI -linstructionAPI -lsymtabAPI -ldynElf -ldynDwarf ++LDFLAGS += -lpthread -lstackwalk -lpcontrol -lpatchAPI -lparseAPI -linstructionAPI -lsymtabAPI -ldynElf -ldynDwarf -ldyncommon + + LDFLAGS += -L../../common/$(PLATFORM) + LDFLAGS += -L../../elf/$(PLATFORM) +--- DyninstAPI-8.1.2/make.components.orig 2013-06-07 19:29:35.000000000 +0200 ++++ DyninstAPI-8.1.2/make.components 2013-07-12 17:10:40.483451898 +0200 +@@ -2,9 +2,9 @@ + Everything = dynutil common elf dwarf symlite symtabAPI instructionAPI parseAPI patchAPI proccontrol stackwalk dyninstAPI_RT dyninstAPI dynC_API + + Common = dynutil common +-Dwarf = ${Common} dwarf ++Dwarf = ${Common} elf dwarf + Elf = ${Common} elf +-SymLite = ${Elf} symlite ++SymLite = ${Common} ${Elf} symlite + SymtabAPI = ${Common} ${Elf} ${Dwarf} symtabAPI + InstructionAPI = ${Common} instructionAPI + ParseAPI = ${Common} ${SymtabAPI} ${SymLite} ${InstructionAPI} parseAPI +@@ -14,7 +14,7 @@ + DynC_API = ${DyninstAPI} dynC_API + Dyner = ${DyninstAPI} dyner + +-StackwalkerAPI = ${ProcControlAPI} ++StackwalkerAPI = ${ProcControlAPI} ${SymLite} + ifndef WITHOUT_PARSE_API + StackwalkerAPI += ${ParseAPI} ${InstructionAPI} + endif diff --git a/dyninst.spec b/dyninst.spec new file mode 100644 index 0000000..4f8622b --- /dev/null +++ b/dyninst.spec @@ -0,0 +1,146 @@ +Summary: API for Run-time Code Generation +Summary(pl.UTF-8): API do generowania kodu w czasie działania +Name: dyninst +Version: 8.1.2 +Release: 1 +License: LGPL v2.1+ +Group: Libraries +#Source0Download: http://www.dyninst.org/downloads/dyninst-8.x +Source0: http://www.dyninst.org/sites/default/files/downloads/dyninst/%{version}/DyninstAPI-%{version}.tgz +# Source0-md5: bf03b33375afa66fe0efa46ce3f4b17a +Patch0: %{name}-libname.patch +Patch1: %{name}-link.patch +URL: http://www.dyninst.org/dyninst +BuildRequires: autoconf >= 2.63 +BuildRequires: binutils-devel +BuildRequires: boost-devel >= 1.42 +BuildRequires: elfutils-devel +BuildRequires: flex +BuildRequires: libdwarf-devel >= 0.20130126 +BuildRequires: libstdc++-devel +BuildRequires: libxml2-devel >= 2 +BuildRequires: nasm +BuildRequires: sed >= 4.0 +BuildRequires: tcl-devel >= 8.5 +Requires: libdwarf >= 0.20130126 +ExclusiveArch: %{ix86} %{x8664} ppc ppc64 +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Dyninst is an Application Program Interface (API) to permit the +insertion of code into a running program. The API also permits +changing or removing subroutine calls from the application program. +Run-time code changes are useful to support a variety of applications +including debugging, performance monitoring, and to support composing +applications out of existing packages. The goal of this API is to +provide a machine independent interface to permit the creation of +tools and applications that use run-time code patching. + +%description -l pl.UTF-8 +Dyninst to API (interfejs programowy) pozwalający na wstawianie kodu +do działającego programu. API pozwala także na zmianę lub usuwanie +wywołań funkcji z programu aplikacji. Zmiany kodu w czasie działania +są przydatne w wielu zastosowaniach, w tym diagnostyce, monitorowaniu +wydajności oraz wsparciu składania aplikacji z istniejących pakietów. +Celem tego API jest zapewnienie niezależnego od maszyny interfejsu +pozwalającego na tworzenie narzędzi i aplikacji wykorzystujących +modyfikowanie kodu w czasie działania. + +%package devel +Summary: Header files for dyninst libraries +Summary(pl.UTF-8): Pliki nagłówkowe bibliotek dyninst +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +Header files for dyninst libraries. + +%description devel -l pl.UTF-8 +Pliki nagłówkowe bibliotek dyninst. + +%package static +Summary: Static dyninst libraries +Summary(pl.UTF-8): Statyczne biblioteki dyninst +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} + +%description static +Static dyninst libraries. + +%description static -l pl.UTF-8 +Statyczne biblioteki dyninst. + +%prep +%setup -q -n DyninstAPI-%{version} +%patch0 -p1 +%patch1 -p1 + +%{__sed} -i -e 's/tcl8\.4/tcl8.5/' configure.in + +%build +%{__autoconf} +%configure \ + --includedir=%{_includedir}/dyninst + +%{__make} \ + VERBOSE_COMPILATION=1 + +%install +rm -rf $RPM_BUILD_ROOT + +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(644,root,root,755) +%doc COPYRIGHT ChangeLog README +%attr(755,root,root) %{_libdir}/libdynDwarf.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libdynDwarf.so.8.1 +%attr(755,root,root) %{_libdir}/libdynElf.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libdynElf.so.8.1 +%attr(755,root,root) %{_libdir}/libdyncommon.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libdyncommon.so.8.1 +%attr(755,root,root) %{_libdir}/libdyninstAPI.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libdyninstAPI.so.8.1 +%attr(755,root,root) %{_libdir}/libdyninstAPI_RT.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libdyninstAPI_RT.so.8.1 +%attr(755,root,root) %{_libdir}/libinstructionAPI.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libinstructionAPI.so.8.1 +%attr(755,root,root) %{_libdir}/libparseAPI.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libparseAPI.so.8.1 +%attr(755,root,root) %{_libdir}/libpatchAPI.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libpatchAPI.so.8.1 +%attr(755,root,root) %{_libdir}/libpcontrol.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libpcontrol.so.8.1 +%attr(755,root,root) %{_libdir}/libstackwalk.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libstackwalk.so.8.1 +%attr(755,root,root) %{_libdir}/libsymLite.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libsymLite.so.8.1 +%attr(755,root,root) %{_libdir}/libsymtabAPI.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libsymtabAPI.so.8.1 + +%files devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libdynDwarf.so +%attr(755,root,root) %{_libdir}/libdynElf.so +%attr(755,root,root) %{_libdir}/libdyncommon.so +%attr(755,root,root) %{_libdir}/libdyninstAPI.so +%attr(755,root,root) %{_libdir}/libdyninstAPI_RT.so +%attr(755,root,root) %{_libdir}/libinstructionAPI.so +%attr(755,root,root) %{_libdir}/libparseAPI.so +%attr(755,root,root) %{_libdir}/libpatchAPI.so +%attr(755,root,root) %{_libdir}/libpcontrol.so +%attr(755,root,root) %{_libdir}/libstackwalk.so +%attr(755,root,root) %{_libdir}/libsymLite.so +%attr(755,root,root) %{_libdir}/libsymtabAPI.so +%{_includedir}/dyninst + +%files static +%defattr(644,root,root,755) +%{_libdir}/libdyninstAPI_RT.a -- 2.44.0