Compare commits

...

1 Commits
c8 ... c10

Author SHA1 Message Date
5798a7383b import CS dyninst-13.0.0-1.el10 2025-11-11 08:51:39 +00:00
10 changed files with 448 additions and 134 deletions

View File

@ -1,2 +0,0 @@
cdbbb6ded567874409f9a6903f4a794e827c7436 SOURCES/dyninst-12.1.0.tar.gz
16dd6c1cdb105dac43aaa78315b23b59c6f30d2f SOURCES/testsuite-12.1.0.tar.gz

3
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/dyninst-12.1.0.tar.gz
SOURCES/testsuite-12.1.0.tar.gz
dyninst-13.0.0.tar.gz

View File

@ -1,11 +0,0 @@
Remove extraneous error messages of the form:
err message: .debug_loclists section missing
err message: invalid DWARF
which are repeated in some circumstances without adding useful context
--- dyninst-12.1.0/symtabAPI/src/dwarfWalker.C.orig 2021-04-08 16:48:12.000000000 -0400
+++ dyninst-12.1.0/symtabAPI/src/dwarfWalker.C 2021-04-27 12:48:55.643978425 -0400
@@ -1858,1 +1858,1 @@
- cerr << "err message: " << dwarf_errmsg(dwarf_errno()) << endl;
+ dwarf_printf("(0x%lx) Error while decoding location: %s\n", id(), dwarf_errmsg(dwarf_errno()));

View File

@ -1,14 +0,0 @@
--- dyninst-12.1.0/cmake/Boost.cmake.orig 2021-04-08 16:48:12.000000000 -0400
+++ dyninst-12.1.0/cmake/Boost.cmake 2021-05-07 12:35:53.124203324 -0400
@@ -53,3 +53,3 @@
# Need at least Boost-1.67 because of deprecated headers
-set(_boost_min_version 1.70.0)
+set(_boost_min_version 1.66.0)
--- dyninst-12.1.0/cmake/ThreadingBuildingBlocks.cmake.orig 2021-04-08 16:48:12.000000000 -0400
+++ dyninst-12.1.0/cmake/ThreadingBuildingBlocks.cmake 2021-05-07 12:40:13.092183538 -0400
@@ -52,3 +52,3 @@
else()
- set(_tbb_min_version 2018.6)
+ set(_tbb_min_version 2018.0)
endif()

View File

@ -1,21 +1,20 @@
Summary: An API for Run-time Code Generation
License: LGPLv2+
License: LGPL-2.1-or-later AND GPL-3.0-or-later WITH Bison-exception-2.2 AND LicenseRef-Fedora-Public-Domain AND BSD-3-Clause
Name: dyninst
Group: Development/Libraries
Release: 1%{?dist}
URL: http://www.dyninst.org
Version: 12.1.0
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
Version: 13.0.0
ExclusiveArch: x86_64 ppc64le aarch64
Obsoletes: dyninst-testsuite < %{version}
%define __testsuite_version 12.1.0
Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz
Source1: https://github.com/dyninst/testsuite/archive/%{__testsuite_version}/testsuite-%{__testsuite_version}.tar.gz
Patch1: dyninst-12.1.0-dwarf.patch
Patch2: dyninst-12.1.0-tbb.patch
Source0: dyninst-13.0.0.tar.gz
Patch1: github-pr1721.patch
Patch2: github-pr1880.patch
Patch3: github-pr1880-ish.patch
Patch4: github-pr1730.patch
%global dyninst_base dyninst-%{version}
%global testsuite_base testsuite-%{__testsuite_version}
BuildRequires: gcc-c++
BuildRequires: elfutils-devel
@ -29,15 +28,9 @@ BuildRequires: tbb tbb-devel
BuildRequires: tex-latex
BuildRequires: make
# Extra requires just for the testsuite
BuildRequires: gcc-gfortran glibc-static libstdc++-static 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
}
# https://fedoraproject.org/wiki/Changes/Linker_Error_On_Security_Issues
# may impact the RT library
%undefine _hardened_linker_errors
%description
@ -54,6 +47,7 @@ Summary: Documentation for using the Dyninst API
Group: Documentation
%description doc
dyninst-doc contains API documentation for the Dyninst libraries.
License: LGPL-2.1-or-later
%package devel
Summary: Header files for compiling programs with Dyninst
@ -61,46 +55,28 @@ Group: Development/System
Requires: dyninst = %{version}-%{release}
Requires: boost-devel
Requires: tbb-devel
License: LGPL-2.1-or-later AND BSD-3-Clause AND MIT
# FindTBB.cmake: presumed MIT, removed in next version of dyninst
%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 static
Summary: Static libraries for the compiling programs with Dyninst
Group: Development/System
Requires: dyninst-devel = %{version}-%{release}
%description static
dyninst-static includes the static versions of the library files for
the dyninst user-space libraries and interfaces.
%package testsuite
Summary: Programs for testing Dyninst
Group: Development/System
Requires: dyninst = %{version}-%{release}
Requires: dyninst-devel = %{version}-%{release}
Requires: dyninst-static = %{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
pushd %{testsuite_base}
popd
pushd %{dyninst_base}
%patch1 -p1 -b .dwarf
%patch2 -p1 -b .tbb
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
popd
# 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
# sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \
# %{dyninst_base}/cmake/shared.cmake
%build
@ -115,57 +91,31 @@ LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
CXXFLAGS="$CFLAGS"
export CFLAGS CXXFLAGS LDFLAGS
%cmake \
-DENABLE_STATIC_LIBS=1 \
%cmake --log-level=DEBUG \
-DENABLE_DEBUGINFOD=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 \
.
%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}
# testsuite build sometimes encounters dependency issues with -jN
%define _smp_mflags -j1
%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
-DINSTALL_CMAKE_DIR:PATH=/usr/lib64/cmake/Dyninst \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_INCLUDEDIR:PATH=/usr/include/dyninst \
-DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64/dyninst
%cmake_build -v -v -v
%install
cd %{dyninst_base}
%cmake_install
%cmake_install -v -v -v
# 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
# 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
cd ../%{testsuite_base}
%cmake_install
# 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
# 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.
find %{buildroot}%{_libdir}/dyninst/testsuite/ \
-type f '!' -name '*.a' -execdir chmod 644 '{}' '+'
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -174,6 +124,7 @@ find %{buildroot}%{_libdir}/dyninst/testsuite/ \
%{_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
@ -196,49 +147,174 @@ find %{buildroot}%{_libdir}/dyninst/testsuite/ \
%{_libdir}/dyninst/*.so
%{_libdir}/cmake/Dyninst
%files static
%{_libdir}/dyninst/*.a
%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
* Thu Apr 21 2022 Stan Cox <scox@redhat.com> - 12.1.0-1
* Fri May 02 2025 Frank Ch. Eigler <fche@redhat.com> - 13.0.0-1
- Rebased to dyninst 13.0.0 + buildability patches
- Dropping testsuite
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 12.3.0-8
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 12.3.0-7
- Bump release for June 2024 mass rebuild
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 12.3.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 12.3.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jan 17 2024 Jonathan Wakely <jwakely@redhat.com> - 12.3.0-4
- Rebuilt for Boost 1.83
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 12.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 11 2023 Frank Ch. Eigler <fche@redhat.com> - 12.3.0-2
- side-tag respin
* Tue Jul 04 2023 Frank Ch. Eigler <fche@redhat.com> - 12.3.0-1
- migrated to SPDX license
* Tue Jul 04 2023 Orion Poplawski <orion@nwra.com> - 12.3.0-1
- Update to 12.3.0
- Add patch for cmake 3.27 support
* Tue Jun 27 2023 Jonathan Wakely <jwakely@fedoraproject.org> - 12.2.0-5
- Patch for oneTBB (#2036372)
* Thu Feb 23 2023 Frank Ch. Eigler <fche@redhat.com> - 12.2.0-4
- rhbz2173030: ftbfs with gcc 13
* Mon Feb 20 2023 Jonathan Wakely <jwakely@redhat.com> - 12.2.0-3
- Rebuilt for Boost 1.81
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 12.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Oct 4 2022 William Cohen <wcohen@redhat.com> - 12.2.0-1
- Update to 12.2.0
* Wed Aug 03 2022 Stan Cox <scox@redhat.com> - 12.1.0-4
- Explicitly include time.h as <string> no longer pulls it in
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 12.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed May 04 2022 Thomas Rodgers <trodgers@redhat.com> - 12.1.0-2
- Rebuilt for Boost 1.78
* Thu Mar 10 2022 William Cohen <wcohen@redhat.com> - 12.1.0-1
- Update to 12.1.0
* Wed Jun 30 2021 Stan Cox <scox@redhat.com> - 11.0.0-3
- Related: rhbz1965455
* Sat Mar 05 2022 Orion Poplawski <orion@nwra.com> - 12.0.1-4
- Fix cmake build dir
* Mon Jun 28 2021 Stan Cox <scox@redhat.com> - 11.0.0-2
- Related: rhbz1965455, rhbz1965501
* Mon Feb 07 2022 Stan Cox <scox@redhat.com> - 12.0.1-3
- Quiesce dwarf 5 warnings
* Fri Apr 30 2021 Stan Cox <scox@redhat.com> - 11.0.0-1
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 12.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Jan 10 2022 Stan Cox <scox@redhat.com> - 12.0.1-1
- Update to 12.0.1
* Tue Nov 09 2021 Stan Cox <scox@redhat.com> - 11.0.1-4
- Do not create reloc for aarch64 static calls
* Fri Aug 06 2021 Jonathan Wakely <jwakely@redhat.com> - 11.0.1-3
- Rebuilt for Boost 1.76
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jul 08 2021 Stan Cox <scox@redhat.com> - 11.0.1
- Update to 11.0.1
* Fri Apr 30 2021 Stan Cox <scox@redhat.com> - 11.0.0
- Update to 11.0.0
* Fri Nov 06 2020 Stan Cox <scox@redhat.com> - 10.2.1-2
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 10.2.1-6
- Rebuilt for removed libstdc++ symbol (#1937698)
* Fri Jan 29 2021 Frank Ch. Eigler <fche@redhat.com> - 10.2.1-5
- Rebuilt for Boost 1.75 for sure, via buildrequire version constraints
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 10.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Jan 22 2021 Jonathan Wakely <jwakely@redhat.com> - 10.2.1-3
- Rebuilt for Boost 1.75
* Tue Nov 10 2020 Stan Cox <scox@redhat.com> - 10.2.1-2
- Enable debuginfod
* Wed Oct 28 2020 Stan Cox <scox@redhat.com> - 10.2.1-1
- Update to 10.2.1
* Tue Nov 19 2019 Stan Cox <scox@redhat.com> - 10.1.0-4
- Resolves: rhbz#963475 dyninst must be ported to aarch64
Remove Requires: glibc-static from %package testsuite
* Tue Oct 27 2020 Jeff Law <law@redhat.com> - 10.2.0-2
- Fix C++17 issue caught by gcc-11
* Fri Nov 15 2019 Stan Cox <scox@redhat.com> - 10.1.0-3
* Tue Sep 01 2020 Stan Cox <scox@redhat.com> - 10.2.0-1
- Update to 10.2.0
* Mon Aug 10 2020 Orion Poplawski <orion@nwra.com> - 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 <releng@fedoraproject.org> - 10.1.0-9
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 15 2020 Stan Cox <scox@redhat.com> - 10.1.0-7
- Do not build static versions of the dyninst libraries.
* Fri May 29 2020 Jonathan Wakely <jwakely@redhat.com> - 10.1.0-6
- Rebuilt for Boost 1.73
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Nov 15 2019 Stan Cox <scox@redhat.com> - 10.1.0-4
- Fix rhbz963475 dyninst must be ported to aarch64
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 10.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jun 04 2019 Stan Cox <scox@redhat.com> - 10.1.0-2
- Use PRIx64 to fix i386 build
* Wed May 29 2019 Stan Cox <scox@redhat.com> - 10.1.0-1
- Update to 10.1.0
* Wed May 16 2018 Frank Ch. Eigler <fche@redhat.com> - 9.3.2-12
- Rebuild with newer boost.
* Mon Feb 4 2019 William Cohen <wcohen@redhat.com> - 10.0.0-7
- Fix FTBFS due to move to boost 1.69 and tribool changes.
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 10.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 23 2019 Björn Esser <besser82@fedoraproject.org> - 10.0.0-5
- Append curdir to CMake invokation. (#1668512)
* Wed Dec 05 2018 Stan Cox <scox@redhat.com> - 10.0.0-4
- Use PRIx64
* Wed Dec 05 2018 Stan Cox <scox@redhat.com> - 10.0.0-3
- Patch Result.h for i386.
* Mon Dec 03 2018 Frank Ch. Eigler <fche@redhat.com> - 10.0.0-2
- Add tbb-devel Requires:
- Add ppc64le into ExclusiveArch:
* Tue Nov 13 2018 Stan Cox <scox@redhat.com> - 10.0.0-1
- Update to 10.0.0
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 9.3.2-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Mar 07 2018 Adam Williamson <awilliam@redhat.com> - 9.3.2-11
- Rebuild to fix GCC 8 mis-compilation

55
github-pr1721.patch Normal file
View File

@ -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 <kupsch@cs.wisc.edu>
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 "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/h>")
-install(TARGETS parseThat RUNTIME DESTINATION bin)
+install(TARGETS parseThat RUNTIME DESTINATION "${DYNINST_INSTALL_BINDIR}")

151
github-pr1730.patch Normal file
View File

@ -0,0 +1,151 @@
commit eae798d4e5f938cb85758571dbab9afbbea7b5d2 (HEAD -> v13.0.0)
Author: Frank Ch. Eigler <fche@redhat.com>
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 <thaines.astro@gmail.com>
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 <unordered_map>
namespace {
- std::unordered_map<signed int, std::string> names;
const std::string invalid_reg_name{"<INVALID_REG>"};
}
+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<unsigned int>(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 <unordered_map>
+#include <map>
+#include <vector>
+#include <string>
+
+namespace Dyninst { namespace registers {
+ typedef std::unordered_map<signed int, std::string> name_cache;
+}}
+
+
+#endif

36
github-pr1880-ish.patch Normal file
View File

@ -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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <cstdint>
#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 <map>
#include <vector>
#include <string>
+#include <cstdint>
#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 <set>
#include <map>
#include <vector>
+#include <cstdint>
#include "entryIDs.h"
#include "registers/MachRegister.h"
#include "common/src/ia32_locations.h"

23
github-pr1880.patch Normal file
View File

@ -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 <fche@elastic.org>
Date: Wed Jan 22 15:35:55 2025 -0500
Update sha1.C: #include <cstdint>
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 <stdio.h>
#include <string.h>
+#include <cstdint>
#include "dyntypes.h"
#include "common/src/sha1.h"

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (dyninst-13.0.0.tar.gz) = efa09018c411f6138e6e2cf6510007b29b00ed9e0d643df702303ee0ccb39b1ea1640bba18555f4cb0a7dbab677362c88ffe0eccace62b57860daee9350a4eee