[9437] | 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 |
---|
[521] | 6 | |
---|
[9437] | 7 | %ifarch x86_64 ppc64 |
---|
| 8 | %global build_multilib 1 |
---|
| 9 | %endif |
---|
[1995] | 10 | |
---|
[9437] | 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 |
---|
[1995] | 17 | |
---|
[9437] | 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 | |
---|
| 24 | Name: valgrind |
---|
[11299] | 25 | Version: 3.13.0 |
---|
[9437] | 26 | Release: 1%{?_dist_release} |
---|
| 27 | Summary: Tool for finding memory management bugs in programs |
---|
| 28 | Summary(ja): プログラムのメモリ管理バグを発見するためのツール |
---|
| 29 | |
---|
| 30 | License: GPLv2+ |
---|
| 31 | Group: Development/Debuggers |
---|
| 32 | URL: http://valgrind.org/ |
---|
| 33 | |
---|
| 34 | Source0: http://valgrind.org/downloads/%{name}-%{version}.tar.bz2 |
---|
| 35 | |
---|
| 36 | # Needs investigation and pushing upstream |
---|
[11299] | 37 | Patch1: valgrind-3.9.0-cachegrind-improvements.patch |
---|
| 38 | |
---|
[9437] | 39 | # KDE#211352 - helgrind races in helgrind's own mythread_wrapper |
---|
[11299] | 40 | Patch2: valgrind-3.9.0-helgrind-race-supp.patch |
---|
| 41 | |
---|
[9437] | 42 | # Make ld.so supressions slightly less specific. |
---|
[11299] | 43 | Patch3: valgrind-3.9.0-ldso-supp.patch |
---|
[9437] | 44 | |
---|
[11299] | 45 | # KDE#381272 ppc64 doesn't compile test_isa_2_06_partx.c without VSX support |
---|
| 46 | Patch4: valgrind-3.13.0-ppc64-check-no-vsx.patch |
---|
| 47 | |
---|
| 48 | # KDE#381289 epoll_pwait can have a NULL sigmask. |
---|
| 49 | Patch5: valgrind-3.13.0-epoll_pwait.patch |
---|
| 50 | |
---|
| 51 | # KDE#381274 powerpc too chatty even with --sigill-diagnostics=no |
---|
| 52 | Patch6: 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) |
---|
| 56 | Patch7: 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 |
---|
| 60 | Patch8: valgrind-3.13.0-arm-index-hardwire.patch |
---|
| 61 | |
---|
| 62 | # KDE#381769 Use ucontext_t instead of struct ucontext |
---|
| 63 | Patch9: valgrind-3.13.0-ucontext_t.patch |
---|
| 64 | |
---|
| 65 | # valgrind svn r16453 Fix some tests failure with GDB 8.0 |
---|
| 66 | Patch10: valgrind-3.13.0-gdb-8-testfix.patch |
---|
| 67 | |
---|
| 68 | # valgrind svn r16454. disable vgdb poll in the child after fork |
---|
| 69 | Patch11: valgrind-3.13.0-disable-vgdb-child.patch |
---|
| 70 | |
---|
| 71 | # KDE#382998 xml-socket doesn't work |
---|
| 72 | Patch12: 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) |
---|
| 86 | Patch13: valgrind-3.13.0-ppc64-vex-fixes.patch |
---|
| 87 | |
---|
| 88 | # Fix eflags handling in amd64 instruction tests |
---|
| 89 | Patch14: valgrind-3.13.0-amd64-eflags-tests.patch |
---|
| 90 | |
---|
| 91 | # KDE#385868 ld.so _dl_runtime_resolve_avx_slow conditional jump warning |
---|
| 92 | Patch15: valgrind-3.13.0-suppress-dl-trampoline-sse-avx.patch |
---|
| 93 | |
---|
| 94 | # Implement static TLS code for more platforms |
---|
| 95 | Patch16: valgrind-3.13.0-static-tls.patch |
---|
| 96 | |
---|
| 97 | # KDE#386397 PPC64 valgrind truncates powerpc timebase to 32-bits. |
---|
| 98 | Patch17: valgrind-3.13.0-ppc64-timebase.patch |
---|
| 99 | |
---|
| 100 | # KDE#387773 - Files in .gnu_debugaltlink should be resolved relative to .debug |
---|
| 101 | Patch18: valgrind-3.13.0-debug-alt-file.patch |
---|
| 102 | |
---|
| 103 | # KDE#387712 s390x cgijnl reports Conditional jump depends on uninit value |
---|
| 104 | Patch19: valgrind-3.13.0-s390-cgijnl.patch |
---|
| 105 | |
---|
[9437] | 106 | Buildroot: %{_tmppath}/%{name}-%{version}-root |
---|
| 107 | %if %{build_multilib} |
---|
| 108 | # Ensure glibc{,-devel} is installed for both multilib arches |
---|
[11299] | 109 | BuildRequires: compat32-glibc-devel |
---|
[9437] | 110 | %endif |
---|
| 111 | BuildRequires: glibc-devel >= 2.14 |
---|
| 112 | %if %{build_openmpi} |
---|
| 113 | BuildRequires: 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. |
---|
| 118 | BuildRequires: gdb |
---|
| 119 | BuildRequires: binutils |
---|
| 120 | |
---|
| 121 | # gdbserver_tests/filter_make_empty uses ps in test |
---|
| 122 | BuildRequires: procps |
---|
| 123 | |
---|
| 124 | ExclusiveArch: %{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 | |
---|
[521] | 169 | %description |
---|
[1995] | 170 | Valgrind is a tool to help you find memory-management problems in your |
---|
| 171 | programs. When a program is run under Valgrind's supervision, all |
---|
| 172 | reads and writes of memory are checked, and calls to |
---|
| 173 | malloc/new/free/delete are intercepted. As a result, Valgrind can |
---|
| 174 | detect a lot of problems that are otherwise very hard to |
---|
| 175 | find/diagnose. |
---|
[521] | 176 | |
---|
[1995] | 177 | %package devel |
---|
[9437] | 178 | Summary: Development files for valgrind |
---|
| 179 | Summary(ja): Valgrind の開発用ファイル |
---|
| 180 | Group: Development/Libraries |
---|
| 181 | Requires: %{name} = %{version}-%{release} |
---|
| 182 | Provides: %{name}-static = %{version}-%{release} |
---|
[521] | 183 | |
---|
[1995] | 184 | %description devel |
---|
| 185 | Header files and libraries for development of valgrind aware programs |
---|
| 186 | or valgrind plugins. |
---|
[521] | 187 | |
---|
[9437] | 188 | %package openmpi |
---|
| 189 | Summary: OpenMPI support for valgrind |
---|
| 190 | Summary(ja): Valgrind の OpenMPI サポート |
---|
| 191 | Group: Development/Debuggers |
---|
| 192 | Requires: %{name} = %{version}-%{release} |
---|
[1995] | 193 | |
---|
[9437] | 194 | %description openmpi |
---|
| 195 | A wrapper library for debugging OpenMPI parallel programs with valgrind. |
---|
| 196 | See the section on Debugging MPI Parallel Programs with Valgrind in the |
---|
| 197 | Valgrind User Manual for details. |
---|
| 198 | |
---|
| 199 | |
---|
[521] | 200 | %prep |
---|
| 201 | %setup -q -n %{name}-%{version} |
---|
[1995] | 202 | %patch1 -p1 |
---|
| 203 | %patch2 -p1 |
---|
| 204 | %patch3 -p1 |
---|
[6011] | 205 | %patch4 -p1 |
---|
| 206 | %patch5 -p1 |
---|
| 207 | %patch6 -p1 |
---|
| 208 | %patch7 -p1 |
---|
| 209 | %patch8 -p1 |
---|
[1995] | 210 | %patch9 -p1 |
---|
[6011] | 211 | %patch10 -p1 |
---|
[11299] | 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 |
---|
[521] | 221 | |
---|
| 222 | %build |
---|
[9437] | 223 | CC=gcc |
---|
| 224 | %if %{build_multilib} |
---|
| 225 | # Ugly hack - libgcc 32-bit package might not be installed |
---|
| 226 | mkdir -p shared/libgcc/32 |
---|
| 227 | ar r shared/libgcc/32/libgcc_s.a |
---|
| 228 | ar r shared/libgcc/libgcc_s_32.a |
---|
| 229 | CC="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. |
---|
| 240 | OPTFLAGS="`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 | |
---|
[521] | 247 | make %{?_smp_mflags} |
---|
| 248 | |
---|
[9437] | 249 | # Ensure there are no unexpected file descriptors open, |
---|
| 250 | # the testsuite otherwise fails. |
---|
| 251 | cat > close_fds.c <<EOF |
---|
| 252 | #include <stdlib.h> |
---|
| 253 | #include <unistd.h> |
---|
| 254 | int 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 | } |
---|
| 264 | EOF |
---|
| 265 | gcc $RPM_OPT_FLAGS -o close_fds close_fds.c |
---|
[521] | 266 | |
---|
| 267 | %install |
---|
| 268 | rm -rf $RPM_BUILD_ROOT |
---|
| 269 | make install DESTDIR=$RPM_BUILD_ROOT |
---|
| 270 | |
---|
| 271 | rm -rf docs.installed |
---|
| 272 | mkdir docs.installed |
---|
[1995] | 273 | mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/* docs.installed/ |
---|
[9437] | 274 | rm -f docs.installed/*.ps |
---|
[521] | 275 | |
---|
[9437] | 276 | %if "%{valsecarch}" != "" |
---|
| 277 | pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/ |
---|
| 278 | rm -f *-%{valsecarch}-* || : |
---|
| 279 | for i in *-%{valarch}-*; do |
---|
| 280 | j=`echo $i | sed 's/-%{valarch}-/-%{valsecarch}-/'` |
---|
| 281 | ln -sf ../../lib/valgrind/$j $j |
---|
| 282 | done |
---|
| 283 | popd |
---|
| 284 | %endif |
---|
| 285 | |
---|
[1995] | 286 | # remove unuse files |
---|
[9437] | 287 | rm -f $RPM_BUILD_ROOT%{_libdir}/valgrind/*.supp.in |
---|
[521] | 288 | |
---|
[1995] | 289 | |
---|
[9437] | 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. |
---|
| 293 | for 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 |
---|
| 296 | done |
---|
| 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. |
---|
| 306 | make %{?_smp_mflags} CFLAGS="" check || : |
---|
| 307 | |
---|
| 308 | echo ===============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) |
---|
| 313 | MAX_LINES=20 |
---|
| 314 | diff_files=`find . -name '*.diff' | sort` |
---|
| 315 | if [ z"$diff_files" = z ] ; then |
---|
| 316 | echo "Congratulations, all tests passed!" >> diffs |
---|
| 317 | else |
---|
| 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 |
---|
| 329 | fi |
---|
| 330 | cat diffs |
---|
| 331 | echo ===============END TESTING=============== |
---|
| 332 | |
---|
| 333 | |
---|
[521] | 334 | %clean |
---|
| 335 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT} |
---|
| 336 | |
---|
| 337 | %files |
---|
| 338 | %defattr(-,root,root) |
---|
[9437] | 339 | %doc COPYING NEWS README_* |
---|
| 340 | %doc docs.installed/html docs.installed/*.pdf |
---|
[521] | 341 | %{_bindir}/* |
---|
[1995] | 342 | %dir %{_libdir}/%{name} |
---|
[9437] | 343 | %{_libdir}/%{name}/*[^ao] |
---|
| 344 | %{_libdir}/%{name}/[^l]*o |
---|
[1995] | 345 | %{_mandir}/man1/* |
---|
[521] | 346 | |
---|
[1995] | 347 | %files devel |
---|
[521] | 348 | %defattr(-,root,root) |
---|
[1995] | 349 | %{_includedir}/%{name} |
---|
[9437] | 350 | %dir %{_libdir}/%{name} |
---|
| 351 | %{_libdir}/%{name}/*.a |
---|
[1995] | 352 | %{_libdir}/pkgconfig/%{name}.pc |
---|
[521] | 353 | |
---|
[9437] | 354 | %if %{build_openmpi} |
---|
| 355 | %files openmpi |
---|
| 356 | %defattr(-,root,root) |
---|
| 357 | %dir %{_libdir}/%{name} |
---|
| 358 | %{_libdir}/%{name}/libmpiwrap*.so |
---|
| 359 | %endif |
---|
[1995] | 360 | |
---|
[9437] | 361 | |
---|
[521] | 362 | %changelog |
---|
[11299] | 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 | |
---|
[9437] | 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 | |
---|
[6011] | 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 | |
---|
[2201] | 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 | |
---|
[1995] | 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 | |
---|
[521] | 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 | |
---|