From 3765378d69902c645758be7922ee486839b7efea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Wed, 14 Oct 2020 23:54:44 +0200 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/dyninst#67da9764dd61988a2be9df5abb518d1aff387ad2 --- .gitignore | 24 ++ dyninst-10.1.0-aarch-regs.patch | 309 ++++++++++++++++++++ dyninst-10.1.0-result.patch | 28 ++ dyninst-10.2.0-pie.patch | 8 + dyninst.spec | 498 ++++++++++++++++++++++++++++++++ sources | 2 + testsuite-10.1.0-386.patch | 44 +++ testsuite-10.1.0-gettid.patch | 15 + 8 files changed, 928 insertions(+) create mode 100644 dyninst-10.1.0-aarch-regs.patch create mode 100644 dyninst-10.1.0-result.patch create mode 100644 dyninst-10.2.0-pie.patch create mode 100644 dyninst.spec create mode 100644 sources create mode 100644 testsuite-10.1.0-386.patch create mode 100644 testsuite-10.1.0-gettid.patch diff --git a/.gitignore b/.gitignore index e69de29..b84defc 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,24 @@ +/dyninst-8.0.tar.gz +/dyninst-docs-8.0.tar.gz +/dyninst-8.1.1.tar.gz +/dyninst-docs-8.1.1.tar.gz +/dyninst-8.1.2.tar.gz +/dyninst-8.2.0.1.tar.gz +/dyninst-docs-8.2.0.1.tar.gz +/dyninst-testsuite-8.2.0.1.tar.gz +/dyninst-8.2.1.tar.gz +/DyninstAPI-9.0.3.tgz +/Testsuite-9.0.3.tgz +/DyninstAPI-9.1.0.tgz +/Testsuite-9.1.0.tgz +/dyninst-9.2.0.tar.gz +/Testsuite-9.2.0.zip +/dyninst-9.3.0.tar.gz +/testsuite-9.3.0.tar.gz +/dyninst-9.3.1.tar.gz +/dyninst-9.3.2.tar.gz +/dyninst-10.0.0.tar.gz +/testsuite-9.4.0.tar.gz +/testsuite-10.1.0.tar.gz +/dyninst-10.1.0.tar.gz +/dyninst-10.2.0.tar.gz diff --git a/dyninst-10.1.0-aarch-regs.patch b/dyninst-10.1.0-aarch-regs.patch new file mode 100644 index 0000000..814137c --- /dev/null +++ b/dyninst-10.1.0-aarch-regs.patch @@ -0,0 +1,309 @@ +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/BPatch_addressSpace.C.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/BPatch_addressSpace.C 2019-11-06 10:20:08.567523510 -0500 +--- BPatch_addressSpace.C.orig 2019-05-16 14:40:05.000000000 -0400 ++++ BPatch_addressSpace.C 2019-11-15 18:10:31.186122654 -0500 +@@ -1050,5 +1050,2 @@ + return true; +- +- regs = registers_; +- return true; + } +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/emit-aarch64.C.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/emit-aarch64.C 2019-11-06 10:20:08.567523510 -0500 +@@ -276,9 +276,2 @@ + +- if (register_num == REG_SP) { +- insnCodeGen::generateAddSubImmediate(gen, insnCodeGen::Add, 0, +- TRAMP_FRAME_SIZE_64, destination, REG_SP, true); +- +- return; +- } +- + if (src->spilledState == registerSlot::unspilled) +@@ -293,3 +286,3 @@ + // its on the stack so load it. +- insnCodeGen::restoreRegister(gen, destination, offset + (register_num * gen.width()), ++ insnCodeGen::restoreRegister(gen, destination, offset + (src->encoding() * gen.width()), + insnCodeGen::Offset); +@@ -298 +291,7 @@ + ++bool EmitterAARCH64::emitMoveRegToReg(Register src, Register dest, codeGen &gen) ++{ ++ insnCodeGen::generateMove(gen, dest, src); ++ return true; ++} ++ +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/emit-aarch64.h.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/emit-aarch64.h 2019-11-06 10:20:08.567523510 -0500 +@@ -107,6 +107,3 @@ + +- virtual bool emitMoveRegToReg(Register, Register, codeGen &) { +- assert(0); +- return 0; +- } ++ virtual bool emitMoveRegToReg(Register, Register, codeGen &); + +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/inst-aarch64.C.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/inst-aarch64.C 2019-11-06 10:20:08.567523510 -0500 +@@ -108,2 +108,4 @@ + registers.push_back(new registerSlot(r30, "r30", true, registerSlot::liveAlways, registerSlot::GPR)); ++ // SP is r31, but also could be considered special. But now it's being added as GPR ++ registers.push_back(new registerSlot(sp, "r31", true, registerSlot::liveAlways, registerSlot::GPR)); + +@@ -111,3 +113,3 @@ + registers.push_back(new registerSlot(lr, "lr", true, registerSlot::liveAlways, registerSlot::SPR)); +- registers.push_back(new registerSlot(sp, "sp", true, registerSlot::liveAlways, registerSlot::SPR)); ++ //registers.push_back(new registerSlot(sp, "sp", true, registerSlot::liveAlways, registerSlot::SPR)); + registers.push_back(new registerSlot(pstate, "nzcv", true, registerSlot::liveAlways, registerSlot::SPR)); +@@ -183,9 +185,16 @@ + registerSlot *reg = theRegSpace->GPRs()[idx]; +- // We always save FP and LR for stack walking out of instrumentation +- if (reg->liveState == registerSlot::live || reg->number == REG_FP || reg->number == REG_LR) { ++ // We always save FP and LR for stack walking out of instrumentation ++ //if (reg->liveState == registerSlot::live || reg->number == REG_FP || reg->number == REG_LR) { + int offset_from_sp = offset + (reg->encoding() * gen.width()); +- insnCodeGen::saveRegister(gen, reg->number, offset_from_sp); ++ if(reg->number != registerSpace::sp) ++ insnCodeGen::saveRegister(gen, reg->number, offset_from_sp); ++ else{ ++ // mov SP to x0 ++ insnCodeGen::generateAddSubImmediate(gen, insnCodeGen::Add, 0, ++ TRAMP_FRAME_SIZE_64, REG_SP, 0, true); ++ insnCodeGen::saveRegister(gen, 0, offset_from_sp); ++ } + theRegSpace->markSavedRegister(reg->number, offset_from_sp); + ret++; +- } ++ //} + } +@@ -283,2 +292,4 @@ + if(reg->liveState == registerSlot::spilled) { ++ if(reg->number == registerSpace::sp) ++ continue; + //#sasha this should be GPRSIZE_64 and not gen.width +@@ -602,4 +613,2 @@ + { +- //#sasha This function implementation is experimental. +- + if (op != callOp) { +@@ -623,4 +632,2 @@ + vector savedRegs; +- +- // save r0-r7 + for(size_t id = 0; id < gen.rs()->numGPRs(); id++) +@@ -653,2 +660,6 @@ + assert(reg!=REG_NULL); ++ ++ // mark reg offLimits so getScratchRegister won't use it ++ registerSlot *regS = gen.rs()->GPRs()[id]; ++ regS->offLimits = true; + } +@@ -691,3 +702,2 @@ + +- // r7-r0 + for (signed int ui = savedRegs.size()-1; ui >= 0; ui--) { +@@ -697,2 +707,9 @@ + ++ // Making operand's reg not offLimits again ++ for(size_t id = 0; id < operands.size(); id++) ++ { ++ registerSlot *reg = gen.rs()->GPRs()[id]; ++ reg->offLimits = false; ++ } ++ + return 0; +@@ -1426,4 +1443,53 @@ + bool EmitterAARCH64Stat::emitPLTCall(func_instance *callee, codeGen &gen) { +- assert(0); //Not implemented +- return emitPLTCommon(callee, true, gen); ++ /* ++ Address dest = getInterModuleFuncAddr(callee, gen); ++ //Register scr = gen.rs()->getScratchRegister(gen); ++ //Register lr = gen.rs()->getScratchRegister(gen); ++ //Address pc = emitMovePCToReg(scr, gen); ++ ++ Address varOffset = dest - gen.currAddr(); ++ //printf("VarOffset = %d\n", varOffset); ++ //emitLoadRelative(lr, varOffset, scr, gen.width(), gen); ++ ++ insnCodeGen::generateBranch(gen, gen.currAddr(), dest, true); ++ ++ return true; ++ */ ++ ++ ++ Address dest = getInterModuleFuncAddr(callee, gen); ++ Register scr = gen.rs()->getScratchRegister(gen); ++ Register lr = gen.rs()->getScratchRegister(gen); ++ //Register scr = gen.rs()->getRegByName("r2"); ++ //Register lr = gen.rs()->getRegByName("r3"); ++ emitMovePCToReg(scr, gen); ++ ++ Address varOffset = dest - gen.currAddr() + 4; ++ //printf("VarOffset = %d\n", varOffset); ++ emitLoadRelative(lr, varOffset, scr, gen.width(), gen); ++ insnCodeGen::generateMemAccess(gen, insnCodeGen::Load, lr, lr, 0, 8, insnCodeGen::Offset); ++ ++ // indirect branch ++ instruction branchInsn; ++ branchInsn.clear(); ++ ++ //Set bits which are 0 for both BR and BLR ++ INSN_SET(branchInsn, 0, 4, 0); ++ INSN_SET(branchInsn, 10, 15, 0); ++ ++ //Set register ++ INSN_SET(branchInsn, 5, 9, lr); ++ ++ //Set other bits. Basically, these are the opcode bits. ++ //The only difference between BR and BLR is that bit 21 is 1 for BLR. ++ INSN_SET(branchInsn, 16, 31, BRegOp); ++ INSN_SET(branchInsn, 21, 21, 1); ++ insnCodeGen::generate(gen, branchInsn); ++ //insnCodeGen::generateBranch(gen, gen.currAddr(), lr, true); ++ //insnCodeGen::generateBranch(gen, gen.currAddr(), gen.currAddr() +varOffset, true); ++ ++ return true; ++ ++ //assert(0); //Not implemented ++ //return emitPLTCommon(callee, true, gen); + } +@@ -1431,4 +1497,81 @@ + bool EmitterAARCH64Stat::emitPLTJump(func_instance *callee, codeGen &gen) { +- assert(0); //Not implemented +- return emitPLTCommon(callee, false, gen); ++ /* ++ Address dest = getInterModuleFuncAddr(callee, gen); ++ //Register scr = gen.rs()->getScratchRegister(gen); ++ //Register lr = gen.rs()->getScratchRegister(gen); ++ Register scr = gen.rs()->getRegByName("r2"); ++ Register lr = gen.rs()->getRegByName("r3"); ++ //Address pc = emitMovePCToReg(scr, gen); ++ ++ Address varOffset = dest - gen.currAddr(); ++ //printf("VarOffset = %d\n", varOffset); ++ emitLoadRelative(lr, varOffset, scr, gen.width(), gen); ++ insnCodeGen::generateMemAccess(gen, insnCodeGen::Load, lr, lr, 0, 8, insnCodeGen::Offset); ++ ++ insnCodeGen::generateBranch(gen, gen.currAddr(), lr, false); ++ ++ return true; ++ */ ++ ++ /* ++ Address dest = getInterModuleFuncAddr(callee, gen); ++ Register scr = gen.rs()->getScratchRegister(gen); ++ Register lr = gen.rs()->getScratchRegister(gen); ++ Address pc = emitMovePCToReg(scr, gen); ++ ++ Address varOffset = dest - pc; ++ printf("VarOffset = %d\n", varOffset); ++ emitLoadRelative(lr, varOffset, scr, gen.width(), gen); ++ ++ insnCodeGen::generateBranch(gen, gen.currAddr(), lr, false); ++ return true; ++ */ ++ ++ /* ++ Address dest = getInterModuleFuncAddr(callee, gen); ++ Register scr = gen.rs()->getScratchRegister(gen); ++ Register lr = gen.rs()->getScratchRegister(gen); ++ Address varOffset = dest - gen.currAddr(); ++ emitLoadRelative(lr, varOffset, scr, gen.width(), gen); ++ insnCodeGen::generateBranch(gen, gen.currAddr(), gen.currAddr() +varOffset, false); ++ ++ return true; ++ */ ++ ++ ++ Address dest = getInterModuleFuncAddr(callee, gen); ++ Register scr = gen.rs()->getScratchRegister(gen); ++ Register lr = gen.rs()->getScratchRegister(gen); ++ //Register scr = gen.rs()->getRegByName("r2"); ++ //Register lr = gen.rs()->getRegByName("r3"); ++ emitMovePCToReg(scr, gen); ++ ++ Address varOffset = dest - gen.currAddr() + 4; ++ //printf("VarOffset = %d\n", varOffset); ++ emitLoadRelative(lr, varOffset, scr, gen.width(), gen); ++ insnCodeGen::generateMemAccess(gen, insnCodeGen::Load, lr, lr, 0, 8, insnCodeGen::Offset); ++ ++ // indirect branch ++ instruction branchInsn; ++ branchInsn.clear(); ++ ++ //Set bits which are 0 for both BR and BLR ++ INSN_SET(branchInsn, 0, 4, 0); ++ INSN_SET(branchInsn, 10, 15, 0); ++ ++ //Set register ++ INSN_SET(branchInsn, 5, 9, lr); ++ ++ //Set other bits. Basically, these are the opcode bits. ++ //The only difference between BR and BLR is that bit 21 is 1 for BLR. ++ INSN_SET(branchInsn, 16, 31, BRegOp); ++ INSN_SET(branchInsn, 21, 21, 0); ++ insnCodeGen::generate(gen, branchInsn); ++ //insnCodeGen::generateBranch(gen, gen.currAddr(), lr, true); ++ //insnCodeGen::generateBranch(gen, gen.currAddr(), gen.currAddr() +varOffset, true); ++ ++ return true; ++ ++ //assert(0); //Not implemented ++ //return emitPLTCommon(callee, false, gen); + } +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/inst-aarch64.h.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/inst-aarch64.h 2019-11-06 10:20:08.567523510 -0500 +@@ -74,3 +74,3 @@ + //TODO Fix for ARM +-#define GPRSAVE_64 (31*GPRSIZE_64) ++#define GPRSAVE_64 (32*GPRSIZE_64) + #define FPRSAVE_64 (32*FPRSIZE_64) +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/registerSpace.C.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/registerSpace.C 2019-11-06 10:20:08.567523510 -0500 +@@ -110,2 +110,4 @@ + #elif defined(arch_aarch64) ++ if(number == registerSpace::sp) ++ return REG_SP; + switch (type) { +@@ -342,3 +344,3 @@ + +- reg->markUsed(true); ++ //reg->markUsed(true); + gen.markRegDefined(reg->number); + +--- dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/dynProcess.C.orig ++++ dyninst-10.1.0/dyninst-10.1.0/dyninstAPI/src/dynProcess.C +@@ -3243,25 +3243,13 @@ bool PCProcess::continueSyncRPCThreads() { + } + + void PCProcess::addTrap(Address from, Address to, codeGen &gen) { +- map::iterator breakIter = +- installedCtrlBrkpts.find(from); +- +- if( breakIter != installedCtrlBrkpts.end() ) { +- if( !pcProc_->rmBreakpoint(from, breakIter->second) ) { +- // Oops? +- } +- installedCtrlBrkpts.erase(breakIter); +- } +- +- Breakpoint::ptr newBreak = Breakpoint::newTransferBreakpoint(to); +- newBreak->setSuppressCallbacks(true); +- +- if( !pcProc_->addBreakpoint(from, newBreak) ) { +- // Oops? +- } +- +- installedCtrlBrkpts.insert(make_pair(from, newBreak)); +- gen.invalidate(); ++ gen.invalidate(); ++ gen.allocate(4); ++ gen.setAddrSpace(this); ++ gen.setAddr(from); ++ insnCodeGen::generateTrap(gen); ++ trapMapping.addTrapMapping(from, to, true); ++ springboard_cerr << "Generated springboard trap " << hex << from << "->" << to << dec << endl; + } + + void PCProcess::removeTrap(Address from) { diff --git a/dyninst-10.1.0-result.patch b/dyninst-10.1.0-result.patch new file mode 100644 index 0000000..2738cf2 --- /dev/null +++ b/dyninst-10.1.0-result.patch @@ -0,0 +1,28 @@ +--- dyninst-10.1.0/dyninst-10.1.0/instructionAPI/h/Result.h.sv 2018-11-09 11:48:08.000000000 -0500 ++++ dyninst-10.1.0/dyninst-10.1.0/instructionAPI/h/Result.h 2018-12-04 22:12:47.369579566 -0500 +@@ -449,10 +449,10 @@ + snprintf(hex, 20, "%x", val.s32val); + break; + case u64: +- snprintf(hex, 20, "%lx", val.u64val); ++ snprintf(hex, 20, "%" PRIx64, val.u64val); + break; + case s64: +- snprintf(hex, 20, "%lx", val.s64val); ++ snprintf(hex, 20, "%" PRIx64, val.s64val); + break; + case sp_float: + snprintf(hex, 20, "%f", val.floatval); +@@ -464,10 +464,10 @@ + snprintf(hex, 20, "%x", val.bitval); + break; + case u48: +- snprintf(hex, 20, "%lx", val.s48val); ++ snprintf(hex, 20, "%" PRIx64, val.s48val); + break; + case s48: +- snprintf(hex, 20, "%lx", val.s48val); ++ snprintf(hex, 20, "%" PRIx64, val.s48val); + break; + case m512: + snprintf(hex, 20, "%p", val.m512val); diff --git a/dyninst-10.2.0-pie.patch b/dyninst-10.2.0-pie.patch new file mode 100644 index 0000000..32262c1 --- /dev/null +++ b/dyninst-10.2.0-pie.patch @@ -0,0 +1,8 @@ +--- dyninst-10.2.0/dyninst-10.2.0/dyninstAPI_RT/CMakeLists.txt 2020-02-24 09:41:30.207108160 -0500 ++++ dyninst-10.2.0/dyninst-10.2.0/dyninstAPI_RT/CMakeLists.txt 2020-08-25 15:57:28.437496257 -0400 +@@ -5,4 +5,4 @@ + set (DYNINST_ROOT ${PROJECT_SOURCE_DIR}/..) +-set(CMAKE_C_FLAGS "${DYNINST_RT_CMAKE_C_FLAGS}") +-set(CMAKE_CXX_FLAGS "${DYNINST_RT_CMAKE_CXX_FLAGS}") ++# set(CMAKE_C_FLAGS "${DYNINST_RT_CMAKE_C_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${DYNINST_RT_CMAKE_CXX_FLAGS}") diff --git a/dyninst.spec b/dyninst.spec new file mode 100644 index 0000000..4b33ace --- /dev/null +++ b/dyninst.spec @@ -0,0 +1,498 @@ +Summary: An API for Run-time Code Generation +License: LGPLv2+ +Name: dyninst +Release: 1%{?dist} +URL: http://www.dyninst.org +Version: 10.2.0 +ExclusiveArch: %{ix86} x86_64 ppc64le aarch64 + +%define __testsuite_version 10.1.0 +Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz +Source1: https://github.com/dyninst/testsuite/archive/v10.1.0/testsuite-%{__testsuite_version}.tar.gz + +Patch1: dyninst-10.2.0-pie.patch +Patch2: testsuite-10.1.0-gettid.patch +Patch3: testsuite-10.1.0-386.patch + +%global dyninst_base dyninst-%{version} +%global testsuite_base testsuite-%{__testsuite_version} + +BuildRequires: gcc-c++ +BuildRequires: elfutils-devel +BuildRequires: elfutils-libelf-devel +BuildRequires: boost-devel +BuildRequires: binutils-devel +BuildRequires: cmake +BuildRequires: libtirpc-devel +BuildRequires: tbb tbb-devel +BuildRequires: tex-latex + +# Extra requires just for the testsuite +BuildRequires: gcc-gfortran libxml2-devel + +# Testsuite files should not provide/require anything +%{?filter_setup: +%filter_provides_in %{_libdir}/dyninst/testsuite/ +%filter_requires_in %{_libdir}/dyninst/testsuite/ +%filter_setup +} + +%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. + +%package doc +Summary: Documentation for using the Dyninst API +%description doc +dyninst-doc contains API documentation for the Dyninst libraries. + +%package devel +Summary: Header files for compiling programs with Dyninst +Requires: dyninst = %{version}-%{release} +Requires: boost-devel +Requires: tbb-devel + +%description devel +dyninst-devel includes the C header files that specify the Dyninst user-space +libraries and interfaces. This is required for rebuilding any program +that uses Dyninst. + +%package testsuite +Summary: Programs for testing Dyninst +Requires: dyninst = %{version}-%{release} +Requires: dyninst-devel = %{version}-%{release} +%description testsuite +dyninst-testsuite includes the test harness and target programs for +making sure that dyninst works properly. + +%prep +%setup -q -n %{name}-%{version} -c +%setup -q -T -D -a 1 + +%patch1 -p1 -b.pie +%patch2 -p1 -b.gettid +%patch3 -p1 -b.386 + +# 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_base} + +CFLAGS="$CFLAGS $RPM_OPT_FLAGS" +LDFLAGS="$LDFLAGS $RPM_LD_FLAGS" +%ifarch %{ix86} + CFLAGS="$CFLAGS -fno-lto -march=i686" + LDFLAGS="$LDFLAGS -fno-lto" +%endif +CXXFLAGS="$CFLAGS" +export CFLAGS CXXFLAGS LDFLAGS + +%cmake \ + -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 +%cmake_build + +# Hack to install dyninst nearby, so the testsuite can use it +DESTDIR="../install" %__cmake --install "%{__cmake_builddir}" +find ../install -name '*.cmake' -execdir \ + sed -i -e "s!%{_prefix}!$PWD/../install&!" '{}' '+' +# cmake mistakenly looks for libtbb.so in the dyninst install dir +sed -i '/libtbb.so/ s/".*usr/"\/usr/' $PWD/../install%{_libdir}/cmake/Dyninst/commonTargets.cmake + +cd ../%{testsuite_base} +%cmake \ + -DDyninst_DIR:PATH=$PWD/../install%{_libdir}/cmake/Dyninst \ + -DINSTALL_DIR:PATH=%{_libdir}/dyninst/testsuite \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_SKIP_RPATH:BOOL=YES \ +%cmake_build + +%install + +cd %{dyninst_base} +%cmake_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} +%cmake_install + +mkdir -p %{buildroot}/etc/ld.so.conf.d +echo "%{_libdir}/dyninst" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%dir %{_libdir}/dyninst +%{_libdir}/dyninst/*.so.* +# dyninst mutators dlopen the runtime library +%{_libdir}/dyninst/libdyninstAPI_RT.so +%{_libdir}/dyninst/libdyninstAPI_RT.a + +%doc %{dyninst_base}/COPYRIGHT +%doc %{dyninst_base}/LICENSE.md + +%config(noreplace) /etc/ld.so.conf.d/* + +%files doc +%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 +%{_includedir}/dyninst +%{_libdir}/dyninst/*.so +%{_libdir}/cmake/Dyninst + +%files testsuite +%{_bindir}/parseThat +%dir %{_libdir}/dyninst/testsuite/ +%attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a] +%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a + +%changelog +* Tue Sep 01 2020 Stan Cox - 10.2.0-1 +- Update to 10.2.0 + +* Mon Aug 10 2020 Orion Poplawski - 10.1.0-10 +- Use new cmake macros (FTBFS bz#1863463) +- Add BR tex-latex for doc build + +* Sat Aug 01 2020 Fedora Release Engineering - 10.1.0-9 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 10.1.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 15 2020 Stan Cox - 10.1.0-7 +- Do not build static versions of the dyninst libraries. + +* Fri May 29 2020 Jonathan Wakely - 10.1.0-6 +- Rebuilt for Boost 1.73 + +* Tue Jan 28 2020 Fedora Release Engineering - 10.1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Nov 15 2019 Stan Cox - 10.1.0-4 +- Fix rhbz963475 dyninst must be ported to aarch64 + +* Wed Jul 24 2019 Fedora Release Engineering - 10.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Jun 04 2019 Stan Cox - 10.1.0-2 +- Use PRIx64 to fix i386 build + +* Wed May 29 2019 Stan Cox - 10.1.0-1 +- Update to 10.1.0 + +* Mon Feb 4 2019 William Cohen - 10.0.0-7 +- Fix FTBFS due to move to boost 1.69 and tribool changes. + +* Thu Jan 31 2019 Fedora Release Engineering - 10.0.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Jan 23 2019 Björn Esser - 10.0.0-5 +- Append curdir to CMake invokation. (#1668512) + +* Wed Dec 05 2018 Stan Cox - 10.0.0-4 +- Use PRIx64 + +* Wed Dec 05 2018 Stan Cox - 10.0.0-3 +- Patch Result.h for i386. + +* Mon Dec 03 2018 Frank Ch. Eigler - 10.0.0-2 +- Add tbb-devel Requires: +- Add ppc64le into ExclusiveArch: + +* Tue Nov 13 2018 Stan Cox - 10.0.0-1 +- Update to 10.0.0 + +* Thu Jul 12 2018 Fedora Release Engineering - 9.3.2-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Mar 07 2018 Adam Williamson - 9.3.2-11 +- Rebuild to fix GCC 8 mis-compilation + See https://da.gd/YJVwk ("GCC 8 ABI change on x86_64") + +* Wed Feb 07 2018 Than Ngo - - 9.3.2-10 +- fix FTBS with gcc8 +- fix for using libtirpc, Sun RPC Interfaces is removed in latest glibc + +* Wed Feb 07 2018 Fedora Release Engineering - 9.3.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Feb 05 2018 Stan Cox - 9.3.2-8 +- Rebuild for Boost 1.64 + +* Wed Oct 04 2017 Stan Cox - 9.3.2-7 +- Fix swbz22248, handle R_*_IRELATIV, swbz22004, ignore linux-vdso64.so.1 + +* Sun Aug 06 2017 Björn Esser - 9.3.2-6 +- Rebuilt for AutoReq cmake-filesystem + +* Wed Aug 02 2017 Fedora Release Engineering - 9.3.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 9.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Jul 20 2017 Kalev Lember - 9.3.2-3 +- Rebuilt for Boost 1.64 + +* Fri Jul 07 2017 Igor Gnatenko - 9.3.2-2 +- Rebuild due to bug in RPM (RHBZ #1468476) + +* Wed Jul 05 2017 Stan Cox - 9.3.2-1 +- Update to 9.3.2 + +* Mon Mar 06 2017 Stan Cox - 9.3.1-1 +- Update to 9.3.1 + +* Wed Feb 8 2017 William Cohen - 9.3.0-2 +- Rebuild for boost 1.63 + +* Mon Jan 09 2017 Josh Stone - 9.3.0-1 +- Update to 9.3.0 + +* Tue Nov 22 2016 Josh Stone - 9.2.0-5 +- Backport fixes for rhbz1373197, attach thread races. + +* Wed Sep 14 2016 Josh Stone - 9.2.0-4 +- Fix rhbz1373239, process attach without exe specified. + +* Mon Aug 15 2016 Josh Stone - 9.2.0-3 +- Revert aarch64 and ppc64le support until they're more complete. + +* Fri Aug 12 2016 Peter Robinson 9.2.0-2 +- aarch64 and ppc64le are now supported + +* Thu Jun 30 2016 Josh Stone - 9.2.0-1 +- Update to 9.2.0 + +* Tue Jun 21 2016 Josh Stone - 9.1.0-5 +- Use static TLS for libdyninstAPI_RT.so + +* Thu Mar 10 2016 William Cohen - 9.1.0-4 +- Export libdyninstAPI_RT_init_maxthreads (ref rhbz1315841) + +* Wed Feb 03 2016 Fedora Release Engineering - 9.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Sat Jan 23 2016 Orion Poplawski - 9.1.0-2 +- Rebuild for boost 1.60 + +* Fri Dec 18 2015 Josh Stone - 9.1.0-1 +- Update to 9.1.0 + +* Fri Sep 04 2015 Josh Stone - 9.0.3-1 +- Update to 9.0.3 + +* Thu Aug 27 2015 Jonathan Wakely - 8.2.1-9 +- Rebuilt for Boost 1.59 + +* Wed Jul 29 2015 Fedora Release Engineering - 8.2.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 + +* Thu Jul 23 2015 Josh Stone - 8.2.1-7 +- Patch use of boost::bind for boost 1.58. + +* Wed Jul 22 2015 David Tardon - 8.2.1-6 +- rebuild for Boost 1.58 + +* Wed Jun 17 2015 Fedora Release Engineering - 8.2.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Apr 17 2015 Frank Ch. Eigler - 8.2.1-4 +- Rebuild with gcc 5.0.1 for abitag-equipped cxx11 symbols. + +* Sat Feb 14 2015 Frank Ch. Eigler - 8.2.1-3 +- Rebuild with gcc 5 for std::__cxx11::basic_string etc. ABI + +* Tue Jan 27 2015 Petr Machata - 8.2.1-2 +- Rebuild for boost 1.57.0 + +* Fri Oct 31 2014 Josh Stone - 8.2.1-1 +- Update to point release 8.2.1. + +* Wed Aug 20 2014 Josh Stone - 8.2.0-1 +- rebase to 8.2.0, using upstream tag "v8.2.0.1" + +* Sat Aug 16 2014 Fedora Release Engineering - 8.1.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jul 07 2014 Josh Stone - 8.1.2-10 +- Flip from ExcludeArch to ExclusiveArch (ref rhbz1113991) + +* Sat Jun 07 2014 Fedora Release Engineering - 8.1.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 23 2014 Petr Machata - 8.1.2-8 +- Rebuild for boost 1.55.0 + +* Thu May 22 2014 Josh Stone - 8.1.2-7 +- Rebuild for libdwarf.so.1 + +* Wed Dec 11 2013 Josh Stone 8.1.2-6 +- Fix rhbz1040715 (testsuite g++ optimization) + +* Tue Dec 03 2013 Josh Stone 8.1.2-5 +- Fix rhbz1037048 (-Werror=format-security FTBFS) + +* Mon Aug 05 2013 Fedora Release Engineering - 8.1.2-4 +- Fix rhbz991889 (FTBFS). + +* Sat Aug 03 2013 Fedora Release Engineering - 8.1.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jul 30 2013 Petr Machata - 8.1.2-2 +- Rebuild for boost 1.54.0 + +* Tue Jun 18 2013 Josh Stone 8.1.2-1 +- Update to release 8.1.2. + +* Fri Mar 15 2013 Josh Stone 8.1.1-1 +- Update to release 8.1.1. +- Drop the backported dyninst-test2_4-kill-init.patch. +- Drop the now-upstreamed dyninst-unused_vars.patch. +- Update other patches for context. +- Patch the installed symlinks to be relative, not $(DEST) filled. + +* Tue Feb 26 2013 Josh Stone 8.0-7 +- testsuite: Require dyninst-devel for the libdyninstAPI_RT.so symlink + +* Tue Feb 26 2013 Josh Stone 8.0-6 +- Fix the testsuite path to include libtestlaunch.so + +* Mon Feb 25 2013 Josh Stone 8.0-5 +- Add a dyninst-testsuite package. +- Patch test2_4 to protect against running as root. +- Make dyninst-static require dyninst-devel. + +* Thu Feb 14 2013 Josh Stone 8.0-4 +- Patch make.config to ensure rpm build flags are not discarded. + +* Sun Feb 10 2013 Denis Arnaud - 8.0-3 +- Rebuild for Boost-1.53.0 + +* Sat Feb 09 2013 Denis Arnaud - 8.0-2 +- Rebuild for Boost-1.53.0 + +* Tue Nov 20 2012 Josh Stone +- Tweak the configure/make commands +- Disable the testsuite via configure. +- Set the private includedir and libdir via configure. +- Set VERBOSE_COMPILATION for make. +- Use DESTDIR for make install. + +* Mon Nov 19 2012 Josh Stone 8.0-1 +- Update to release 8.0. +- Updated "files doc" to reflect renames. +- Drop the unused BuildRequires libxml2-devel. +- Drop the 7.99.x version-munging patch. + +* Fri Nov 09 2012 Josh Stone 7.99.2-0.29 +- Rebase to git e99d7070bbc39c76d6d528db530046c22681c17e + +* Mon Oct 29 2012 Josh Stone 7.99.2-0.28 +- Bump to 7.99.2 per abi-compliance-checker results + +* Fri Oct 26 2012 Josh Stone 7.99.1-0.27 +- Rebase to git dd8f40b7b4742ad97098613876efeef46d3d9e65 +- Use _smp_mflags to enable building in parallel. + +* Wed Oct 03 2012 Josh Stone 7.99.1-0.26 +- Rebase to git 557599ad7417610f179720ad88366c32a0557127 + +* Thu Sep 20 2012 Josh Stone 7.99.1-0.25 +- Rebase on newer git tree. +- Bump the fake version to 7.99.1 to account for ABI differences. +- Enforce the minimum libdwarf version. +- Drop the upstreamed R_PPC_NUM patch. + +* Wed Aug 15 2012 Karsten Hopp 7.99-0.24 +- check if R_PPC_NUM is defined before using it, similar to R_PPC64_NUM + +* Mon Jul 30 2012 Josh Stone 7.99-0.23 +- Rebase on newer git tree. +- Update license files with upstream additions. +- Split documentation into -doc subpackage. +- Claim ownership of {_libdir}/dyninst. + +* Fri Jul 27 2012 William Cohen - 7.99-0.22 +- Correct requires for dyninst-devel. + +* Wed Jul 25 2012 Josh Stone - 7.99-0.21 +- Rebase on newer git tree +- Update context in dyninst-git.patch +- Drop dyninst-delete_array.patch +- Drop dyninst-common-makefile.patch + +* Wed Jul 18 2012 Fedora Release Engineering - 7.99-0.20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 16 2012 William Cohen - 7.99-0.19 +- Patch common/i386-unknown-linux2.4/Makefile to build. + +* Fri Jul 13 2012 William Cohen - 7.99-0.18 +- Rebase on newer git tree the has a number of merges into it. +- Adjust spec file to allow direct use of git patches +- Fix to eliminate unused varables. +- Proper delete for array. + +* Thu Jun 28 2012 William Cohen - 7.99-0.17 +- Rebase on newer git repo. + +* Thu Jun 28 2012 William Cohen - 7.99-0.16 +- Eliminate dynptr.h file use with rebase on newer git repo. + +* Mon Jun 25 2012 William Cohen - 7.99-0.14 +- Rebase on newer git repo. + +* Tue Jun 19 2012 William Cohen - 7.99-0.12 +- Fix static library and header file permissions. +- Use sources from the dyninst git repositories. +- Fix 32-bit library versioning for libdyninstAPI_RT_m32.so. + +* Wed Jun 13 2012 William Cohen - 7.99-0.11 +- Fix library versioning. +- Move .so links to dyninst-devel. +- Remove unneded clean section. + +* Fri May 11 2012 William Cohen - 7.0.1-0.9 +- Clean up Makefile rules. + +* Sat May 5 2012 William Cohen - 7.0.1-0.8 +- Clean up spec file. + +* Wed May 2 2012 William Cohen - 7.0.1-0.7 +- Use "make install" and do staged build. +- Use rpm configure macro. + +* Thu Mar 15 2012 William Cohen - 7.0.1-0.5 +- Nuke the bundled boost files and use the boost-devel rpm instead. + +* Mon Mar 12 2012 William Cohen - 7.0.1-0.4 +- Initial submission of dyninst spec file. diff --git a/sources b/sources new file mode 100644 index 0000000..496c76e --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (testsuite-10.1.0.tar.gz) = 47b91ebc0623f672378086a5f8d84e3934bd6b22d8932b12aaad257ccf7eb109505edb63dfbc3eb15aa099fc488a517835412099a77e3e0dd1275b3e3f672b3b +SHA512 (dyninst-10.2.0.tar.gz) = 32ddf871a8b486bb38530a264b140f504bfd5fb9401c940c6e36540f932ad8dd87375a517324416035ba6eeb05107cf03acebc88bdaad4b5d4c3643afaa5ac5c diff --git a/testsuite-10.1.0-386.patch b/testsuite-10.1.0-386.patch new file mode 100644 index 0000000..eb46c9f --- /dev/null +++ b/testsuite-10.1.0-386.patch @@ -0,0 +1,44 @@ +--- dyninst-10.1.0/testsuite-10.1.0/CMakeLists.txt ++++ dyninst-10.1.0/testsuite-10.1.0/CMakeLists.txt +@@ -111,7 +111,8 @@ + if(UNIX) + enable_language(ASM-ATT) +- if("${DYNINST_PLATFORM}" MATCHES "i386") +- enable_language(ASM_NASM) +- endif() ++# nasm/yasm are deprecated ++# if("${DYNINST_PLATFORM}" MATCHES "i386") ++# enable_language(ASM_NASM) ++# endif() + elseif(WIN32) + enable_language(ASM_MASM) + +--- dyninst-10.1.0/testsuite-10.1.0/src/instruction/test_instruction_farcall.C ++++ dyninst-10.1.0/testsuite-10.1.0/src/instruction/test_instruction_farcall.C +@@ -96,21 +96,21 @@ test_results_t test_instruction_farcall_Mutator::executeTest() + if(decodedInsns.size() != expectedInsns) // six valid, one invalid + { + logerror("FAILED: Expected %d instructions, decoded %d\n", expectedInsns, decodedInsns.size()); +- for(std::vector::iterator curInsn = decodedInsns.begin(); ++ for(std::vector::iterator curInsn = decodedInsns.begin(); + curInsn != decodedInsns.end(); + ++curInsn) + { +- logerror("\t%s\t", (*curInsn)->format().c_str()); +- for(unsigned j = 0; j < (*curInsn)->size(); ++j) ++ logerror("\t%s\t", (*curInsn).format().c_str()); ++ for(unsigned j = 0; j < (*curInsn).size(); ++j) + { +- logerror("%x ", (*curInsn)->rawByte(j)); ++ logerror("%x ", (*curInsn).rawByte(j)); + } + logerror("\n"); + } + + return FAILED; + } +- if(decodedInsns.back() && decodedInsns.back()->isValid()) ++ if(decodedInsns.size() > 0 && decodedInsns.back().isValid()) + { + logerror("FAILED: Expected instructions to end with an invalid instruction, but they didn't"); + return FAILED; diff --git a/testsuite-10.1.0-gettid.patch b/testsuite-10.1.0-gettid.patch new file mode 100644 index 0000000..9b75b25 --- /dev/null +++ b/testsuite-10.1.0-gettid.patch @@ -0,0 +1,15 @@ +--- dyninst-10.1.0/testsuite-10.1.0/src/proccontrol/pcontrol_mutatee_tools.c.orig 2019-05-31 05:20:00.492379706 +0200 ++++ dyninst-10.1.0/testsuite-10.1.0/src/proccontrol/pcontrol_mutatee_tools.c 2019-05-31 05:10:11.354826668 +0200 +@@ -62,9 +62,9 @@ + #if !defined(os_windows_test) + #include + +-static unsigned int gettid(){ +- return (unsigned int)pthread_self(); +-} ++// static unsigned int gettid(){ ++// return (unsigned int)pthread_self(); ++// } + #endif + + thread_t threads[MAX_POSSIBLE_THREADS];