diff --git a/0001-add-missing-include-file-1344.patch b/0001-add-missing-include-file-1344.patch deleted file mode 100644 index cc4337541a4a29b863e235b4f65bffc716e26ec6..0000000000000000000000000000000000000000 --- a/0001-add-missing-include-file-1344.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 2e3bf92eedf575c780e4381ae810a050ee404f03 Mon Sep 17 00:00:00 2001 -From: kupsch -Date: Thu, 5 Jan 2023 13:13:14 -0600 -Subject: [PATCH] add missing include file (#1344) - -- add missing #include - - On more platforms and library combinations is included via - some other header, but there is combination where this is not true ---- - dataflowAPI/src/AbslocInterface.C | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dataflowAPI/src/AbslocInterface.C b/dataflowAPI/src/AbslocInterface.C -index 9d7ad000c..582e64004 100644 ---- a/dataflowAPI/src/AbslocInterface.C -+++ b/dataflowAPI/src/AbslocInterface.C -@@ -29,6 +29,7 @@ - */ - - -+#include - #include "Absloc.h" - #include "AbslocInterface.h" - --- -2.33.0 - diff --git a/0001-eliminate-deprecated-C-function-objects-1331.patch b/0001-eliminate-deprecated-C-function-objects-1331.patch new file mode 100644 index 0000000000000000000000000000000000000000..e7af8f7ce1c9c4fc26dd413b658a19b5e0132689 --- /dev/null +++ b/0001-eliminate-deprecated-C-function-objects-1331.patch @@ -0,0 +1,265 @@ +From 6436c734eef50d55ed6c562aa3fabf0c7039c50c Mon Sep 17 00:00:00 2001 +From: "James A. Kupsch" +Date: Wed, 7 Dec 2022 13:28:08 -0600 +Subject: [PATCH] eliminate deprecated C++ function objects (#1331) + +fix function objects that were deprecate in C++ 11 and removed in C++ 17 + +- replace mem_fun with mem_fn +- eliminate binary_function and unary_function base classes +- use const iterator when constructing boost::transform_iterator +--- + dyninstAPI/h/BPatch_basicBlock.h | 4 +++- + dyninstAPI/src/StackMod/StackLocation.h | 5 +++-- + dyninstAPI/src/addressSpace.C | 10 +++++----- + .../AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C | 2 +- + .../src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C | 4 ++-- + instructionAPI/src/InstructionDecoder-aarch64.C | 2 +- + instructionAPI/src/InstructionDecoder-power.C | 6 +++--- + symtabAPI/h/Aggregate.h | 2 +- + symtabAPI/src/Aggregate.C | 12 ++++++------ + symtabAPI/src/Object-elf.C | 4 ++-- + 10 files changed, 27 insertions(+), 24 deletions(-) + +diff --git a/dyninstAPI/h/BPatch_basicBlock.h b/dyninstAPI/h/BPatch_basicBlock.h +index 37547d40c..de26fd81f 100644 +--- a/dyninstAPI/h/BPatch_basicBlock.h ++++ b/dyninstAPI/h/BPatch_basicBlock.h +@@ -89,8 +89,10 @@ struct comparison { + */ + class BPatch_flowGraph; + +-struct BPATCH_DLL_EXPORT insnPredicate : public std::unary_function ++struct BPATCH_DLL_EXPORT insnPredicate + { ++ using result_type = bool; ++ using argument_type = Dyninst::InstructionAPI::Instruction; + virtual result_type operator()(argument_type arg) = 0; + virtual ~insnPredicate() {} + +diff --git a/dyninstAPI/src/StackMod/StackLocation.h b/dyninstAPI/src/StackMod/StackLocation.h +index 4b1d731e6..51775e261 100644 +--- a/dyninstAPI/src/StackMod/StackLocation.h ++++ b/dyninstAPI/src/StackMod/StackLocation.h +@@ -132,7 +132,8 @@ class StackLocation { + ValidPCRange* _valid; + }; + +-struct less_StackLocation: public std::binary_function { ++struct less_StackLocation ++{ + bool operator()(StackLocation* a, StackLocation* b) const { + if (a->isStackMemory() && b->isStackMemory()) { + if (a->off().height() == b->off().height()) { +@@ -178,7 +179,7 @@ class tmpObject + ValidPCRange* _valid; + }; + +-struct less_tmpObject: public std::binary_function ++struct less_tmpObject + { + bool operator()(tmpObject a, tmpObject b) const { + if (a.offset() < b.offset()) { +diff --git a/dyninstAPI/src/addressSpace.C b/dyninstAPI/src/addressSpace.C +index 3b4cf9eba..8978262f6 100644 +--- a/dyninstAPI/src/addressSpace.C ++++ b/dyninstAPI/src/addressSpace.C +@@ -284,7 +284,7 @@ void AddressSpace::inferiorFreeCompact() { + unsigned i, nbuf = freeList.size(); + + /* sort buffers by address */ +- std::sort(freeList.begin(), freeList.end(), ptr_fun(heapItemLessByAddr)); ++ std::sort(freeList.begin(), freeList.end(), heapItemLessByAddr); + + /* combine adjacent buffers */ + bool needToCompact = false; +@@ -371,7 +371,7 @@ void AddressSpace::addHeap(heapItem *h) { + heap_.heapFree.push_back(h2); + + /* When we add an item to heapFree, make sure it remains in sorted order */ +- std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), ptr_fun(heapItemLessByAddr)); ++ std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), heapItemLessByAddr); + + heap_.totalFreeMemAvailable += h2->length; + } +@@ -425,7 +425,7 @@ Address AddressSpace::inferiorMallocInternal(unsigned size, + } + + /* When we update an item in heapFree, make sure it remains in sorted order */ +- std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), ptr_fun(heapItemLessByAddr)); ++ std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), heapItemLessByAddr); + + // add allocated block to active list + h->length = size; +@@ -455,7 +455,7 @@ void AddressSpace::inferiorFreeInternal(Address block) { + heap_.heapFree.push_back(h); + + /* When we add an item to heapFree, make sure it remains in sorted order */ +- std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), ptr_fun(heapItemLessByAddr)); ++ std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), heapItemLessByAddr); + + heap_.totalFreeMemAvailable += h->length; + heap_.freed += h->length; +@@ -561,7 +561,7 @@ bool AddressSpace::inferiorShrinkBlock(heapItem *h, + heap_.heapFree.push_back(freeEnd); + + /* When we add an item to heapFree, make sure it remains sorted */ +- std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), ptr_fun(heapItemLessByAddr)); ++ std::sort(heap_.heapFree.begin(), heap_.heapFree.end(), heapItemLessByAddr); + } + + heap_.totalFreeMemAvailable += shrink; +diff --git a/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C b/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C +index f62b1f546..daf7a4b7d 100644 +--- a/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C ++++ b/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C +@@ -235,7 +235,7 @@ namespace Dyninst { + mainDecode(); + if(entryToCategory(insn_in_progress->getOperation().getID())==c_BranchInsn){ + //cout << "Is Branch Instruction !! , name = " << insn_in_progress -> getOperation().mnemonic << endl; +- //std::mem_fun(decode_lookup_table[instr_family])(this); ++ //std::mem_fn(decode_lookup_table[instr_family])(this); + } + b.start += insn_in_progress->size(); + return *insn_in_progress; +diff --git a/instructionAPI/src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C b/instructionAPI/src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C +index 3093ece41..ed7cbed78 100644 +--- a/instructionAPI/src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C ++++ b/instructionAPI/src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C +@@ -552,7 +552,7 @@ namespace Dyninst { + bool InstructionDecoder_amdgpu_vega::decodeOperands(const amdgpu_vega_insn_entry & insn_entry) { + if(insn_entry.operandCnt!=0){ + for (std::size_t i =0 ; i < insn_entry.operandCnt; i++){ +- std::mem_fun(insn_entry.operands[i])(this); ++ std::mem_fn(insn_entry.operands[i])(this); + } + } + return true; +@@ -721,7 +721,7 @@ namespace Dyninst { + setupInsnWord(b); + mainDecodeOpcode(b); + if(entryToCategory(insn_in_progress->getOperation().getID())==c_BranchInsn){ +- std::mem_fun(decode_lookup_table[instr_family])(this); ++ std::mem_fn(decode_lookup_table[instr_family])(this); + } + b.start += insn_in_progress->size(); + return *insn_in_progress; +diff --git a/instructionAPI/src/InstructionDecoder-aarch64.C b/instructionAPI/src/InstructionDecoder-aarch64.C +index 53a831c3c..2e8935923 100644 +--- a/instructionAPI/src/InstructionDecoder-aarch64.C ++++ b/instructionAPI/src/InstructionDecoder-aarch64.C +@@ -2960,7 +2960,7 @@ Expression::Ptr InstructionDecoder_aarch64::makeMemRefExPair2(){ + skipRm = true; + + for (std::size_t i = 0; i < insn_table_entry.operandCnt; i++) { +- std::mem_fun(insn_table_entry.operands[i])(this); ++ std::mem_fn(insn_table_entry.operands[i])(this); + } + + if (insn_table_index == 0) +diff --git a/instructionAPI/src/InstructionDecoder-power.C b/instructionAPI/src/InstructionDecoder-power.C +index ffd38bcf3..34b903d11 100644 +--- a/instructionAPI/src/InstructionDecoder-power.C ++++ b/instructionAPI/src/InstructionDecoder-power.C +@@ -297,7 +297,7 @@ namespace Dyninst + const power_entry* current = &power_entry::main_opcode_table[field<0,5>(insn)]; + while(current->next_table) + { +- current = &(std::mem_fun(current->next_table)(this)); ++ current = &(std::mem_fn(current->next_table)(this)); + } + if (findRAAndRS(current)) { + isRAWritten = true; +@@ -314,7 +314,7 @@ namespace Dyninst + curFn != current->operands.end(); + ++curFn) + { +- std::mem_fun(*curFn)(this); ++ std::mem_fn(*curFn)(this); + } + if(current->op == power_op_bclr) + { +@@ -1429,7 +1429,7 @@ using namespace boost::assign; + const power_entry* current = &power_entry::main_opcode_table[field<0,5>(insn)]; + while(current->next_table) + { +- current = &(std::mem_fun(current->next_table)(this)); ++ current = &(std::mem_fn(current->next_table)(this)); + } + insn_in_progress = makeInstruction(current->op, current->mnemonic, 4, reinterpret_cast(&insn)); + if(current->op == power_op_b || +diff --git a/symtabAPI/h/Aggregate.h b/symtabAPI/h/Aggregate.h +index bcc930252..80caeb34b 100644 +--- a/symtabAPI/h/Aggregate.h ++++ b/symtabAPI/h/Aggregate.h +@@ -86,7 +86,7 @@ class SYMTAB_EXPORT Aggregate + //std::vector getAllMangledNames(); + //std::vector getAllPrettyNames(); + //std::vector getAllTypedNames(); +- typedef boost::transform_iterator, std::vector::const_iterator> name_iter; ++ using name_iter = boost::transform_iterator::const_iterator>; + name_iter mangled_names_begin() const; + name_iter mangled_names_end() const; + name_iter pretty_names_begin() const; +diff --git a/symtabAPI/src/Aggregate.C b/symtabAPI/src/Aggregate.C +index 2fc69358d..f0de0b841 100644 +--- a/symtabAPI/src/Aggregate.C ++++ b/symtabAPI/src/Aggregate.C +@@ -307,26 +307,26 @@ bool Aggregate::operator==(const Aggregate &a) + + Aggregate::name_iter Aggregate::mangled_names_begin() const + { +- return boost::make_transform_iterator(symbols_.begin(), std::mem_fun(&Symbol::getMangledName)); ++ return boost::make_transform_iterator(symbols_.cbegin(), std::mem_fn(&Symbol::getMangledName)); + } + + Aggregate::name_iter Aggregate::mangled_names_end() const + { +- return boost::make_transform_iterator(symbols_.end(), std::mem_fun(&Symbol::getMangledName)); ++ return boost::make_transform_iterator(symbols_.cend(), std::mem_fn(&Symbol::getMangledName)); + } + Aggregate::name_iter Aggregate::pretty_names_begin() const + { +- return boost::make_transform_iterator(symbols_.begin(), std::mem_fun(&Symbol::getPrettyName)); ++ return boost::make_transform_iterator(symbols_.cbegin(), std::mem_fn(&Symbol::getPrettyName)); + } + Aggregate::name_iter Aggregate::pretty_names_end() const + { +- return boost::make_transform_iterator(symbols_.end(), std::mem_fun(&Symbol::getPrettyName)); ++ return boost::make_transform_iterator(symbols_.cend(), std::mem_fn(&Symbol::getPrettyName)); + } + Aggregate::name_iter Aggregate::typed_names_begin() const + { +- return boost::make_transform_iterator(symbols_.begin(), std::mem_fun(&Symbol::getTypedName)); ++ return boost::make_transform_iterator(symbols_.cbegin(), std::mem_fn(&Symbol::getTypedName)); + } + Aggregate::name_iter Aggregate::typed_names_end() const + { +- return boost::make_transform_iterator(symbols_.end(), std::mem_fun(&Symbol::getTypedName)); ++ return boost::make_transform_iterator(symbols_.cend(), std::mem_fn(&Symbol::getTypedName)); + } +diff --git a/symtabAPI/src/Object-elf.C b/symtabAPI/src/Object-elf.C +index 9eb7a1dc8..4e73e7a13 100644 +--- a/symtabAPI/src/Object-elf.C ++++ b/symtabAPI/src/Object-elf.C +@@ -129,7 +129,7 @@ const char *pdelf_get_shnames(Elf_X *elf) { + // + // Compare function for use with the Vector sort method. + // +-struct SectionHeaderSortFunction : public binary_function { ++struct SectionHeaderSortFunction { + bool operator()(Elf_X_Shdr *hdr1, Elf_X_Shdr *hdr2) { + return (hdr1->sh_addr() < hdr2->sh_addr()); + } +@@ -3122,7 +3122,7 @@ int read_except_table_gcc3( + } + + +-struct exception_compare : public binary_function { ++struct exception_compare { + bool operator()(const ExceptionBlock &e1, const ExceptionBlock &e2) const { + if (e1.tryStart() < e2.tryStart()) + return true; +-- +2.33.0 + diff --git a/dyninst-12.2.1.tar.gz b/dyninst-12.3.0.tar.gz similarity index 53% rename from dyninst-12.2.1.tar.gz rename to dyninst-12.3.0.tar.gz index ceeee1a3ef9953a25edeccc644f2857839d08915..3d8df37a8933cf2279aa607e9244c75f3d2f0a23 100644 Binary files a/dyninst-12.2.1.tar.gz and b/dyninst-12.3.0.tar.gz differ diff --git a/dyninst.spec b/dyninst.spec index bba47ff09cb94b96c3e20e5c922184c73caf0fc8..ce5b5f440b3302e848576184ab7d82b1b866d33f 100644 --- a/dyninst.spec +++ b/dyninst.spec @@ -1,19 +1,19 @@ Name: dyninst License: LGPLv2+ -Release: 3 -Version: 12.2.1 +Release: 2 +Version: 12.3.0 Summary: An API for Run-time Code Generation ExclusiveArch: x86_64 aarch64 %global dyninst_base dyninst-%{version} -%global testsuite_version 12.2.1 +%global testsuite_version 12.3.0 %global testsuite_base testsuite-%{testsuite_version} URL: http://www.dyninst.org Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz Source1: https://github.com/dyninst/testsuite/archive/v%{testsuite_version}/%{testsuite_base}.tar.gz -Patch1: 0001-add-missing-include-file-1344.patch +Patch1: 0001-eliminate-deprecated-C-function-objects-1331.patch BuildRequires: cmake gcc-c++ BuildRequires: binutils-devel boost-devel @@ -51,7 +51,7 @@ dyninst-doc contains API documentation for the Dyninst libraries. %setup -q -T -D -a 1 pushd %{dyninst_base} -%patch1 -p1 +%patch 1 -p1 popd sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \ @@ -123,6 +123,12 @@ echo "%{_libdir}/dyninst" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf %doc %{dyninst_base}/symtabAPI/doc/symtabAPI.pdf %changelog +* Thu Jul 20 2023 Wenyu Liu - 12.3.0-2 +- eliminate deprecated C++ function objects + +* Wed Jul 19 2023 Wenyu Liu - 12.3.0-1 +- update to 12.3.0 + * Wed Mar 8 2023 Wenyu Liu - 12.2.1-3 - remove useless testsuitte in devel package diff --git a/testsuite-12.2.1.tar.gz b/testsuite-12.2.1.tar.gz deleted file mode 100644 index 7e8a32d5d6bb9df0ffeacfdf25a41a2e26499ef9..0000000000000000000000000000000000000000 Binary files a/testsuite-12.2.1.tar.gz and /dev/null differ diff --git a/testsuite-12.3.0.tar.gz b/testsuite-12.3.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e073480694ff798ee50541bd7c4a49fc3a90417c Binary files /dev/null and b/testsuite-12.3.0.tar.gz differ