diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..0a80fdce31f59c062e2abba28776e9521eddff30 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..43da125ae35709841dbf38ff196d07589492d249 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/dyninst diff --git a/Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch b/Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch deleted file mode 100644 index a3837e5eb5b10ffb0ee8128f0ada6e717fb5dde4..0000000000000000000000000000000000000000 --- a/Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 817b1e41a05309d776f595f3f3eb96f1d2e39f6c Mon Sep 17 00:00:00 2001 -From: zhangxianting -Date: Fri, 21 Jun 2024 09:54:01 +0800 -Subject: [PATCH] Fix FindTBB version detection with TBB >= 2021.1.1 - ---- - cmake/Modules/FindTBB.cmake | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/dyninst-12.3.0/cmake/Modules/FindTBB.cmake b/dyninst-12.3.0/cmake/Modules/FindTBB.cmake -index cc62ffe..694e2df 100644 ---- a/cmake/Modules/FindTBB.cmake -+++ b/cmake/Modules/FindTBB.cmake -@@ -154,7 +154,8 @@ find_path( - if(TBB_INCLUDE_DIRS) - # Starting in 2020.1.1, tbb_stddef.h is replaced by version.h - set(_version_files "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" -- "${TBB_INCLUDE_DIRS}/tbb/version.h") -+ "${TBB_INCLUDE_DIRS}/tbb/version.h" -+ "${TBB_INCLUDE_DIRS}/oneapi/tbb/version.h") - foreach(f IN ITEMS ${_version_files}) - if(EXISTS ${f}) - set(_version_file ${f}) --- -2.43.0 - diff --git a/dyninst-12.3.0.tar.gz b/dyninst-12.3.0.tar.gz deleted file mode 100644 index 3d8df37a8933cf2279aa607e9244c75f3d2f0a23..0000000000000000000000000000000000000000 Binary files a/dyninst-12.3.0.tar.gz and /dev/null differ diff --git a/dyninst-13.0.0.tar.gz b/dyninst-13.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a1ec50852a7030c1b61b0a64dfb08d89bece7318 --- /dev/null +++ b/dyninst-13.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bc48d26478b677a6c090c25586a447507bd1b4cf88d369bd61820005ce1be39 +size 8099019 diff --git a/dyninst-eliminate-deprecated-C-function-objects-1331.patch b/dyninst-eliminate-deprecated-C-function-objects-1331.patch deleted file mode 100644 index e7af8f7ce1c9c4fc26dd413b658a19b5e0132689..0000000000000000000000000000000000000000 --- a/dyninst-eliminate-deprecated-C-function-objects-1331.patch +++ /dev/null @@ -1,265 +0,0 @@ -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-support-clang-build.patch b/dyninst-support-clang-build.patch deleted file mode 100644 index 62338a5943cac6696f753ff986ad57f6c923b10b..0000000000000000000000000000000000000000 --- a/dyninst-support-clang-build.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 6644c84edd08305f0305a1aaea20797cb01cb197 Mon Sep 17 00:00:00 2001 -From: luofeng -Date: Sat, 23 Sep 2023 10:17:45 +0800 -Subject: [PATCH] support clang build - ---- - cmake/options.cmake | 3 ++- - .../src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C | 4 ++-- - .../src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.h | 2 +- - .../src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.C | 2 +- - .../src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.h | 2 +- - .../src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C | 4 ++-- - 6 files changed, 9 insertions(+), 8 deletions(-) - -diff --git a/cmake/options.cmake b/cmake/options.cmake -index 7cbe66b..0481463 100644 ---- a/cmake/options.cmake -+++ b/cmake/options.cmake -@@ -1,5 +1,6 @@ - # Use OpenMP? --option(USE_OpenMP "Use OpenMP for parallel parsing" ON) -+# option(USE_OpenMP "Use OpenMP for parallel parsing" ON) -+option(USE_OpenMP "Use OpenMP for parallel parsing" OFF) - - # Use SymtabAPI or SymLite? - option( -diff --git a/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C b/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C -index daf7a4b..66b4a3a 100644 ---- a/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C -+++ b/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.C -@@ -162,7 +162,7 @@ namespace Dyninst { - Expression::Ptr InstructionDecoder_amdgpu_cdna2::decodeOPR_WAITCNT(uint64_t input){ - return Immediate::makeImmediate(Result(s16, input)); - } -- Expression::Ptr InstructionDecoder_amdgpu_cdna2::makeRegisterExpression(MachRegister registerID){ -+ Expression::Ptr InstructionDecoder_amdgpu_cdna2::makeRegisterExpression(MachRegister registerID, uint32_t){ - if(registerID == amdgpu_cdna2::src_literal){ - return Immediate::makeImmediate(Result(u32,decodeOPR_LITERAL())); - } -@@ -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_fn(decode_lookup_table[instr_family])(this); -+ //std::mem_fun(decode_lookup_table[instr_family])(this); - } - b.start += insn_in_progress->size(); - return *insn_in_progress; -diff --git a/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.h b/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.h -index d35482f..f194ac4 100644 ---- a/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.h -+++ b/instructionAPI/src/AMDGPU/cdna2/InstructionDecoder-amdgpu-cdna2.h -@@ -306,7 +306,7 @@ namespace Dyninst { - Expression::Ptr decodeOPR_SIMM32(uint64_t input); - Expression::Ptr decodeOPR_WAITCNT(uint64_t input); - using InstructionDecoderImpl::makeRegisterExpression; -- Expression::Ptr makeRegisterExpression(MachRegister registerID); -+ Expression::Ptr makeRegisterExpression(MachRegister registerID, uint32_t num_elements = 1); - Expression::Ptr makeRegisterExpression(MachRegister registerID, uint32_t low , uint32_t high ); - void specialHandle(); - #include "amdgpu_cdna2_decoder_impl.h" -diff --git a/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.C b/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.C -index 70d9edc..a629b3c 100644 ---- a/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.C -+++ b/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.C -@@ -178,7 +178,7 @@ namespace Dyninst { - Expression::Ptr InstructionDecoder_amdgpu_gfx908::decodeOPR_WAITCNT(uint64_t input){ - return Immediate::makeImmediate(Result(s16, input)); - } -- Expression::Ptr InstructionDecoder_amdgpu_gfx908::makeRegisterExpression(MachRegister registerID){ -+ Expression::Ptr InstructionDecoder_amdgpu_gfx908::makeRegisterExpression(MachRegister registerID, uint32_t){ - if(registerID == amdgpu_gfx908::src_literal){ - return Immediate::makeImmediate(Result(u32,decodeOPR_LITERAL())); - } -diff --git a/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.h b/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.h -index 7826af0..b5420d8 100644 ---- a/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.h -+++ b/instructionAPI/src/AMDGPU/gfx908/InstructionDecoder-amdgpu-gfx908.h -@@ -299,7 +299,7 @@ namespace Dyninst { - Expression::Ptr decodeOPR_SIMM32(uint64_t input); - Expression::Ptr decodeOPR_WAITCNT(uint64_t input); - using InstructionDecoderImpl::makeRegisterExpression; -- Expression::Ptr makeRegisterExpression(MachRegister registerID); -+ Expression::Ptr makeRegisterExpression(MachRegister registerID, uint32_t num_elements = 1); - Expression::Ptr makeRegisterExpression(MachRegister registerID, uint32_t low , uint32_t high ); - void specialHandle(); - #include "amdgpu_gfx908_decoder_impl.h" -diff --git a/instructionAPI/src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C b/instructionAPI/src/AMDGPU/vega/InstructionDecoder-amdgpu-vega.C -index ed7cbed..3093ece 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_fn(insn_entry.operands[i])(this); -+ std::mem_fun(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_fn(decode_lookup_table[instr_family])(this); -+ std::mem_fun(decode_lookup_table[instr_family])(this); - } - b.start += insn_in_progress->size(); - return *insn_in_progress; --- -2.19.1 - diff --git a/dyninst-warning-fix-std-iterator-is-deprecated-1394.patch b/dyninst-warning-fix-std-iterator-is-deprecated-1394.patch deleted file mode 100644 index 15ff5ae20557b8190d4999d3abc4b636c1054896..0000000000000000000000000000000000000000 --- a/dyninst-warning-fix-std-iterator-is-deprecated-1394.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 55d8a338e362d3aa4448aa9bae776eb90ca1292a Mon Sep 17 00:00:00 2001 -From: "James A. Kupsch" -Date: Thu, 16 Feb 2023 10:11:59 -0600 -Subject: [PATCH] warning fix: std::iterator is deprecated (#1394) - -- replace std::iterator with in class type aliass for required types ---- - symtabAPI/h/Symtab.h | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/symtabAPI/h/Symtab.h b/symtabAPI/h/Symtab.h -index 7731c1572..bf6d8ab23 100644 ---- a/symtabAPI/h/Symtab.h -+++ b/symtabAPI/h/Symtab.h -@@ -558,9 +558,15 @@ class SYMTAB_EXPORT Symtab : public LookupInterface, - void erase(Symbol* s); - - // Iterator for the symbols. Do not use in parallel. -- class iterator : public std::iterator { -+ class iterator { - master_t::iterator m; - public: -+ using iterator_category = std::forward_iterator_tag; -+ using value_type = Symbol*; -+ using difference_type = std::ptrdiff_t; -+ using pointer = value_type*; -+ using reference = value_type&; -+ - iterator(master_t::iterator i) : m(i) {} - bool operator==(const iterator& x) { return m == x.m; } - bool operator!=(const iterator& x) { return !operator==(x); } --- -2.21.0.windows.1 - diff --git a/dyninst.spec b/dyninst.spec index 70ccde21c9b8b5aa2417d4c042f30b2f9d2e742c..835d81dfccff39bc196288bca1a8e165193a1c07 100644 --- a/dyninst.spec +++ b/dyninst.spec @@ -1,28 +1,23 @@ Name: dyninst -License: LGPLv2+ -Release: 7 -Version: 12.3.0 +License: LGPL-2.1-or-later +Version: 13.0.0 +Release: 1 Summary: An API for Run-time Code Generation ExclusiveArch: x86_64 aarch64 - -%global dyninst_base dyninst-%{version} -%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: dyninst-eliminate-deprecated-C-function-objects-1331.patch -Patch2: dyninst-warning-fix-std-iterator-is-deprecated-1394.patch -Patch3: dyninst-support-clang-build.patch -Patch4: Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch +Patch1: github-pr1721.patch +Patch2: github-pr1880.patch +Patch3: github-pr1880-ish.patch +Patch4: github-pr1730.patch BuildRequires: cmake gcc-c++ -BuildRequires: binutils-devel boost-devel -BuildRequires: elfutils-libelf-devel -BuildRequires: elfutils-devel libxml2-devel -BuildRequires: libtirpc-devel tbb tbb-devel +BuildRequires: binutils-devel +BuildRequires: boost-devel >= 1.71.0 +BuildRequires: tbb-devel >= 2019.9 +BuildRequires: pkgconfig(libdebuginfod) >= 0.186 +BuildRequires: pkgconfig(libdw) >= 0.186 +BuildRequires: pkgconfig(libelf) >= 0.186 BuildRequires: gcc-gfortran glibc-static libstdc++-static nasm @@ -46,45 +41,27 @@ dyninst-devel includes the C header files and libraries. %package_help %prep -%setup -q -n %{name}-%{version} -c -%setup -q -T -D -a 1 - -pushd %{dyninst_base} -%patch 1 -p1 -%patch 2 -p1 -%patch 3 -p1 -%patch 4 -p1 -popd - -sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \ - %{dyninst_base}/cmake/shared.cmake +%autosetup -p1 -n %{name}-%{version} %build -cd %{dyninst_base} - -CFLAGS="$CFLAGS $RPM_OPT_FLAGS" -LDFLAGS="$LDFLAGS $RPM_LD_FLAGS" -CXXFLAGS="$CFLAGS" -export CFLAGS CXXFLAGS LDFLAGS - -%cmake \ - -DENABLE_STATIC_LIBS=1 \ - -DINSTALL_LIB_DIR:PATH=%{_libdir}/dyninst \ - -DINSTALL_INCLUDE_DIR:PATH=%{_includedir}/dyninst \ - -DINSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Dyninst \ +%cmake --log-level=DEBUG \ + -DENABLE_DEBUGINFOD=1 \ -DCMAKE_BUILD_TYPE=None \ - -DCMAKE_SKIP_RPATH:BOOL=YES + -DCMAKE_SKIP_RPATH:BOOL=YES \ + -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir}/dyninst \ + -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir}/dyninst %cmake_build -DESTDIR="../install" %__cmake --install "%{__cmake_builddir}" -find ../install -name '*.cmake' -execdir \ - sed -i -e "s!%{_prefix}!$PWD/../install&!" '{}' '+' -sed -i '/libtbb.so/ s/".*usr/"\/usr/' $PWD/../install%{_libdir}/cmake/Dyninst/commonTargets.cmake - %install -cd %{dyninst_base} %cmake_install +# move /usr/lib64//dyninst/cmake/Dyninst to /usr/lib64/cmake/Dyninst +mkdir -p %{buildroot}/%{_libdir}/cmake +mv %{buildroot}/%{_libdir}/dyninst/cmake/Dyninst %{buildroot}/%{_libdir}/cmake/Dyninst + +# this is a testsuite-like binary, not needed in main package +rm -f "%{buildroot}%{_bindir}/parseThat" + mkdir -p %{buildroot}/etc/ld.so.conf.d echo "%{_libdir}/dyninst" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf @@ -92,38 +69,35 @@ echo "%{_libdir}/dyninst" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf %postun -p /sbin/ldconfig %files +%license COPYRIGHT +%license LICENSE.md %dir %{_libdir}/dyninst %{_libdir}/dyninst/*.so.* %{_libdir}/dyninst/libdyninstAPI_RT.so +%{_libdir}/dyninst/libdyninstAPI_RT.a %config(noreplace) /etc/ld.so.conf.d/* %files devel %{_includedir}/dyninst %{_libdir}/dyninst/*.so %{_libdir}/cmake/Dyninst -%{_libdir}/dyninst/*.a -%{_bindir}/parseThat -%exclude %{_bindir}/cfg_to_dot -%exclude /usr/bin/codeCoverage -%exclude /usr/bin/unstrip -%exclude /usr/bin/ddb.db -%exclude /usr/bin/params.db -%exclude /usr/bin/unistd.db %files help -%doc %{dyninst_base}/COPYRIGHT -%doc %{dyninst_base}/LICENSE.md -%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 +%doc dataflowAPI/doc/dataflowAPI.pdf +%doc dynC_API/doc/dynC_API.pdf +%doc dyninstAPI/doc/dyninstAPI.pdf +%doc instructionAPI/doc/instructionAPI.pdf +%doc parseAPI/doc/parseAPI.pdf +%doc patchAPI/doc/patchAPI.pdf +%doc proccontrol/doc/proccontrol.pdf +%doc stackwalk/doc/stackwalk.pdf +%doc symtabAPI/doc/symtabAPI.pdf %changelog +* Sun Mar 02 2025 Funda Wang - 13.0.0-1 +- update to 13.0.0 +- do not ship testcase files + * Mon Dec 16 2024 wangxiao - 12.3.0-7 - adapt to new cmake macro diff --git a/dyninst.yaml b/dyninst.yaml index 43af000b27a0eddfd1e2065f36daf8e9cfc7c003..ea3be230b3b93f92ad839d5bdd724157fc26eb7c 100644 --- a/dyninst.yaml +++ b/dyninst.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: dyninst/dyninst tag_prefix: ^v -seperator: . +separator: . diff --git a/github-pr1721.patch b/github-pr1721.patch new file mode 100644 index 0000000000000000000000000000000000000000..3fde0c93dffb932c821b4ec17a2b6ad4dce85a5f --- /dev/null +++ b/github-pr1721.patch @@ -0,0 +1,55 @@ +commit e70b1001eb5082bb0204b602e3ca1cfccd67fc94 +gpg: Signature made Tue 09 Apr 2024 11:21:17 AM EDT +gpg: using RSA key B5690EEEBB952194 +gpg: Can't check signature: No public key +Author: kupsch +Date: Tue Apr 9 10:21:17 2024 -0500 + + improve cmake install dirs (#1721) + + * Use cmake's GNUInstallDirs to get the lib, bin and include directory + names instead of always using 'lib', 'bin', and 'include'. This + results in two changes to the installation: + + - lib directory becomes 'lib64' on platforms where this is the + convention + + - the lib, bin and include may be overwritten using the cmake + variables CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR and + CMAKE_INSTALL_INCLUDEDIR respectively + + * Update github workflows to handle the lib install dir lib64: + + - use Dyninst_ROOT instead of Dyninst_DIR as it searches for the + directory used + + - for non-cmake uses search for lib* to find either lib or lib64 + +diff --git a/cmake/DyninstLibrarySettings.cmake b/cmake/DyninstLibrarySettings.cmake +index d3627f8789f2..e8cb26b95c39 100644 +--- a/cmake/DyninstLibrarySettings.cmake ++++ b/cmake/DyninstLibrarySettings.cmake +@@ -25,9 +25,10 @@ else() + set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) + endif() + +-set(DYNINST_INSTALL_BINDIR "bin") +-set(DYNINST_INSTALL_LIBDIR "lib") +-set(DYNINST_INSTALL_INCLUDEDIR "include") ++include(GNUInstallDirs) ++set(DYNINST_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}") ++set(DYNINST_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}") ++set(DYNINST_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") + set(DYNINST_INSTALL_CMAKEDIR "${DYNINST_INSTALL_LIBDIR}/cmake/Dyninst") + + # -- Set up the RPATH --- +diff --git a/parseThat/CMakeLists.txt b/parseThat/CMakeLists.txt +index ffe4b7aea29c..d4697a8a1d99 100644 +--- a/parseThat/CMakeLists.txt ++++ b/parseThat/CMakeLists.txt +@@ -29,4 +29,4 @@ target_link_libraries(parseThat PRIVATE dyninstAPI) + target_include_directories(parseThat BEFORE + PRIVATE "$") + +-install(TARGETS parseThat RUNTIME DESTINATION bin) ++install(TARGETS parseThat RUNTIME DESTINATION "${DYNINST_INSTALL_BINDIR}") diff --git a/github-pr1730.patch b/github-pr1730.patch new file mode 100644 index 0000000000000000000000000000000000000000..72c667eb8980bd034b8eb240a18e29c1c1abe04e --- /dev/null +++ b/github-pr1730.patch @@ -0,0 +1,151 @@ +commit eae798d4e5f938cb85758571dbab9afbbea7b5d2 (HEAD -> v13.0.0) +Author: Frank Ch. Eigler +Date: Thu Feb 6 08:35:33 2025 -0500 + + MachRegister: fix initialization order bug (#1731) + + Backported upstream commit to 13.0.0 base. + + commit a29f32ac87c4483b97a2c5cb9beed5642124ae8f + Author: Tim Haines + Date: Mon Apr 22 15:32:12 2024 -0500 + + MachRegister: fix initialization order bug (#1731) + + This fixes the static initialization ordering issue reported in https://github.com/dyninst/dyninst/issues/1730. + +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 669659e44c76..b6507772858c 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -39,7 +39,6 @@ set(_public_headers + h/registers/AMDGPU/amdgpu_gfx90a_regs.h + h/registers/AMDGPU/amdgpu_gfx940_regs.h + h/registers/cuda_regs.h +- h/registers/MachRegister.h + h/registers/ppc32_regs.h + h/registers/ppc64_regs.h + h/registers/reg_def.h +@@ -72,12 +71,12 @@ set(_private_headers + src/lprintf.h + src/lru_cache.h + src/MappedFile.h ++ src/registers/MachRegisterCache.h + src/NodeIterator.h + src/ntHeaders.h + src/parseauxv.h + src/pathName.h + src/pool_allocators.h +- src/registers/MachRegister.C + src/sha1.h + src/singleton_object_pool.h + src/stats.h +@@ -111,6 +110,7 @@ set(_sources + src/debug_common.C + src/VariableLocation.C + src/Buffer.C ++ src/registers/MachRegister.C + src/MachSyscall.C) + + if(DYNINST_OS_UNIX) +diff --git a/common/src/dyn_regs.C b/common/src/dyn_regs.C +index 3fcd194a71dd..7951dbe753bc 100644 +--- a/common/src/dyn_regs.C ++++ b/common/src/dyn_regs.C +@@ -28,8 +28,16 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#include "registers/MachRegisterCache.h" ++ ++namespace Dyninst { namespace registers { ++ // These are used in MachRegister.C ++ name_cache names; ++}} ++ + //clang-format: off + #define DYN_DEFINE_REGS + #include "dyn_regs.h" + #undef DYN_DEFINE_REGS + //clang-format: on ++ +diff --git a/common/src/registers/MachRegister.C b/common/src/registers/MachRegister.C +index ccd01abc1811..93c020c04415 100644 +--- a/common/src/registers/MachRegister.C ++++ b/common/src/registers/MachRegister.C +@@ -1,4 +1,5 @@ + #include "common/h/registers/MachRegister.h" ++#include "registers/MachRegisterCache.h" + #include "debug_common.h" + #include "dyn_regs.h" + #include "external/rose/amdgpuInstructionEnum.h" +@@ -10,17 +11,24 @@ + #include + + namespace { +- std::unordered_map names; + const std::string invalid_reg_name{""}; + } + ++namespace Dyninst { namespace registers { ++ // These are defined in dyn_regs.C to ensure global constructor initialization ordering ++ extern name_cache names; ++ } ++} ++ ++ + namespace Dyninst { + + MachRegister::MachRegister() : reg(0) {} + + MachRegister::MachRegister(signed int r) : reg(r) {} + +- MachRegister::MachRegister(signed int r, std::string n) : reg(r) { names.emplace(r, std::move(n)); } ++ MachRegister::MachRegister(signed int r, std::string n) : reg(r) { ++ registers::names.emplace(r, std::move(n)); } + + unsigned int MachRegister::regClass() const { return reg & 0x00ff0000; } + +@@ -106,8 +114,8 @@ namespace Dyninst { + bool MachRegister::isValid() const { return (reg != InvalidReg.reg); } + + std::string const& MachRegister::name() const { +- auto iter = names.find(reg); +- if(iter != names.end()) { ++ auto iter = registers::names.find(reg); ++ if(iter != registers::names.end()) { + return iter->second; + } + common_parsing_printf("No MachRegister found with value %x\n", static_cast(reg)); +diff --git a/common/src/dyn_regs.C b/common/src/registers/MachRegisterCache.h +similarity index 80% +copy from common/src/dyn_regs.C +copy to common/src/registers/MachRegisterCache.h +index 3fcd194a71dd..2a74bbde821a 100644 +--- a/common/src/dyn_regs.C ++++ b/common/src/registers/MachRegisterCache.h +@@ -28,8 +28,19 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-//clang-format: off +-#define DYN_DEFINE_REGS +-#include "dyn_regs.h" +-#undef DYN_DEFINE_REGS +-//clang-format: on ++#ifndef DYNINST_COMMON_REGISTERS_MACHREGISTERCACHE_H ++#define DYNINST_COMMON_REGISTERS_MACHREGISTERCACHE_H ++ ++#include "registers/MachRegister.h" ++ ++#include ++#include ++#include ++#include ++ ++namespace Dyninst { namespace registers { ++ typedef std::unordered_map name_cache; ++}} ++ ++ ++#endif diff --git a/github-pr1880-ish.patch b/github-pr1880-ish.patch new file mode 100644 index 0000000000000000000000000000000000000000..77e763fe65d0014b66331e13aa5cb6ff614cb988 --- /dev/null +++ b/github-pr1880-ish.patch @@ -0,0 +1,36 @@ +diff --git a/common/h/Annotatable.h b/common/h/Annotatable.h +index 6588e3dd36da..262a193ffbb8 100644 +--- a/common/h/Annotatable.h ++++ b/common/h/Annotatable.h +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include "util.h" + #include "compiler_annotations.h" + +diff --git a/instructionAPI/h/ArchSpecificFormatters.h b/instructionAPI/h/ArchSpecificFormatters.h +index b32d4cc14e03..145c604f9619 100644 +--- a/instructionAPI/h/ArchSpecificFormatters.h ++++ b/instructionAPI/h/ArchSpecificFormatters.h +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include "Architecture.h" + #include "registers/MachRegister.h" + +diff --git a/common/src/arch-x86.h b/common/src/arch-x86.h +index ecdc3dc13..7745306d3 100644 +--- a/common/src/arch-x86.h ++++ b/common/src/arch-x86.h +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + #include "entryIDs.h" + #include "registers/MachRegister.h" + #include "common/src/ia32_locations.h" diff --git a/github-pr1880.patch b/github-pr1880.patch new file mode 100644 index 0000000000000000000000000000000000000000..c8f87955eddecce8d26306054eca1d3bfa1fa222 --- /dev/null +++ b/github-pr1880.patch @@ -0,0 +1,23 @@ +commit 165402aa1640afb394b11a096b38c6bc3a5bf9d0 (github-fche/patch-1) +gpg: Signature made Wed 22 Jan 2025 03:35:55 PM EST +gpg: using RSA key B5690EEEBB952194 +gpg: Can't check signature: No public key +Author: Frank Ch. Eigler +Date: Wed Jan 22 15:35:55 2025 -0500 + + Update sha1.C: #include + + Subject header is needed on gcc15 to compile sha1.C, supplying declaration of types like uint32_t. + +diff --git a/common/src/sha1.C b/common/src/sha1.C +index 91e9ad291561..d6e76c5727ac 100644 +--- a/common/src/sha1.C ++++ b/common/src/sha1.C +@@ -102,6 +102,7 @@ A million repetitions of "a" + + #include + #include ++#include + + #include "dyntypes.h" + #include "common/src/sha1.h" diff --git a/testsuite-12.3.0.tar.gz b/testsuite-12.3.0.tar.gz deleted file mode 100644 index e073480694ff798ee50541bd7c4a49fc3a90417c..0000000000000000000000000000000000000000 Binary files a/testsuite-12.3.0.tar.gz and /dev/null differ