-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdwarves.spec
301 lines (263 loc) · 10.9 KB
/
dwarves.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#
# This file is auto-generated. DO NOT EDIT
# Generated by: autospec.py
# Using build pattern: cmake
# autospec version: v21
# autospec commit: 5424026
#
Name : dwarves
Version : 1.28
Release : 18
URL : https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-1.28.tar.gz
Source0 : https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-1.28.tar.gz
Source1 : https://github.com/libbpf/libbpf/archive/v1.0.0/libbpf-1.0.0.tar.gz
Summary : Debugging Information Manipulation Tools (pahole & friends)
Group : Development/Tools
License : BSD-2-Clause GPL-2.0 GPL-2.0-only LGPL-2.1
Requires: dwarves-bin = %{version}-%{release}
Requires: dwarves-data = %{version}-%{release}
Requires: dwarves-lib = %{version}-%{release}
Requires: dwarves-license = %{version}-%{release}
Requires: dwarves-man = %{version}-%{release}
BuildRequires : buildreq-cmake
BuildRequires : git
BuildRequires : pkg-config
BuildRequires : pkgconfig(libbpf)
BuildRequires : pkgconfig(libdw)
BuildRequires : python3-dev
BuildRequires : zlib-dev
# Suppress stripping binaries
%define __strip /bin/true
%define debug_package %{nil}
%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 bin
Summary: bin components for the dwarves package.
Group: Binaries
Requires: dwarves-data = %{version}-%{release}
Requires: dwarves-license = %{version}-%{release}
%description bin
bin components for the dwarves package.
%package data
Summary: data components for the dwarves package.
Group: Data
%description data
data components for the dwarves package.
%package dev
Summary: dev components for the dwarves package.
Group: Development
Requires: dwarves-lib = %{version}-%{release}
Requires: dwarves-bin = %{version}-%{release}
Requires: dwarves-data = %{version}-%{release}
Provides: dwarves-devel = %{version}-%{release}
Requires: dwarves = %{version}-%{release}
%description dev
dev components for the dwarves package.
%package lib
Summary: lib components for the dwarves package.
Group: Libraries
Requires: dwarves-data = %{version}-%{release}
Requires: dwarves-license = %{version}-%{release}
%description lib
lib components for the dwarves package.
%package license
Summary: license components for the dwarves package.
Group: Default
%description license
license components for the dwarves package.
%package man
Summary: man components for the dwarves package.
Group: Default
%description man
man components for the dwarves package.
%prep
%setup -q -n pahole-1.28
cd %{_builddir}
tar xf %{_sourcedir}/libbpf-1.0.0.tar.gz
cd %{_builddir}/pahole-1.28
mkdir -p lib/bpf
cp -r %{_builddir}/libbpf-1.0.0/* %{_builddir}/pahole-1.28/lib/bpf
pushd ..
cp -a pahole-1.28 buildavx2
popd
%build
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
export no_proxy=localhost,127.0.0.1,0.0.0.0
export LANG=C.UTF-8
export SOURCE_DATE_EPOCH=1733831244
mkdir -p clr-build
pushd clr-build
export GCC_IGNORE_WERROR=1
export AR=gcc-ar
export RANLIB=gcc-ranlib
export NM=gcc-nm
CLEAR_INTERMEDIATE_CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_FCFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS"
CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS"
FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS"
FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS"
ASFLAGS="$CLEAR_INTERMEDIATE_ASFLAGS"
LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS"
export GOAMD64=v2
%cmake .. -D__LIB=lib -G 'Unix Makefiles'
make %{?_smp_mflags}
popd
pushd ../buildavx2/
mkdir -p clr-build-avx2
pushd clr-build-avx2
export GCC_IGNORE_WERROR=1
export AR=gcc-ar
export RANLIB=gcc-ranlib
export NM=gcc-nm
CLEAR_INTERMEDIATE_CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_FCFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS"
CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS"
FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS"
FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS"
ASFLAGS="$CLEAR_INTERMEDIATE_ASFLAGS"
LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS"
GOAMD64=v3
CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -march=x86-64-v3 -Wl,-z,x86-64-v3 "
CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -march=x86-64-v3 -Wl,-z,x86-64-v3 "
FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -march=x86-64-v3 -Wl,-z,x86-64-v3 "
FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -march=x86-64-v3 "
%cmake .. -D__LIB=lib -G 'Unix Makefiles'
make %{?_smp_mflags}
popd
popd
%install
export GCC_IGNORE_WERROR=1
export AR=gcc-ar
export RANLIB=gcc-ranlib
export NM=gcc-nm
CLEAR_INTERMEDIATE_CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_FCFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CLEAR_INTERMEDIATE_CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -O3 -fdebug-types-section -femit-struct-debug-baseonly -ffat-lto-objects -flto=auto -g1 -gno-column-info -gno-variable-location-views -gz=zstd "
CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS"
CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS"
FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS"
FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS"
ASFLAGS="$CLEAR_INTERMEDIATE_ASFLAGS"
LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS"
export SOURCE_DATE_EPOCH=1733831244
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/share/package-licenses/dwarves
cp %{_builddir}/libbpf-1.0.0/LICENSE.BSD-2-Clause %{buildroot}/usr/share/package-licenses/dwarves/419ec3c0b11c7d22472ea99c03c347413a4ea406 || :
cp %{_builddir}/libbpf-1.0.0/LICENSE.LGPL-2.1 %{buildroot}/usr/share/package-licenses/dwarves/91c66db733cf0ff2b3216ec4223b940daf6b26d4 || :
cp %{_builddir}/pahole-%{version}/COPYING %{buildroot}/usr/share/package-licenses/dwarves/06877624ea5c77efe3b7e39b0f909eda6e25a4ec || :
export GOAMD64=v2
pushd ../buildavx2/
GOAMD64=v3
pushd clr-build-avx2
%make_install_v3 || :
popd
popd
GOAMD64=v2
pushd clr-build
%make_install
popd
/usr/bin/elf-move.py avx2 %{buildroot}-v3 %{buildroot} %{buildroot}/usr/share/clear/filemap/filemap-%{name}
%files
%defattr(-,root,root,-)
%files bin
%defattr(-,root,root,-)
/V3/usr/bin/codiff
/V3/usr/bin/ctracer
/V3/usr/bin/dtagnames
/V3/usr/bin/pahole
/V3/usr/bin/pdwtags
/V3/usr/bin/pfunct
/V3/usr/bin/pglobal
/V3/usr/bin/prefcnt
/V3/usr/bin/scncopy
/V3/usr/bin/syscse
/usr/bin/btfdiff
/usr/bin/codiff
/usr/bin/ctracer
/usr/bin/dtagnames
/usr/bin/fullcircle
/usr/bin/ostra-cg
/usr/bin/pahole
/usr/bin/pdwtags
/usr/bin/pfunct
/usr/bin/pglobal
/usr/bin/prefcnt
/usr/bin/scncopy
/usr/bin/syscse
%files data
%defattr(-,root,root,-)
/usr/share/dwarves/runtime/Makefile
/usr/share/dwarves/runtime/ctracer_relay.c
/usr/share/dwarves/runtime/ctracer_relay.h
/usr/share/dwarves/runtime/linux.blacklist.cu
/usr/share/dwarves/runtime/python/ostra.py
%files dev
%defattr(-,root,root,-)
/usr/include/dwarves/btf_encoder.h
/usr/include/dwarves/config.h
/usr/include/dwarves/ctf.h
/usr/include/dwarves/dutil.h
/usr/include/dwarves/dwarves.h
/usr/include/dwarves/dwarves_emit.h
/usr/include/dwarves/dwarves_reorganize.h
/usr/include/dwarves/elf_symtab.h
/usr/include/dwarves/elfcreator.h
/usr/include/dwarves/gobuffer.h
/usr/include/dwarves/hash.h
/usr/include/dwarves/libctf.h
/usr/include/dwarves/list.h
/usr/include/dwarves/rbtree.h
/usr/lib64/libdwarves.so
/usr/lib64/libdwarves_emit.so
/usr/lib64/libdwarves_reorganize.so
%files lib
%defattr(-,root,root,-)
/V3/usr/lib64/libdwarves.so.1.0.0
/V3/usr/lib64/libdwarves_emit.so.1.0.0
/V3/usr/lib64/libdwarves_reorganize.so.1.0.0
/usr/lib64/libdwarves.so.1
/usr/lib64/libdwarves.so.1.0.0
/usr/lib64/libdwarves_emit.so.1
/usr/lib64/libdwarves_emit.so.1.0.0
/usr/lib64/libdwarves_reorganize.so.1
/usr/lib64/libdwarves_reorganize.so.1.0.0
%files license
%defattr(0644,root,root,0755)
/usr/share/package-licenses/dwarves/06877624ea5c77efe3b7e39b0f909eda6e25a4ec
/usr/share/package-licenses/dwarves/419ec3c0b11c7d22472ea99c03c347413a4ea406
/usr/share/package-licenses/dwarves/91c66db733cf0ff2b3216ec4223b940daf6b26d4
%files man
%defattr(0644,root,root,0755)
/usr/share/man/man1/pahole.1