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

Revision 12525, 13.7 KB checked in by tomop, 3 years ago (diff)

updated 10 packages

binutils-2.36.1-1

elfutils-0.183-1

gcc-10.2.1-1

gdb-10.1-1

glibc-2.33-1

isl-0.23-1

libtirpc-1.3.1-1

libtool-2.4.6-7

libxcrypt-4.4.17-1

valgrind-3.16.1-2

Line 
1%bcond_with check
2
3# Only arches that are supported upstream as multilib and that the distro
4# has multilib builds for should set build_multilib 1. In practice that
5# is only x86_64 and ppc64 (but not in fedora 21 and later, and never
6# for ppc64le).
7%global build_multilib 0
8
9%ifarch x86_64 ppc64
10%global build_multilib 1
11%endif
12
13# Vine Linux doesn't have openmpi package
14#ifarch %{ix86} x86_64 ppc ppc64 ppc64le %{arm} aarch64
15#global build_openmpi 1
16#else
17%global build_openmpi 0
18#endif
19
20%global run_full_regtest 0
21%global build_tools_devel 0
22
23# Don't run dwz or generate minisymtab, valgrind doesn't handle compressed
24# DWARF very well and it might read its own vgpreload libraries. Generating
25# minisymtabs doesn't really work for the staticly linked tools.
26%define _find_debuginfo_dwz_opts %{nil}
27%undefine _include_minidebuginfo
28
29Summary:        Tool for finding memory management bugs in programs
30Summary(ja):    プログラムのメモリ管理バグを発見するためのツール
31Name:           valgrind
32Version:        3.16.1
33Release:        2%{?_dist_release}
34Group:          programming
35Vendor:         Project Vine
36Distribution:   Vine Linux
37
38License:        GPLv2+
39URL:            https://valgrind.org/
40Source0:        https://sourceware.org/pub/valgrind/%{name}-%{version}.tar.bz2
41
42# Needs investigation and pushing upstream
43Patch1: valgrind-3.9.0-cachegrind-improvements.patch
44
45# KDE#211352 - helgrind races in helgrind's own mythread_wrapper
46Patch2: valgrind-3.9.0-helgrind-race-supp.patch
47
48# Make ld.so supressions slightly less specific.
49Patch3: valgrind-3.9.0-ldso-supp.patch
50
51# We want all executables and libraries in libexec instead of lib
52# so they are only available for valgrind usage itself and so the
53# same directory is used independent of arch.
54Patch4: valgrind-3.16.0-pkglibexecdir.patch
55
56# Add some stack-protector
57Patch5: valgrind-3.16.0-some-stack-protector.patch
58
59# Add some -Wl,z,now.
60Patch6: valgrind-3.16.0-some-Wl-z-now.patch
61
62# KDE#422174  unhandled instruction bytes: 0x48 0xE9 (REX prefix JMP instr)
63Patch7: valgrind-3.16.1-REX-prefix-JMP.patch
64
65# KDE#422623  epoll_ctl warns for uninit padding on non-amd64 64bit arches
66Patch8: valgrind-3.16.1-epoll.patch
67
68# KDE#369029  handle linux syscalls sched_getattr and sched_setattr
69Patch9: valgrind-3.16.1-sched_getsetattr.patch
70
71# KDE#415293  Incorrect call-graph tracking due to new _dl_runtime_resolve*
72Patch10: valgrind-3.16.1-dl_runtime_resolve.patch
73
74Buildroot:      %{_tmppath}/%{name}-%{version}-root
75%if %{build_multilib}
76# Ensure glibc{,-devel} is installed for both multilib arches
77BuildRequires:  compat32-glibc-devel
78%endif
79BuildRequires:  glibc-devel >= 2.14
80%if %{build_openmpi}
81BuildRequires: openmpi-devel >= 1.3.3
82%endif
83
84# For %%build and %%check.
85# In case of a software collection, pick the matching gdb and binutils.
86BuildRequires:  gdb
87BuildRequires:  binutils
88
89# gdbserver_tests/filter_make_empty uses ps in test
90BuildRequires:  procps
91
92ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
93%ifarch %{ix86}
94%define valarch x86
95%define valsecarch %{nil}
96%endif
97%ifarch x86_64
98%define valarch amd64
99%define valsecarch x86
100%endif
101%ifarch ppc
102%define valarch ppc32
103%define valsecarch %{nil}
104%endif
105%ifarch ppc64
106  %define valarch ppc64be
107  %if %{build_multilib}
108    %define valsecarch ppc32
109  %else
110    %define valsecarch %{nil}
111  %endif
112%endif
113%ifarch ppc64le
114%define valarch ppc64le
115%define valsecarch %{nil}
116%endif
117%ifarch s390x
118%define valarch s390x
119%define valsecarch %{nil}
120%endif
121%ifarch armv7hl
122%define valarch arm
123%define valsecarch %{nil}
124%endif
125%ifarch aarch64
126%define valarch arm64
127%define valsecarch %{nil}
128%endif
129
130# Don't run dwz or generate minisymtab, valgrind doesn't handle compressed
131# DWARF very well and it might read its own vgpreload libraries. Generating
132# minisymtabs doesn't really work for the staticly linked tools.
133%define _find_debuginfo_dwz_opts %{nil}
134%undefine _include_minidebuginfo
135
136%description
137Valgrind is a tool to help you find memory-management problems in your
138programs. When a program is run under Valgrind's supervision, all
139reads and writes of memory are checked, and calls to
140malloc/new/free/delete are intercepted. As a result, Valgrind can
141detect a lot of problems that are otherwise very hard to
142find/diagnose.
143
144
145%package devel
146Summary:        Development files for valgrind
147Summary(ja):    Valgrind の開発用ファイル
148Group:          programming
149Requires:       %{name} = %{version}-%{release}
150Provides:       %{name}-static = %{version}-%{release}
151
152%description devel
153Header files and libraries for development of valgrind aware programs
154or valgrind plugins.
155
156
157%package openmpi
158Summary:        OpenMPI support for valgrind
159Summary(ja):    Valgrind の OpenMPI サポート
160Group:          programming
161Requires:       %{name} = %{version}-%{release}
162
163%description openmpi
164A wrapper library for debugging OpenMPI parallel programs with valgrind.
165See the section on Debugging MPI Parallel Programs with Valgrind in the
166Valgrind User Manual for details.
167
168
169%debug_package
170
171
172%prep
173%setup -q -n %{name}-%{version}
174%patch1 -p1
175%patch2 -p1
176%patch3 -p1
177%patch4 -p1
178%patch5 -p1
179%patch6 -p1
180%patch7 -p1
181%patch8 -p1
182%patch9 -p1
183%patch10 -p1
184
185# Some patches (might) touch Makefile.am or configure.ac files.
186# Just always autoreconf so we don't need patches to prebuild files.
187./autogen.sh
188
189
190%build
191CC=gcc
192%if %{build_multilib}
193# Ugly hack - libgcc 32-bit package might not be installed
194mkdir -p shared/libgcc/32
195ar r shared/libgcc/32/libgcc_s.a
196ar r shared/libgcc/libgcc_s_32.a
197CC="gcc -B `pwd`/shared/libgcc/"
198%endif
199
200# Old openmpi-devel has version depended paths for mpicc.
201%if %{build_openmpi}
202%if 0%{?fedora} >= 13 || 0%{?rhel} >= 6
203%define mpiccpath %{!?scl:%{_libdir}}%{?scl:%{_root_libdir}}/openmpi/bin/mpicc
204%else
205%define mpiccpath %{!?scl:%{_libdir}}%{?scl:%{_root_libdir}}/openmpi/*/bin/mpicc
206%endif
207%else
208# We explicitly don't want the libmpi wrapper. So make sure that configure
209# doesn't pick some random mpi compiler that happens to be installed.
210%define mpiccpath /bin/false
211%endif
212
213# Filter out some flags that cause lots of valgrind test failures.
214# Also filter away -O2, valgrind adds it wherever suitable, but
215# not for tests which should be -O0, as they aren't meant to be
216# compiled with -O2 unless explicitely requested. Same for any -mcpu flag.
217# Ideally we will change this to only be done for the non-primary build
218# and the test suite. Also disable strict symbol checks because the
219# vg_preload library will use hidden/undefined symbols from glibc
220# like __libc_freeres.
221%undefine _hardened_build
222%undefine _strict_symbol_defs_build
223OPTFLAGS="`echo " %{optflags} " | sed 's/ -m\(64\|3[21]\) / /g;s/ -fexceptions / /g;s/ -fstack-protector\([-a-z]*\) / / g;s/ -Wp,-D_FORTIFY_SOURCE=2 / /g;s/ -O2 / /g;s/ -mcpu=\([a-z0-9]\+\) / /g;s/^ //;s/ $//'`"
224
225%configure CC="$CC" CFLAGS="$OPTFLAGS" CXXFLAGS="$OPTFLAGS" \
226  --with-mpicc=%{mpiccpath} \
227  GDB=%{_bindir}/gdb
228
229make %{?_smp_mflags}
230
231# Ensure there are no unexpected file descriptors open,
232# the testsuite otherwise fails.
233cat > close_fds.c <<EOF
234#include <stdlib.h>
235#include <unistd.h>
236int main (int argc, char *const argv[])
237{
238  int i, j = sysconf (_SC_OPEN_MAX);
239  if (j < 0)
240    exit (1);
241  for (i = 3; i < j; ++i)
242    close (i);
243  execvp (argv[1], argv + 1);
244  exit (1);
245}
246EOF
247gcc $RPM_OPT_FLAGS -o close_fds close_fds.c
248
249
250%install
251rm -rf $RPM_BUILD_ROOT
252make DESTDIR=$RPM_BUILD_ROOT install
253rm -rf docs/installed
254mkdir docs/installed
255mv $RPM_BUILD_ROOT%{_datadir}/doc/valgrind/* docs/installed/
256rm -f docs/installed/*.ps
257
258
259# We want the MPI wrapper installed under the openmpi libdir so the script
260# generating the MPI library requires picks them up and sets up the right
261# openmpi libmpi.so requires. Install symlinks in the original/upstream
262# location for backwards compatibility.
263%if %{build_openmpi}
264pushd $RPM_BUILD_ROOT%{_libdir}
265mkdir -p openmpi/valgrind
266cd valgrind
267mv libmpiwrap-%{valarch}-linux.so ../openmpi/valgrind/
268ln -s ../openmpi/valgrind/libmpiwrap-%{valarch}-linux.so
269popd
270%endif
271
272%if "%{valsecarch}" != ""
273pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/
274rm -f *-%{valsecarch}-* || :
275for i in *-%{valarch}-*; do
276  j=`echo $i | sed 's/-%{valarch}-/-%{valsecarch}-/'`
277  ln -sf ../../lib/valgrind/$j $j
278done
279popd
280%endif
281
282# remove unuse files
283rm -f $RPM_BUILD_ROOT%{_libdir}/valgrind/*.supp.in
284
285%if %{build_tools_devel}
286%ifarch %{ix86} x86_64
287# To avoid multilib clashes in between i?86 and x86_64,
288# tweak installed <valgrind/config.h> a little bit.
289for i in HAVE_PTHREAD_CREATE_GLIBC_2_0 HAVE_PTRACE_GETREGS HAVE_AS_AMD64_FXSAVE64 \
290         ; do
291  sed -i -e 's,^\(#define '$i' 1\|/\* #undef '$i' \*/\)$,#ifdef __x86_64__\n# define '$i' 1\n#endif,' \
292    $RPM_BUILD_ROOT%{_includedir}/valgrind/config.h
293done
294%endif
295%else
296# Remove files we aren't going to package.
297# See tools-devel files.
298rm $RPM_BUILD_ROOT%{_includedir}/valgrind/config.h
299rm $RPM_BUILD_ROOT%{_includedir}/valgrind/libvex*h
300rm $RPM_BUILD_ROOT%{_includedir}/valgrind/pub_tool_*h
301rm -rf $RPM_BUILD_ROOT%{_includedir}/valgrind/vki
302rm $RPM_BUILD_ROOT%{_libdir}/valgrind/*.a
303%endif
304
305# We don't want debuginfo generated for the vgpreload libraries.
306# Turn off execute bit so they aren't included in the debuginfo.list.
307# We'll turn the execute bit on again in %%files.
308chmod 644 $RPM_BUILD_ROOT%{_libexecdir}/valgrind/vgpreload*-*-*so
309
310
311%if %{with check}
312%check
313# Make sure a basic binary runs. There should be no errors.
314./vg-in-place --error-exitcode=1 /bin/true
315
316# Build the test files with the software collection compiler if available.
317%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
318# Make sure no extra CFLAGS, CXXFLAGS or LDFLAGS leak through,
319# the testsuite sets all flags necessary. See also configure above.
320make %{?_smp_mflags} CFLAGS="" CXXFLAGS="" LDFLAGS="" check
321
322# Workaround https://bugzilla.redhat.com/show_bug.cgi?id=1434601
323# for gdbserver tests.
324export PYTHONCOERCECLOCALE=0
325
326echo ===============TESTING===================
327%if 0%{?run_full_regtest}
328  ./close_fds make regtest || :
329%else
330  ./close_fds make nonexp-regtest || :
331%endif
332
333# Make sure test failures show up in build.log
334# Gather up the diffs (at most the first 20 lines for each one)
335MAX_LINES=20
336diff_files=`find */tests -name '*.diff*' | sort`
337if [ z"$diff_files" = z ] ; then
338   echo "Congratulations, all tests passed!" >> diffs
339else
340   for i in $diff_files ; do
341      echo "=================================================" >> diffs
342      echo $i                                                  >> diffs
343      echo "=================================================" >> diffs
344      if [ `wc -l < $i` -le $MAX_LINES ] ; then
345         cat $i                                                >> diffs
346      else
347         head -n $MAX_LINES $i                                 >> diffs
348         echo "<truncated beyond $MAX_LINES lines>"            >> diffs
349      fi
350   done
351fi
352cat diffs
353echo ===============END TESTING===============
354%endif
355
356
357%clean
358[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
359
360
361%files
362%defattr(-,root,root)
363%license COPYING
364%doc NEWS README_*
365%doc docs/installed/html docs/installed/*.pdf
366%{_bindir}/*
367%dir %{_libexecdir}/%{name}
368# Install everything in the libdir except the .so.
369# The vgpreload so files might need file mode adjustment.
370%{_libexecdir}/valgrind/*[^o]
371# Turn on executable bit again for vgpreload libraries.
372# Was disabled in %%install to prevent debuginfo stripping.
373%attr(0755,root,root) %{_libexecdir}/valgrind/vgpreload*-*-*so
374%{_mandir}/man1/*
375
376%files devel
377%defattr(-,root,root)
378%dir %{_includedir}/valgrind
379%{_includedir}/valgrind/valgrind.h
380%{_includedir}/valgrind/callgrind.h
381%{_includedir}/valgrind/drd.h
382%{_includedir}/valgrind/helgrind.h
383%{_includedir}/valgrind/memcheck.h
384%{_libdir}/pkgconfig/valgrind.pc
385
386%if %{build_tools_devel}
387%files tools-devel
388%{_includedir}/valgrind/config.h
389%{_includedir}/valgrind/libvex*h
390%{_includedir}/valgrind/pub_tool_*h
391%{_includedir}/valgrind/vki
392%dir %{_libdir}/valgrind
393%{_libdir}/valgrind/*.a
394%endif
395
396%if %{build_openmpi}
397%files openmpi
398%defattr(-,root,root)
399%dir %{_libdir}/valgrind
400%{_libdir}/openmpi/valgrind/libmpiwrap*.so
401%{_libdir}/valgrind/libmpiwrap*.so
402%endif
403
404
405%changelog
406* Wed Feb 10 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.16.1-2
407- rebuilt with current environment.
408
409* Wed Aug 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.16.1-1
410- new upstream release.
411- dropped Patch4-35.
412- import Patch4-10 from rawhide.
413
414* Tue Jan 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.14.0-1
415- dropped Patch4-19.
416- import Patch4-35 from rawhide.
417
418* Fri Dec 22 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.13.0-1
419- updated to 3.13.0.
420- replaced all Patches (from rawhide).
421
422* Mon Mar 16 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.10.1-1
423- updated valgrind to 3.10.1 based on fedora 3.10.1-6
424- replaced all Patches (from fedora)
425
426* Wed Apr 18 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.7.0-1
427- updated valgrind to 3.7.0
428- replace all Patches (from fedora)
429
430* Thu Nov 11 2010 Shu KONNO <owa@bg.wakwak.com> 3.6.0-1
431- updated valgrind to 3.6.0
432- updated BR: glibc-devel <= 2.12
433- added BR: gcc <= 4.5
434- added RQ: glibc <= 2.12
435
436* Tue Oct 05 2010 Shu KONNO <owa@bg.wakwak.com> 3.5.0-1
437- updated valgrind to 3.5.0
438- added BR: glibc-devel >= 2.11
439- split %{name}-devel
440- added patches (from fedora core 12)
441  - valgrind-3.5.0-cachegrind-improvements.patch
442  - valgrind-3.5.0-openat.patch
443  - valgrind-3.5.0-glibc-2.10.1.patch
444  - valgrind-3.5.0-ifunc.patch
445  - valgrind-3.5.0-inotify-init1.patch
446  - valgrind-3.5.0-mmap-mprotect.patch
447  - valgrind-3.5.0-dwarf3.patch
448  - valgrind-3.5.0-pr40659.patch
449  - valgrind-3.5.0-helgrind-race-supp.patch
450  - valgrind-3.5.0-ppc-tests.patch
451  - valgrind-3.5.0-amd64-loopnel.patch
452  - valgrind-3.5.0-ppc-dwarf3.patch
453  - valgrind-3.5.0-amd64-adcsbb.patch
454  - valgrind-3.5.0-syscalls.patch
455  - valgrind-3.5.0-preadv.patch
456  - valgrind-3.5.0-glibc-2.11.patch
457
458* Sun Apr 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.4.1-1vl5
459- new upstream release
460- changed Group to Development/Tools
461
462* Sun Aug 24 2008 Shu KONNO <owa@bg.wakwak.com> 3.3.1-1vl5
463- packaged new
464
Note: See TracBrowser for help on using the repository browser.