|
|
076a09 |
# For RHEL8 we need this before using any scl macro.
|
|
|
076a09 |
%global __python /usr/bin/python3
|
|
|
076a09 |
|
|
|
076a09 |
%{?scl:%scl_package dyninst}
|
|
|
076a09 |
|
|
|
076a09 |
Summary: An API for Run-time Code Generation
|
|
|
076a09 |
License: LGPLv2+
|
|
|
076a09 |
Name: %{?scl_prefix}dyninst
|
|
|
076a09 |
Group: Development/Libraries
|
|
|
076a09 |
Release: 2%{?dist}
|
|
|
076a09 |
URL: http://www.dyninst.org
|
|
|
076a09 |
Version: 11.0.0
|
|
|
076a09 |
Exclusiveos: linux
|
|
|
076a09 |
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
|
|
|
076a09 |
|
|
|
076a09 |
Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz
|
|
|
076a09 |
Source1: https://github.com/dyninst/testsuite/archive/%{version}/testsuite-%{version}.tar.gz
|
|
|
076a09 |
|
|
|
076a09 |
Patch1: testsuite-11.0.0-test12.patch
|
|
|
076a09 |
Patch2: testsuite-11.0.0-386.patch
|
|
|
076a09 |
Patch3: dyninst-11.0.0-dwarf.patch
|
|
|
076a09 |
Patch4: dyninst-11.0.0-tbb.patch
|
|
|
076a09 |
Patch5: dyninst-11.0.0-nullbuf.patch
|
|
|
076a09 |
|
|
|
076a09 |
%global dyninst_base dyninst-%{version}
|
|
|
076a09 |
%global testsuite_base testsuite-%{version}
|
|
|
076a09 |
|
|
|
076a09 |
BuildRequires: zlib-devel
|
|
|
076a09 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
076a09 |
BuildRequires: elfutils-devel
|
|
|
076a09 |
BuildRequires: elfutils-libelf-devel
|
|
|
076a09 |
BuildRequires: elfutils-debuginfod-client-devel
|
|
|
076a09 |
BuildRequires: boost-devel
|
|
|
076a09 |
BuildRequires: binutils-devel
|
|
|
076a09 |
BuildRequires: cmake
|
|
|
076a09 |
BuildRequires: libtirpc-devel
|
|
|
076a09 |
BuildRequires: tbb tbb-devel
|
|
|
076a09 |
|
|
|
076a09 |
%{?scl:Requires: %scl_runtime}
|
|
|
076a09 |
|
|
|
076a09 |
# Extra requires just for the testsuite
|
|
|
076a09 |
# NB, there's no separate libstdc++-static for <=el6
|
|
|
076a09 |
%if 0%{?rhel} >= 7
|
|
|
076a09 |
BuildRequires: libstdc++-static
|
|
|
076a09 |
%endif
|
|
|
076a09 |
BuildRequires: gcc-gfortran glibc-static libxml2-devel
|
|
|
076a09 |
%if 0%{?rhel} == 6
|
|
|
076a09 |
# C++11 requires devtoolset gcc.
|
|
|
076a09 |
BuildRequires: %{?scl_prefix}gcc-c++
|
|
|
076a09 |
%endif
|
|
|
076a09 |
|
|
|
076a09 |
# Testsuite files should not provide/require anything
|
|
|
076a09 |
%{?filter_setup:
|
|
|
076a09 |
%filter_provides_in %{_libdir}/dyninst/testsuite/
|
|
|
076a09 |
%filter_requires_in %{_libdir}/dyninst/testsuite/
|
|
|
076a09 |
%filter_setup
|
|
|
076a09 |
}
|
|
|
076a09 |
|
|
|
076a09 |
%description
|
|
|
076a09 |
|
|
|
076a09 |
Dyninst is an Application Program Interface (API) to permit the insertion of
|
|
|
076a09 |
code into a running program. The API also permits changing or removing
|
|
|
076a09 |
subroutine calls from the application program. Run-time code changes are
|
|
|
076a09 |
useful to support a variety of applications including debugging, performance
|
|
|
076a09 |
monitoring, and to support composing applications out of existing packages.
|
|
|
076a09 |
The goal of this API is to provide a machine independent interface to permit
|
|
|
076a09 |
the creation of tools and applications that use run-time code patching.
|
|
|
076a09 |
|
|
|
076a09 |
%package doc
|
|
|
076a09 |
Summary: Documentation for using the Dyninst API
|
|
|
076a09 |
Group: Documentation
|
|
|
076a09 |
%description doc
|
|
|
076a09 |
dyninst-doc contains API documentation for the Dyninst libraries.
|
|
|
076a09 |
|
|
|
076a09 |
%package devel
|
|
|
076a09 |
Summary: Header files for compiling programs with Dyninst
|
|
|
076a09 |
Group: Development/System
|
|
|
076a09 |
Requires: %{?scl_prefix}dyninst = %{version}-%{release}
|
|
|
076a09 |
Requires: boost-devel
|
|
|
076a09 |
Requires: tbb-devel
|
|
|
076a09 |
|
|
|
076a09 |
%description devel
|
|
|
076a09 |
dyninst-devel includes the C header files that specify the Dyninst user-space
|
|
|
076a09 |
libraries and interfaces. This is required for rebuilding any program
|
|
|
076a09 |
that uses Dyninst.
|
|
|
076a09 |
|
|
|
076a09 |
%package static
|
|
|
076a09 |
Summary: Static libraries for the compiling programs with Dyninst
|
|
|
076a09 |
Group: Development/System
|
|
|
076a09 |
Requires: %{?scl_prefix}dyninst-devel = %{version}-%{release}
|
|
|
076a09 |
%description static
|
|
|
076a09 |
dyninst-static includes the static versions of the library files for
|
|
|
076a09 |
the dyninst user-space libraries and interfaces.
|
|
|
076a09 |
|
|
|
076a09 |
%package testsuite
|
|
|
076a09 |
Summary: Programs for testing Dyninst
|
|
|
076a09 |
Group: Development/System
|
|
|
076a09 |
Requires: %{?scl_prefix}dyninst = %{version}-%{release}
|
|
|
076a09 |
Requires: %{?scl_prefix}dyninst-devel = %{version}-%{release}
|
|
|
076a09 |
Requires: %{?scl_prefix}dyninst-static = %{version}-%{release}
|
|
|
076a09 |
Requires: glibc-static
|
|
|
076a09 |
%description testsuite
|
|
|
076a09 |
dyninst-testsuite includes the test harness and target programs for
|
|
|
076a09 |
making sure that dyninst works properly.
|
|
|
076a09 |
|
|
|
076a09 |
%prep
|
|
|
076a09 |
%setup -q -n %{name}-%{version} -c
|
|
|
076a09 |
%setup -q -T -D -a 1
|
|
|
076a09 |
|
|
|
076a09 |
%patch1 -p1 -b .test12
|
|
|
076a09 |
%patch2 -p1 -b .386
|
|
|
076a09 |
%patch3 -p1 -b .dwarf
|
|
|
076a09 |
%patch4 -p1 -b .tbb
|
|
|
076a09 |
pushd %{dyninst_base}
|
|
|
076a09 |
%patch5 -p1 -b .null
|
|
|
076a09 |
popd
|
|
|
076a09 |
|
|
|
076a09 |
# cotire seems to cause non-deterministic gcc errors
|
|
|
076a09 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1420551
|
|
|
076a09 |
sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \
|
|
|
076a09 |
%{dyninst_base}/cmake/shared.cmake
|
|
|
076a09 |
|
|
|
076a09 |
%build
|
|
|
076a09 |
|
|
|
076a09 |
cd %{dyninst_base}
|
|
|
076a09 |
|
|
|
076a09 |
%if 0%{?rhel} == 6
|
|
|
076a09 |
# C++11 requires devtoolset gcc.
|
|
|
076a09 |
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
|
|
|
076a09 |
%endif
|
|
|
076a09 |
|
|
|
076a09 |
CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
|
|
|
076a09 |
LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
|
|
|
076a09 |
%ifarch %{ix86}
|
|
|
076a09 |
CFLAGS="$CFLAGS -fno-lto -march=i686"
|
|
|
076a09 |
LDFLAGS="$LDFLAGS -fno-lto"
|
|
|
076a09 |
%endif
|
|
|
076a09 |
CXXFLAGS="$CFLAGS"
|
|
|
076a09 |
export CFLAGS CXXFLAGS LDFLAGS
|
|
|
076a09 |
|
|
|
076a09 |
%cmake \
|
|
|
076a09 |
-DENABLE_STATIC_LIBS=1 \
|
|
|
076a09 |
-DENABLE_DEBUGINFOD=1 \
|
|
|
076a09 |
-DINSTALL_LIB_DIR:PATH=%{_libdir}/dyninst \
|
|
|
076a09 |
-DINSTALL_INCLUDE_DIR:PATH=%{_includedir}/dyninst \
|
|
|
076a09 |
-DINSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Dyninst \
|
|
|
076a09 |
-DBoost_NO_BOOST_CMAKE=ON \
|
|
|
076a09 |
-DCMAKE_BUILD_TYPE:STRING=None \
|
|
|
076a09 |
-DCMAKE_SKIP_RPATH:BOOL=YES \
|
|
|
076a09 |
.
|
|
|
076a09 |
%cmake_build
|
|
|
076a09 |
|
|
|
076a09 |
# Hack to install dyninst nearby, so the testsuite can use it
|
|
|
076a09 |
DESTDIR="../install" %__cmake --install "%{__cmake_builddir}"
|
|
|
076a09 |
find ../install -name '*.cmake' -execdir \
|
|
|
076a09 |
sed -i -e "s!%{_prefix}!$PWD/../install&!" '{}' '+'
|
|
|
076a09 |
# cmake mistakenly looks for libtbb.so in the dyninst install dir
|
|
|
076a09 |
sed -i '/libtbb.so/ s/".*usr/"\/usr/' $PWD/../install%{_libdir}/cmake/Dyninst/commonTargets.cmake
|
|
|
076a09 |
|
|
|
076a09 |
cd ../%{testsuite_base}
|
|
|
076a09 |
%cmake \
|
|
|
076a09 |
-DDyninst_DIR:PATH=$PWD/../install%{_libdir}/cmake/Dyninst \
|
|
|
076a09 |
-DINSTALL_DIR:PATH=%{_libdir}/dyninst/testsuite \
|
|
|
076a09 |
-DCMAKE_BUILD_TYPE:STRING=Debug \
|
|
|
076a09 |
-DBoost_NO_BOOST_CMAKE=ON \
|
|
|
076a09 |
-DCMAKE_SKIP_RPATH:BOOL=YES \
|
|
|
076a09 |
.
|
|
|
076a09 |
%cmake_build
|
|
|
076a09 |
|
|
|
076a09 |
%install
|
|
|
076a09 |
|
|
|
076a09 |
cd %{dyninst_base}
|
|
|
076a09 |
%cmake_install
|
|
|
076a09 |
|
|
|
076a09 |
# It doesn't install docs the way we want, so remove them.
|
|
|
076a09 |
# We'll just grab the pdfs later, directly from the build dir.
|
|
|
076a09 |
rm -v %{buildroot}%{_docdir}/*-%{version}.pdf
|
|
|
076a09 |
|
|
|
076a09 |
cd ../%{testsuite_base}
|
|
|
076a09 |
%make_install
|
|
|
076a09 |
|
|
|
076a09 |
# Ugly hack to mask testsuite files from debuginfo extraction. Running the
|
|
|
076a09 |
# testsuite requires debuginfo, so extraction is useless. However, debuginfo
|
|
|
076a09 |
# extraction is still nice for the main libraries, so we don't want to disable
|
|
|
076a09 |
# it package-wide. The permissions are restored by attr(755,-,-) in files.
|
|
|
076a09 |
find %{buildroot}%{_libdir}/dyninst/testsuite/ \
|
|
|
076a09 |
-type f '!' -name '*.a' -execdir chmod 644 '{}' '+'
|
|
|
076a09 |
|
|
|
076a09 |
%files
|
|
|
076a09 |
%defattr(-,root,root,-)
|
|
|
076a09 |
|
|
|
076a09 |
%dir %{_libdir}/dyninst
|
|
|
076a09 |
%{_libdir}/dyninst/*.so.*
|
|
|
076a09 |
# dyninst mutators dlopen the runtime library
|
|
|
076a09 |
%{_libdir}/dyninst/libdyninstAPI_RT.so
|
|
|
076a09 |
|
|
|
076a09 |
%doc %{dyninst_base}/COPYRIGHT
|
|
|
076a09 |
%doc %{dyninst_base}/LICENSE.md
|
|
|
076a09 |
|
|
|
076a09 |
%files doc
|
|
|
076a09 |
%defattr(-,root,root,-)
|
|
|
076a09 |
%doc %{dyninst_base}/dataflowAPI/doc/dataflowAPI.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/dynC_API/doc/dynC_API.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/dyninstAPI/doc/dyninstAPI.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/instructionAPI/doc/instructionAPI.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/parseAPI/doc/parseAPI.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/patchAPI/doc/patchAPI.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/proccontrol/doc/proccontrol.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/stackwalk/doc/stackwalk.pdf
|
|
|
076a09 |
%doc %{dyninst_base}/symtabAPI/doc/symtabAPI.pdf
|
|
|
076a09 |
|
|
|
076a09 |
%files devel
|
|
|
076a09 |
%defattr(-,root,root,-)
|
|
|
076a09 |
%{_includedir}/dyninst
|
|
|
076a09 |
%{_libdir}/dyninst/*.so
|
|
|
076a09 |
%{_libdir}/cmake/Dyninst
|
|
|
076a09 |
|
|
|
076a09 |
%files static
|
|
|
076a09 |
%defattr(-,root,root,-)
|
|
|
076a09 |
%{_libdir}/dyninst/*.a
|
|
|
076a09 |
|
|
|
076a09 |
%files testsuite
|
|
|
076a09 |
%defattr(-,root,root,-)
|
|
|
076a09 |
%{_bindir}/parseThat
|
|
|
076a09 |
%dir %{_libdir}/dyninst/testsuite/
|
|
|
076a09 |
%attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a]
|
|
|
076a09 |
%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a
|
|
|
076a09 |
|
|
|
076a09 |
%changelog
|
|
|
076a09 |
* Mon Aug 16 2021 Frank Ch. Eigler <fche@redhat.com> - 11.0.0-2
|
|
|
076a09 |
- rhbz1993317, nullbuf disassembly errors
|
|
|
076a09 |
|
|
|
076a09 |
* Wed May 19 2021 Stan Cox <scox@redhat.com> - 11.0.0
|
|
|
076a09 |
- Update to 11.0.0
|
|
|
076a09 |
|
|
|
076a09 |
* Fri Nov 06 2020 Stan Cox <scox@redhat.com> - 10.2.1-2
|
|
|
076a09 |
- Enable debuginfod
|
|
|
076a09 |
|
|
|
076a09 |
* Wed Oct 28 2020 Stan Cox <scox@redhat.com> - 10.2.1-1
|
|
|
076a09 |
- Update to 10.2.1
|
|
|
076a09 |
|
|
|
076a09 |
* Mon Jun 1 2020 Martin Cermak <mcermak@redhat.com> - 10.1.0-2
|
|
|
076a09 |
- NVR Bump and rebuild
|
|
|
076a09 |
|
|
|
076a09 |
* Sun Jun 9 2019 Stan Cox <scox@redhat.com> - 10.1.0-1
|
|
|
076a09 |
- Update to 10.1.0
|