diff --git a/dwarves-1.24.tar.gz b/dwarves-1.24.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..623c30f71a347422aed54be10fda0c2cd9976563 Binary files /dev/null and b/dwarves-1.24.tar.gz differ diff --git a/dwarves.spec b/dwarves.spec new file mode 100644 index 0000000000000000000000000000000000000000..2f0f45529c3fab8be322796bad7d7fb6c1c7c03e --- /dev/null +++ b/dwarves.spec @@ -0,0 +1,157 @@ +%define anolis_release 1 +%define libname libdwarves +%define libver 1 + +Name: dwarves +Version: 1.24 +Release: %{anolis_release}%{?dist} +License: GPLv2 +Summary: Debugging Information Manipulation Tools (pahole & friends) +URL: https://github.com/acmel/dwarves +Source0: https://github.com/acmel/dwarves/archive/refs/tags/%{name}-%{version}.tar.gz +# submodule for dwarves, when update dwarves should update libbpf +# git clone git@github.com:acmel/dwarves.git +# git checkout v%%{version} +# git submodule init +# git submodule update +# cd lib/bpf +# git archive --format=tar.gz --output libbpf-git645500d.tar.gz 645500d +Source1: libbpf-git645500d.tar.gz +Requires: %{libname} = %{version}-%{release} +BuildRequires: gcc +BuildRequires: cmake >= 2.8.12 +BuildRequires: zlib-devel +BuildRequires: elfutils-devel >= 0.130 + +%description +dwarves is a set of tools that use the debugging information inserted in +ELF binaries by compilers such as GCC, used by well known debuggers such as +GDB, and more recent ones such as systemtap. + +Utilities in the dwarves suite include pahole, that can be used to find +alignment holes in structs and classes in languages such as C, C++, but not +limited to these. + +It also extracts other information such as CPU cacheline alignment, helping +pack those structures to achieve more cache hits. + +These tools can also be used to encode and read the BTF type information format +used with the Linux kernel bpf syscall, using 'pahole -J' and 'pahole -F btf'. + +A diff like tool, codiff can be used to compare the effects changes in source +code generate on the resulting binaries. + +Another tool is pfunct, that can be used to find all sorts of information about +functions, inlines, decisions made by the compiler about inlining, etc. + +One example of pfunct usage is in the fullcircle tool, a shell that drivers +pfunct to generate compileable code out of a .o file and then build it using +gcc, with the same compiler flags, and then use codiff to make sure the +original .o file and the new one generated from debug info produces the same +debug info. + +Pahole also can be used to use all this type information to pretty print raw data +according to command line directions. + +Headers can have its data format described from debugging info and offsets from +it can be used to further format a number of records. + +The btfdiff utility compares the output of pahole from BTF and DWARF to make +sure they produce the same results. + +%package -n %{libname} +Summary: Debugging information processing library +Provides: %{libname}%{libver} = %{version}-%{release} + +%description -n %{libname} +Debugging information processing library. + +%package -n %{libname}-devel +Summary: Debugging information library development files +Requires: %{libname} = %{version}-%{release} +Provides: %{libname}%{libver}-devel = %{version}-%{release} + +%description -n %{libname}-devel +Debugging information processing library development files. + +%package doc +Summary: Doc files for dwarves +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Doc files for dwarves + +%prep +%setup -q +tar xf %{SOURCE1} -C lib/bpf + +%build +%cmake -DCMAKE_BUILD_TYPE=Release . +%cmake_build + +%install +rm -Rf %{buildroot} +%cmake_install + +%ldconfig_scriptlets -n %{libname} + +%files +%{_bindir}/btfdiff +%{_bindir}/codiff +%{_bindir}/ctracer +%{_bindir}/dtagnames +%{_bindir}/fullcircle +%{_bindir}/pahole +%{_bindir}/pdwtags +%{_bindir}/pfunct +%{_bindir}/pglobal +%{_bindir}/prefcnt +%{_bindir}/scncopy +%{_bindir}/syscse +%{_bindir}/ostra-cg +%dir %{_datadir}/dwarves/ +%dir %{_datadir}/dwarves/runtime/ +%dir %{_datadir}/dwarves/runtime/python/ +%defattr(0644,root,root,0755) +%{_mandir}/man1/pahole.1* +%{_datadir}/dwarves/runtime/Makefile +%{_datadir}/dwarves/runtime/linux.blacklist.cu +%{_datadir}/dwarves/runtime/ctracer_relay.c +%{_datadir}/dwarves/runtime/ctracer_relay.h +%attr(0755,root,root) %{_datadir}/dwarves/runtime/python/ostra.py* + +%files -n %{libname} +%{_libdir}/%{libname}.so.* +%{_libdir}/%{libname}_emit.so.* +%{_libdir}/%{libname}_reorganize.so.* + +%files -n %{libname}-devel +%doc MANIFEST README +%{_includedir}/dwarves/btf_encoder.h +%{_includedir}/dwarves/config.h +%{_includedir}/dwarves/ctf.h +%{_includedir}/dwarves/dutil.h +%{_includedir}/dwarves/dwarves.h +%{_includedir}/dwarves/dwarves_emit.h +%{_includedir}/dwarves/dwarves_reorganize.h +%{_includedir}/dwarves/elfcreator.h +%{_includedir}/dwarves/elf_symtab.h +%{_includedir}/dwarves/gobuffer.h +%{_includedir}/dwarves/hash.h +%{_includedir}/dwarves/libctf.h +%{_includedir}/dwarves/list.h +%{_includedir}/dwarves/rbtree.h +%{_libdir}/%{libname}.so +%{_libdir}/%{libname}_emit.so +%{_libdir}/%{libname}_reorganize.so + +%files doc +%doc README.ctracer +%doc README.btf +%doc changes-v1.24 +%doc NEWS + +%changelog +* Mon Sep 19 2022 Chunmei Xu - 1.24-1 +- init from upstream diff --git a/libbpf-git645500d.tar.gz b/libbpf-git645500d.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..90143486372949bc07bb1c82d82d003a4275c7a0 Binary files /dev/null and b/libbpf-git645500d.tar.gz differ