source: projects/specs/trunk/v/valgrind/valgrind-vl.spec @ 11299

Revision 11299, 11.9 KB checked in by tomop, 6 years ago (diff)

valgrind-3.13.0-1

Line 
1# Only arches that are supported upstream as multilib and that the distro
2# has multilib builds for should set build_multilib 1. In practice that
3# is only x86_64 and ppc64 (but not in fedora 21 and later, and never
4# for ppc64le).
5%global build_multilib 0
6
7%ifarch x86_64 ppc64
8%global build_multilib 1
9%endif
10
11# Vine Linux doesn't have openmpi package
12#ifarch %{ix86} x86_64 ppc ppc64 ppc64le %{arm} aarch64
13#global build_openmpi 1
14#else
15%global build_openmpi 0
16#endif
17
18# Don't run dwz or generate minisymtab, valgrind doesn't handle compressed
19# DWARF very well and it might read its own vgpreload libraries. Generating
20# minisymtabs doesn't really work for the staticly linked tools.
21%define _find_debuginfo_dwz_opts %{nil}
22%undefine _include_minidebuginfo
23
24Name:           valgrind
25Version:        3.13.0
26Release:        1%{?_dist_release}
27Summary:        Tool for finding memory management bugs in programs
28Summary(ja):    プログラムのメモリ管理バグを発見するためのツール
29
30License:        GPLv2+
31Group:          Development/Debuggers
32URL:            http://valgrind.org/
33
34Source0:        http://valgrind.org/downloads/%{name}-%{version}.tar.bz2
35
36# Needs investigation and pushing upstream
37Patch1: valgrind-3.9.0-cachegrind-improvements.patch
38
39# KDE#211352 - helgrind races in helgrind's own mythread_wrapper
40Patch2: valgrind-3.9.0-helgrind-race-supp.patch
41
42# Make ld.so supressions slightly less specific.
43Patch3: valgrind-3.9.0-ldso-supp.patch
44
45# KDE#381272  ppc64 doesn't compile test_isa_2_06_partx.c without VSX support
46Patch4: valgrind-3.13.0-ppc64-check-no-vsx.patch
47
48# KDE#381289 epoll_pwait can have a NULL sigmask.
49Patch5: valgrind-3.13.0-epoll_pwait.patch
50
51# KDE#381274 powerpc too chatty even with --sigill-diagnostics=no
52Patch6: valgrind-3.13.0-ppc64-diag.patch
53
54# KDE#381556 arm64: Handle feature registers access on 4.11 Linux kernel
55# Workaround that masks CPUID support in HWCAP on aarch64 (#1464211)
56Patch7: valgrind-3.13.0-arm64-hwcap.patch
57
58# RHBZ#1466017 ARM ld.so index warnings.
59# KDE#381805 arm32 needs ld.so index hardwire for new glibc security fixes
60Patch8: valgrind-3.13.0-arm-index-hardwire.patch
61
62# KDE#381769 Use ucontext_t instead of struct ucontext
63Patch9: valgrind-3.13.0-ucontext_t.patch
64
65# valgrind svn r16453 Fix some tests failure with GDB 8.0
66Patch10: valgrind-3.13.0-gdb-8-testfix.patch
67
68# valgrind svn r16454. disable vgdb poll in the child after fork
69Patch11: valgrind-3.13.0-disable-vgdb-child.patch
70
71# KDE#382998 xml-socket doesn't work
72Patch12: valgrind-3.13.0-xml-socket.patch
73
74# KDE#385334
75# PPC64, vpermr, xxperm, xxpermr fix Iop_Perm8x16 selector field
76# PPC64, revert the change to vperm instruction.
77# KDE#385183
78# PPC64, Add support for xscmpeqdp, xscmpgtdp, xscmpgedp, xsmincdp instructions
79# PPC64, Fix bug in vperm instruction.
80# KDE#385210
81# PPC64, Re-implement the vpermr instruction using the Iop_Perm8x16.
82# KDE#385208
83# PPC64, Use the vperm code to implement the xxperm inst.
84# PPC64, Replace body of generate_store_FPRF with C helper function.
85# PPC64, Add support for the Data Stream Control Register (DSCR)
86Patch13: valgrind-3.13.0-ppc64-vex-fixes.patch
87
88# Fix eflags handling in amd64 instruction tests
89Patch14: valgrind-3.13.0-amd64-eflags-tests.patch
90
91# KDE#385868 ld.so _dl_runtime_resolve_avx_slow conditional jump warning
92Patch15: valgrind-3.13.0-suppress-dl-trampoline-sse-avx.patch
93
94# Implement static TLS code for more platforms
95Patch16: valgrind-3.13.0-static-tls.patch
96
97# KDE#386397 PPC64 valgrind truncates powerpc timebase to 32-bits.
98Patch17: valgrind-3.13.0-ppc64-timebase.patch
99
100# KDE#387773 - Files in .gnu_debugaltlink should be resolved relative to .debug
101Patch18: valgrind-3.13.0-debug-alt-file.patch
102
103# KDE#387712 s390x cgijnl reports Conditional jump depends on uninit value
104Patch19: valgrind-3.13.0-s390-cgijnl.patch
105
106Buildroot:      %{_tmppath}/%{name}-%{version}-root
107%if %{build_multilib}
108# Ensure glibc{,-devel} is installed for both multilib arches
109BuildRequires:  compat32-glibc-devel
110%endif
111BuildRequires:  glibc-devel >= 2.14
112%if %{build_openmpi}
113BuildRequires: openmpi-devel >= 1.3.3
114%endif
115
116# For %%build and %%check.
117# In case of a software collection, pick the matching gdb and binutils.
118BuildRequires:  gdb
119BuildRequires:  binutils
120
121# gdbserver_tests/filter_make_empty uses ps in test
122BuildRequires:  procps
123
124ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
125%ifarch %{ix86}
126%define valarch x86
127%define valsecarch %{nil}
128%endif
129%ifarch x86_64
130%define valarch amd64
131%define valsecarch x86
132%endif
133%ifarch ppc
134%define valarch ppc32
135%define valsecarch %{nil}
136%endif
137%ifarch ppc64
138  %define valarch ppc64be
139  %if %{build_multilib}
140    %define valsecarch ppc32
141  %else
142    %define valsecarch %{nil}
143  %endif
144%endif
145%ifarch ppc64le
146%define valarch ppc64le
147%define valsecarch %{nil}
148%endif
149%ifarch s390x
150%define valarch s390x
151%define valsecarch %{nil}
152%endif
153%ifarch armv7hl
154%define valarch arm
155%define valsecarch %{nil}
156%endif
157%ifarch aarch64
158%define valarch arm64
159%define valsecarch %{nil}
160%endif
161
162# Don't run dwz or generate minisymtab, valgrind doesn't handle compressed
163# DWARF very well and it might read its own vgpreload libraries. Generating
164# minisymtabs doesn't really work for the staticly linked tools.
165%define _find_debuginfo_dwz_opts %{nil}
166%undefine _include_minidebuginfo
167
168
169%description
170Valgrind is a tool to help you find memory-management problems in your
171programs. When a program is run under Valgrind's supervision, all
172reads and writes of memory are checked, and calls to
173malloc/new/free/delete are intercepted. As a result, Valgrind can
174detect a lot of problems that are otherwise very hard to
175find/diagnose.
176
177%package devel
178Summary:        Development files for valgrind
179Summary(ja):    Valgrind の開発用ファイル
180Group:          Development/Libraries
181Requires:       %{name} = %{version}-%{release}
182Provides:       %{name}-static = %{version}-%{release}
183
184%description devel
185Header files and libraries for development of valgrind aware programs
186or valgrind plugins.
187
188%package openmpi
189Summary:        OpenMPI support for valgrind
190Summary(ja):    Valgrind の OpenMPI サポート
191Group:          Development/Debuggers
192Requires:       %{name} = %{version}-%{release}
193
194%description openmpi
195A wrapper library for debugging OpenMPI parallel programs with valgrind.
196See the section on Debugging MPI Parallel Programs with Valgrind in the
197Valgrind User Manual for details.
198
199
200%prep
201%setup -q -n %{name}-%{version}
202%patch1 -p1
203%patch2 -p1
204%patch3 -p1
205%patch4 -p1
206%patch5 -p1
207%patch6 -p1
208%patch7 -p1
209%patch8 -p1
210%patch9 -p1
211%patch10 -p1
212%patch11 -p1
213%patch12 -p1
214%patch13 -p1
215%patch14 -p1
216%patch15 -p1
217%patch16 -p1
218%patch17 -p1
219%patch18 -p1
220%patch19 -p1
221
222%build
223CC=gcc
224%if %{build_multilib}
225# Ugly hack - libgcc 32-bit package might not be installed
226mkdir -p shared/libgcc/32
227ar r shared/libgcc/32/libgcc_s.a
228ar r shared/libgcc/libgcc_s_32.a
229CC="gcc -B `pwd`/shared/libgcc/"
230%endif
231
232%define mpiccpath %{_libdir}/openmpi/*/bin/mpicc
233
234# Filter out some flags that cause lots of valgrind test failures.
235# Also filter away -O2, valgrind adds it wherever suitable, but
236# not for tests which should be -O0, as they aren't meant to be
237# compiled with -O2 unless explicitely requested. Same for any -mcpu flag.
238# Ideally we will change this to only be done for the non-primary build
239# and the test suite.
240OPTFLAGS="`echo " %{optflags} " | sed 's/ -m\(64\|3[21]\) / /g;s/ -fexceptions / /g;s/ -fstack-protector / / g;s/ -Wp,-D_FORTIFY_SOURCE=2 / /g;s/ -O2 / /g;s/ -mcpu=\([a-z0-9]\+\) / /g;s/^ //;s/ $//'`"
241%configure CC="$CC" CFLAGS="$OPTFLAGS" CXXFLAGS="$OPTFLAGS" \
242%if %{build_openmpi}
243    --with-mpicc=%{mpiccpath} \
244%endif
245    GDB=%{_bindir}/gdb
246
247make %{?_smp_mflags}
248
249# Ensure there are no unexpected file descriptors open,
250# the testsuite otherwise fails.
251cat > close_fds.c <<EOF
252#include <stdlib.h>
253#include <unistd.h>
254int main (int argc, char *const argv[])
255{
256  int i, j = sysconf (_SC_OPEN_MAX);
257  if (j < 0)
258    exit (1);
259  for (i = 3; i < j; ++i)
260    close (i);
261  execvp (argv[1], argv + 1);
262  exit (1);
263}
264EOF
265gcc $RPM_OPT_FLAGS -o close_fds close_fds.c
266
267%install
268rm -rf $RPM_BUILD_ROOT
269make install DESTDIR=$RPM_BUILD_ROOT
270
271rm -rf docs.installed
272mkdir docs.installed
273mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/* docs.installed/
274rm -f docs.installed/*.ps
275
276%if "%{valsecarch}" != ""
277pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/
278rm -f *-%{valsecarch}-* || :
279for i in *-%{valarch}-*; do
280    j=`echo $i | sed 's/-%{valarch}-/-%{valsecarch}-/'`
281    ln -sf ../../lib/valgrind/$j $j
282done
283popd
284%endif
285
286# remove unuse files
287rm -f $RPM_BUILD_ROOT%{_libdir}/valgrind/*.supp.in
288
289
290%ifarch %{ix86} x86_64
291# To avoid multilib clashes in between i?86 and x86_64,
292# tweak installed <valgrind/config.h> a little bit.
293for i in HAVE_PTHREAD_CREATE_GLIBC_2_0 HAVE_PTRACE_GETREGS ; do
294  sed -i -e 's,^\(#define '$i' 1\|/\* #undef '$i' \*/\)$,#ifdef __x86_64__\n# define '$i' 1\n#endif,' \
295      $RPM_BUILD_ROOT%{_includedir}/valgrind/config.h
296done
297%endif
298
299
300%check
301# Make sure a basic binary runs.
302./vg-in-place /bin/true
303
304# Make sure no extra CFLAGS leak through, the testsuite sets all flags
305# necessary. See also configure above.
306make %{?_smp_mflags} CFLAGS="" check || :
307
308echo ===============TESTING===================
309./close_fds make regtest || :
310
311# Make sure test failures show up in build.log
312# Gather up the diffs (at most the first 20 lines for each one)
313MAX_LINES=20
314diff_files=`find . -name '*.diff' | sort`
315if [ z"$diff_files" = z ] ; then
316   echo "Congratulations, all tests passed!" >> diffs
317else
318   for i in $diff_files ; do
319      echo "=================================================" >> diffs
320      echo $i                                                  >> diffs
321      echo "=================================================" >> diffs
322      if [ `wc -l < $i` -le $MAX_LINES ] ; then
323         cat $i                                                >> diffs
324      else
325         head -n $MAX_LINES $i                                 >> diffs
326         echo "<truncated beyond $MAX_LINES lines>"            >> diffs
327      fi
328   done
329fi
330cat diffs
331echo ===============END TESTING===============
332
333
334%clean
335[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
336
337%files
338%defattr(-,root,root)
339%doc COPYING NEWS README_*
340%doc docs.installed/html docs.installed/*.pdf
341%{_bindir}/*
342%dir %{_libdir}/%{name}
343%{_libdir}/%{name}/*[^ao]
344%{_libdir}/%{name}/[^l]*o
345%{_mandir}/man1/*
346
347%files devel
348%defattr(-,root,root)
349%{_includedir}/%{name}
350%dir %{_libdir}/%{name}
351%{_libdir}/%{name}/*.a
352%{_libdir}/pkgconfig/%{name}.pc
353
354%if %{build_openmpi}
355%files openmpi
356%defattr(-,root,root)
357%dir %{_libdir}/%{name}
358%{_libdir}/%{name}/libmpiwrap*.so
359%endif
360
361
362%changelog
363* Fri Dec 22 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.13.0-1
364- updated to 3.13.0.
365- replaced all Patches (from rawhide).
366
367* Mon Mar 16 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.10.1-1
368- updated valgrind to 3.10.1 based on fedora 3.10.1-6
369- replaced all Patches (from fedora)
370
371* Wed Apr 18 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.7.0-1
372- updated valgrind to 3.7.0
373- replace all Patches (from fedora)
374
375* Thu Nov 11 2010 Shu KONNO <owa@bg.wakwak.com> 3.6.0-1
376- updated valgrind to 3.6.0
377- updated BR: glibc-devel <= 2.12
378- added BR: gcc <= 4.5
379- added RQ: glibc <= 2.12
380
381* Tue Oct 05 2010 Shu KONNO <owa@bg.wakwak.com> 3.5.0-1
382- updated valgrind to 3.5.0
383- added BR: glibc-devel >= 2.11
384- split %{name}-devel
385- added patches (from fedora core 12)
386  - valgrind-3.5.0-cachegrind-improvements.patch
387  - valgrind-3.5.0-openat.patch
388  - valgrind-3.5.0-glibc-2.10.1.patch
389  - valgrind-3.5.0-ifunc.patch
390  - valgrind-3.5.0-inotify-init1.patch
391  - valgrind-3.5.0-mmap-mprotect.patch
392  - valgrind-3.5.0-dwarf3.patch
393  - valgrind-3.5.0-pr40659.patch
394  - valgrind-3.5.0-helgrind-race-supp.patch
395  - valgrind-3.5.0-ppc-tests.patch
396  - valgrind-3.5.0-amd64-loopnel.patch
397  - valgrind-3.5.0-ppc-dwarf3.patch
398  - valgrind-3.5.0-amd64-adcsbb.patch
399  - valgrind-3.5.0-syscalls.patch
400  - valgrind-3.5.0-preadv.patch
401  - valgrind-3.5.0-glibc-2.11.patch
402
403* Sun Apr 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.4.1-1vl5
404- new upstream release
405- changed Group to Development/Tools
406
407* Sun Aug 24 2008 Shu KONNO <owa@bg.wakwak.com> 3.3.1-1vl5
408- packaged new
409
Note: See TracBrowser for help on using the repository browser.