diff --git a/.dyninst.metadata b/.dyninst.metadata index 00e8677..ead09f8 100644 --- a/.dyninst.metadata +++ b/.dyninst.metadata @@ -1,3 +1,2 @@ -d8f3294524f1008bbb90e53b4868c80b43db9a47 SOURCES/dyninst-8.2.0.1.tar.gz -4c861851f7e5d09225a920e6d8987aa41e0dfe50 SOURCES/dyninst-docs-8.2.0.1.tar.gz -d202c4b34415da2d6958e2b218760c5ca08b26cf SOURCES/dyninst-testsuite-8.2.0.1.tar.gz +2f786d1fd6ac4dd8a74c7427ac97eaa49a1854b9 SOURCES/dyninst-9.3.1.tar.gz +5463fcfe1a374b41c5b829d9eefbf0c050fdb63d SOURCES/testsuite-9.3.0.tar.gz diff --git a/.gitignore b/.gitignore index 51e8e13..861d8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -SOURCES/dyninst-8.2.0.1.tar.gz -SOURCES/dyninst-docs-8.2.0.1.tar.gz -SOURCES/dyninst-testsuite-8.2.0.1.tar.gz +SOURCES/dyninst-9.3.1.tar.gz +SOURCES/testsuite-9.3.0.tar.gz diff --git a/SOURCES/dyninst-9.3.1-Address.patch b/SOURCES/dyninst-9.3.1-Address.patch new file mode 100644 index 0000000..213cc4a --- /dev/null +++ b/SOURCES/dyninst-9.3.1-Address.patch @@ -0,0 +1,108 @@ +--- dyninst-9.3.1/common/src/Types.h.sv 2017-03-07 22:05:52.187479600 -0500 ++++ dyninst-9.3.1/common/src/Types.h 2017-03-07 22:06:57.509944790 -0500 +@@ -170,7 +170,7 @@ + static const Address ADDR_NULL = (Address)(0); + #else + #define ADDR_NULL (0) +-typedef uintptr_t Address; ++typedef unsigned long Address; + #endif + /* Note the inherent assumption that the size of a "long" integer matches + that of an address (void*) on every supported Paradyn/Dyninst system! + + +--- dyninst-9.3.1/common/h/dyntypes.h.sv 2017-03-08 10:16:18.657768231 -0500 ++++ dyninst-9.3.1/common/h/dyntypes.h 2017-03-08 10:37:07.992634513 -0500 +@@ -124,8 +124,8 @@ + + namespace Dyninst + { +- typedef uintptr_t Address; +- typedef uintptr_t Offset; ++ typedef unsigned long Address; ++ typedef unsigned long Offset; + + #if defined(_MSC_VER) + typedef int PID; + + +--- dyninst-9.3.1/dyninstAPI/src/BPatch_memoryAccess.C.sv 2017-03-07 23:07:29.371789000 -0500 ++++ dyninst-9.3.1/dyninstAPI/src/BPatch_memoryAccess.C 2017-03-07 23:07:48.928927991 -0500 +@@ -33,10 +33,10 @@ + #include + #include + ++#include "../../common/src/Types.h" + #include "BPatch_memoryAccess_NP.h" + #include "BPatch_Vector.h" + #include "BPatch_point.h" +-#include "../../common/src/Types.h" + + BPatch_addrSpec_NP::BPatch_addrSpec_NP(long _imm, int _ra, int _rb, int _scale) : + imm(_imm), + + +--- dyninst-9.3.1/dyninstAPI/h/BPatch_instruction.h.sv 2017-03-08 09:06:46.638171175 -0500 ++++ dyninst-9.3.1/dyninstAPI/h/BPatch_instruction.h 2017-03-08 09:00:39.455564403 -0500 +@@ -69,7 +69,7 @@ + public: + + BPatch_instruction(internal_instruction *insn, +- uintptr_t _addr); ++ Dyninst::Address _addr); + virtual ~BPatch_instruction(); + + void getInstruction(const unsigned char *&_buffer, unsigned char &_length); + + +--- dyninst-9.3.1/dyninstAPI/h/BPatch_memoryAccess_NP.h.sv 2017-03-07 22:43:56.645745821 -0500 ++++ dyninst-9.3.1/dyninstAPI/h/BPatch_memoryAccess_NP.h 2017-03-08 10:39:30.122643332 -0500 +@@ -121,27 +121,27 @@ + static BPatch_memoryAccess* init_tables(); + + // initializes only the first access; #bytes is a constant +- BPatch_memoryAccess(internal_instruction *, uintptr_t _addr, ++ BPatch_memoryAccess(internal_instruction *, Dyninst::Address _addr, + bool _isLoad, bool _isStore, unsigned int _bytes, + long _imm, int _ra, int _rb, unsigned int _scale = 0, + int _cond = -1, bool _nt = false); + + // initializes only the first access; #bytes is an expression w/scale +- BPatch_memoryAccess(internal_instruction *insn, uintptr_t _addr, ++ BPatch_memoryAccess(internal_instruction *insn, Dyninst::Address _addr, + bool _isinternal_Load, bool _isStore, + long _imm_s, int _ra_s, int _rb_s, unsigned int _scale_s, + long _imm_c, int _ra_c, int _rb_c, unsigned int _scale_c, + int _cond, bool _nt, int _preFcn = -1); + + // initializes only the first access; #bytes is an expression +- BPatch_memoryAccess(internal_instruction *insn, uintptr_t _addr, ++ BPatch_memoryAccess(internal_instruction *insn, Dyninst::Address _addr, + bool _isLoad, bool _isStore, bool _isPrefetch, + long _imm_s, int _ra_s, int _rb_s, + long _imm_c, int _ra_c, int _rb_c, + unsigned short _preFcn); + + // initializes only the first access; #bytes is an expression & not a prefetch +- BPatch_memoryAccess(internal_instruction *insn, uintptr_t _addr, ++ BPatch_memoryAccess(internal_instruction *insn, Dyninst::Address _addr, + bool _isLoad, bool _isStore, long _imm_s, int _ra_s, int _rb_s, + long _imm_c, int _ra_c, int _rb_c); + +@@ -156,14 +156,14 @@ + int _cond, bool _nt); + + // initializes both accesses; #bytes is a constant +- BPatch_memoryAccess(internal_instruction *insn, uintptr_t _addr, ++ BPatch_memoryAccess(internal_instruction *insn, Dyninst::Address _addr, + bool _isLoad, bool _isStore, unsigned int _bytes, + long _imm, int _ra, int _rb, unsigned int _scale, + bool _isLoad2, bool _isStore2, unsigned int _bytes2, + long _imm2, int _ra2, int _rb2, unsigned int _scale2); + + // initializes both accesses; #bytes is an expression & not a prefetch +- BPatch_memoryAccess(internal_instruction *insn, uintptr_t _addr, bool _isLoad, bool _isStore, ++ BPatch_memoryAccess(internal_instruction *insn, Dyninst::Address _addr, bool _isLoad, bool _isStore, + long _imm_s, int _ra_s, int _rb_s, unsigned int _scale_s, + long _imm_c, int _ra_c, int _rb_c, unsigned int _scale_c, + bool _isLoad2, bool _isStore2, long _imm2_s, int _ra2_s, diff --git a/SOURCES/dyninst-rhbz1152270.patch b/SOURCES/dyninst-rhbz1152270.patch deleted file mode 100644 index a67a461..0000000 --- a/SOURCES/dyninst-rhbz1152270.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b37d305d0421017b61235e9c2015f3e45f082161 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 16 Oct 2014 17:42:58 -0700 -Subject: [PATCH] cmake: Properly extend BUG_DEFINES on ppc linux - -Both ppc32_linux and ppc64_linux set -Dbug_registers_after_exit in -BUG_DEFINES, but in doing so they clobbered the general linux bugs. In -particular, -Dbug_syscall_changepc_rewind is still needed. This patch -lets ppc just add its definition while keeping the others. - -Our RHEL7 QA noticed this as a regression from 8.1.2, so I believe it -just broke as part of the transition to cmake. In their smoke test, a -mutatee process in sleep() is attached, and it promptly crashes SIGILL -on the first iRPC. I found that the iRPC was at 0x3fffb1f70000, and -proccontrol is setting that pc, but the crash is at 0x3fffb1f6fffc. So -that appears to be the rewind issue, and a full BUG_DEFINES fixes it. - -Reported-by: Michael Petlan -Signed-off-by: Josh Stone ---- - cmake/cap_arch_def.cmake | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/cmake/cap_arch_def.cmake b/cmake/cap_arch_def.cmake -index a27be73e3652..d685532dcd2f 100644 ---- a/cmake/cap_arch_def.cmake -+++ b/cmake/cap_arch_def.cmake -@@ -112,11 +112,11 @@ set (OLD_DEFINES -Dx86_64_unknown_linux2_4) - - elseif (PLATFORM STREQUAL ppc32_linux) - set (OLD_DEFINES -Dppc32_linux) --set (BUG_DEFINES -Dbug_registers_after_exit) -+set (BUG_DEFINES ${BUG_DEFINES} -Dbug_registers_after_exit) - - elseif (PLATFORM STREQUAL ppc64_linux) - set (OLD_DEFINES -Dppc64_linux) --set (BUG_DEFINES ${BUG_DEF} -Dbug_registers_after_exit) -+set (BUG_DEFINES ${BUG_DEFINES} -Dbug_registers_after_exit) - - elseif (PLATFORM STREQUAL ppc64_bgq_ion) - set (OLD_DEFINES -Dppc64_bluegene -Dppc64_linux) --- -1.8.3.1 - diff --git a/SOURCES/testsuite-9.3.0-junit-nullptr.patch b/SOURCES/testsuite-9.3.0-junit-nullptr.patch new file mode 100644 index 0000000..6f055c3 --- /dev/null +++ b/SOURCES/testsuite-9.3.0-junit-nullptr.patch @@ -0,0 +1,11 @@ +--- testsuite-9.3.0/src/JUnitOutputDriver.cpp.nullptr 2016-12-19 14:55:38.000000000 -0800 ++++ testsuite-9.3.0/src/JUnitOutputDriver.cpp 2017-02-15 11:19:22.628056889 -0800 +@@ -35,7 +35,7 @@ void JUnitOutputDriver::startNewTest(std + { + std::stringstream suitename; + suitename << last_group->modname; +- if(last_group->mutatee != '\0') suitename << "." << last_group->mutatee; ++ if(last_group->mutatee != nullptr) suitename << "." << last_group->mutatee; + log(HUMAN, "\n", + suitename.str().c_str(), group_errors, group_skips, group_tests, group_failures); + log(HUMAN, group_output.str().c_str()); diff --git a/SPECS/dyninst.spec b/SPECS/dyninst.spec index 54b0204..af303a2 100644 --- a/SPECS/dyninst.spec +++ b/SPECS/dyninst.spec @@ -2,29 +2,26 @@ Summary: An API for Run-time Code Generation License: LGPLv2+ Name: dyninst Group: Development/Libraries -Release: 2%{?dist} +Release: 1%{?dist} URL: http://www.dyninst.org -Version: 8.2.0 -Exclusiveos: linux -#dyninst only knows the following architectures +Version: 9.3.1 +# Dyninst only has full support for a few architectures. +# It has some preliminary support for aarch64 and ppc64le, +# but we're waiting for those to be feature-complete. ExclusiveArch: %{ix86} x86_64 ppc ppc64 -# The source for this package was pulled from upstream's vcs. Use the -# following commands to generate the tarball: -# git clone http://git.dyninst.org/dyninst.git; cd dyninst -# git archive --format=tar.gz --prefix=dyninst/ v8.2.0.1 > dyninst-8.2.0.1.tar.gz -# git clone http://git.dyninst.org/docs.git; cd docs -# git archive --format=tar.gz --prefix=docs/ v8.2.0.1 > dyninst-docs-8.2.0.1.tar.gz -# git clone http://git.dyninst.org/testsuite.git; cd testsuite -# git archive --format=tar.gz --prefix=testsuite/ v8.2.0.1 > dyninst-testsuite-8.2.0.1.tar.gz -# Verify the commit ids with: -# gunzip -c dyninst-8.2.0.1.tar.gz | git get-tar-commit-id -# gunzip -c dyninst-docs-8.2.0.1.tar.gz | git get-tar-commit-id -# gunzip -c dyninst-testsuite-8.2.0.1.tar.gz | git get-tar-commit-id -Source0: dyninst-%{version}.1.tar.gz -Source1: dyninst-docs-%{version}.1.tar.gz -Source2: dyninst-testsuite-%{version}.1.tar.gz -Patch1: dyninst-rhbz1152270.patch +Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz +# Explicit version since it does not match the source version +Source1: https://github.com/dyninst/testsuite/archive/v9.3.0/testsuite-9.3.0.tar.gz + +Patch1: testsuite-9.3.0-junit-nullptr.patch +Patch2: dyninst-9.3.1-Address.patch + +%global dyninst_base dyninst-%{version} +# Explicit version since it does not match the source version +%global testsuite_base testsuite-9.3.0 + +BuildRequires: gcc-c++ BuildRequires: libdwarf-devel >= 20111030 BuildRequires: elfutils-libelf-devel BuildRequires: boost-devel @@ -90,102 +87,106 @@ making sure that dyninst works properly. %prep %setup -q -n %{name}-%{version} -c %setup -q -T -D -a 1 -%setup -q -T -D -a 2 -pushd dyninst -%patch1 -p1 -b .rhbz1152270 -popd +%patch1 -p0 -b.nullptr +%patch2 -p0 -b.Address + +# cotire seems to cause non-deterministic gcc errors +# https://bugzilla.redhat.com/show_bug.cgi?id=1420551 +sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \ + %{dyninst_base}/cmake/shared.cmake %build -cd dyninst +cd %{dyninst_base} %cmake \ + -DENABLE_STATIC_LIBS=1 \ -DINSTALL_LIB_DIR:PATH=%{_libdir}/dyninst \ -DINSTALL_INCLUDE_DIR:PATH=%{_includedir}/dyninst \ -DINSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Dyninst \ + -DCMAKE_BUILD_TYPE=None \ -DCMAKE_SKIP_RPATH:BOOL=YES -make %{?_smp_mflags} +%make_build # Hack to install dyninst nearby, so the testsuite can use it make DESTDIR=../install install -sed -i -e 's!%{_libdir}/dyninst!../install%{_libdir}/dyninst!' \ - ../install%{_libdir}/cmake/Dyninst/*.cmake +find ../install -name '*.cmake' -execdir \ + sed -i -e 's!%{_prefix}!../install&!' '{}' '+' -cd ../testsuite +cd ../%{testsuite_base} %cmake \ - -DDyninst_DIR:PATH=../install%{_libdir}/cmake/Dyninst \ + -DDyninst_DIR:PATH=$PWD/../install%{_libdir}/cmake/Dyninst \ -DINSTALL_DIR:PATH=%{_libdir}/dyninst/testsuite \ -DCMAKE_BUILD_TYPE:STRING=Debug \ -DCMAKE_SKIP_RPATH:BOOL=YES -make %{?_smp_mflags} +%make_build %install -cd dyninst -make DESTDIR=%{buildroot} install +cd %{dyninst_base} +%make_install -cd ../testsuite -make DESTDIR=%{buildroot} install +# It doesn't install docs the way we want, so remove them. +# We'll just grab the pdfs later, directly from the build dir. +rm -v %{buildroot}%{_docdir}/*-%{version}.pdf + +cd ../%{testsuite_base} +%make_install mkdir -p %{buildroot}/etc/ld.so.conf.d echo "%{_libdir}/dyninst" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf -# Ugly hack to fix permissions -chmod 644 %{buildroot}%{_includedir}/dyninst/* -chmod 644 %{buildroot}%{_libdir}/dyninst/*.a - -# Uglier hack to mask testsuite files from debuginfo extraction. Running the +# Ugly hack to mask testsuite files from debuginfo extraction. Running the # testsuite requires debuginfo, so extraction is useless. However, debuginfo # extraction is still nice for the main libraries, so we don't want to disable # it package-wide. The permissions are restored by attr(755,-,-) in files. -chmod 644 %{buildroot}%{_libdir}/dyninst/testsuite/* +find %{buildroot}%{_libdir}/dyninst/testsuite/ \ + -type f '!' -name '*.a' -execdir chmod 644 '{}' '+' %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%defattr(-,root,root,-) - %dir %{_libdir}/dyninst %{_libdir}/dyninst/*.so.* -%doc dyninst/COPYRIGHT -%doc dyninst/LGPL +%doc %{dyninst_base}/COPYRIGHT +%doc %{dyninst_base}/LGPL %config(noreplace) /etc/ld.so.conf.d/* %files doc -%defattr(-,root,root,-) -%doc docs/dynC_API.pdf -%doc docs/DyninstAPI.pdf -%doc docs/dyninstAPI/examples/ -%doc docs/InstructionAPI.pdf -%doc docs/ParseAPI.pdf -%doc docs/PatchAPI.pdf -%doc docs/ProcControlAPI.pdf -%doc docs/StackwalkerAPI.pdf -%doc docs/SymtabAPI.pdf +%doc %{dyninst_base}/dataflowAPI/doc/dataflowAPI.pdf +%doc %{dyninst_base}/dynC_API/doc/dynC_API.pdf +%doc %{dyninst_base}/dyninstAPI/doc/dyninstAPI.pdf +%doc %{dyninst_base}/instructionAPI/doc/instructionAPI.pdf +%doc %{dyninst_base}/parseAPI/doc/parseAPI.pdf +%doc %{dyninst_base}/patchAPI/doc/patchAPI.pdf +%doc %{dyninst_base}/proccontrol/doc/proccontrol.pdf +%doc %{dyninst_base}/stackwalk/doc/stackwalk.pdf +%doc %{dyninst_base}/symtabAPI/doc/symtabAPI.pdf %files devel -%defattr(-,root,root,-) %{_includedir}/dyninst %{_libdir}/dyninst/*.so %dir %{_libdir}/cmake %{_libdir}/cmake/Dyninst %files static -%defattr(-,root,root,-) %{_libdir}/dyninst/*.a %files testsuite -%defattr(-,root,root,-) -#%{_bindir}/parseThat +%{_bindir}/parseThat %dir %{_libdir}/dyninst/testsuite/ # Restore the permissions that were hacked out above, during install. -%attr(755,root,root) %{_libdir}/dyninst/testsuite/* +%attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a] +%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a %changelog +* Mon Mar 06 2017 Stan Cox - 9.3.1-1 +- Update to 9.3.1 + * Mon Oct 20 2014 Josh Stone - 8.2.0-2 - rhbz1152270: enable bug workaround for syscall pc rewind on ppc