123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- %bcond_with check
- # Only arches that are supported upstream as multilib and that the distro
- # has multilib builds for should set build_multilib 1. In practice that
- # is only x86_64 and ppc64 (but not in fedora 21 and later, and never
- # for ppc64le).
- %global build_multilib 0
- %ifarch x86_64 ppc64
- %global build_multilib 1
- %endif
- # Vine Linux doesn't have openmpi package
- #ifarch %{ix86} x86_64 ppc ppc64 ppc64le %{arm} aarch64
- #global build_openmpi 1
- #else
- %global build_openmpi 0
- #endif
- %global run_full_regtest 0
- %global build_tools_devel 0
- # Don't run dwz or generate minisymtab, valgrind doesn't handle compressed
- # DWARF very well and it might read its own vgpreload libraries. Generating
- # minisymtabs doesn't really work for the staticly linked tools.
- %define _find_debuginfo_dwz_opts %{nil}
- %undefine _include_minidebuginfo
- Summary: Tool for finding memory management bugs in programs
- Summary(ja): プログラムのメモリ管理バグを発見するためのツール
- Name: valgrind
- Version: 3.21.0
- Release: 1%{?_dist_release}
- Group: programming
- Vendor: Project Vine
- Distribution: Vine Linux
- License: GPLv2+
- URL: https://valgrind.org/
- Source0: https://sourceware.org/pub/valgrind/%{name}-%{version}.tar.bz2
- # Needs investigation and pushing upstream
- Patch1: valgrind-3.9.0-cachegrind-improvements.patch
- # Make ld.so supressions slightly less specific.
- Patch2: valgrind-3.9.0-ldso-supp.patch
- # Add some stack-protector
- Patch3: valgrind-3.16.0-some-stack-protector.patch
- # Add some -Wl,z,now.
- Patch4: valgrind-3.16.0-some-Wl-z-now.patch
- # Workaround https://bugs.kde.org/show_bug.cgi?id=402833
- # by disabling overlap checking for memcpy
- Patch5: valgrind-3.21.0-no-memcpy-replace-check.patch
- # Add --with-gdbscripts-dir=PATH configure option
- # https://bugs.kde.org/show_bug.cgi?id=469768
- Patch6: valgrind-3.21.0-Add-with-gdbscripts-dir.patch
- # Add epoll_pwait2
- # https://bugs.kde.org/show_bug.cgi?id=460192
- Patch7: valgrind-3.21.0-epoll_pwait2.patch
- # Can't run callgrind_control with valgrind 3.21.0 because of perl errors
- # https://bugs.kde.org/show_bug.cgi?id=470121
- Patch8: valgrind-3.21.0-callgrind_control-no-strict.patch
- # Multiple realloc zero errors crash in MC_(eq_Error)
- # https://bugs.kde.org/show_bug.cgi?id=470520
- Patch9: valgrind-3.21.0-realloc-again.patch
- # s390x: Assertion failure on VGM instruction
- # https://bugs.kde.org/show_bug.cgi?id=470132
- Patch10: valgrind-3.21.0-vgm.patch
- Patch11: valgrind-3.21.0-vgm-tests.patch
- # s390x: Valgrind cannot start qemu-kvm when "sysctl vm.allocate_pgste=0"
- # https://bugs.kde.org/show_bug.cgi?id=470978
- Patch12: valgrind-3.21.0-pgste.patch
- # gdb --multi mode stdout redirecting to stderr
- # https://bugs.kde.org/show_bug.cgi?id=471311
- Patch13: valgrind-3.21.0-gdb-multi-mode-stdout-redirecting-to-stderr.patch
- # Add support for lazy reading and downloading of DWARF debuginfo
- # https://bugs.kde.org/show_bug.cgi?id=471807
- # Plus fixup commit a0d555a0dfe078ef04ea49d991a8090ab14bd4a5
- Patch14: valgrind-3.21.0-lazy-debuginfo.patch
- Patch15: valgrind-3.21.0-cleanup-read_elf_object.patch
- BuildRoot: %{_tmppath}/%{name}-%{version}-root
- %if %{build_multilib}
- # Ensure glibc{,-devel} is installed for both multilib arches
- BuildRequires: compat32-glibc-devel
- %endif
- BuildRequires: glibc-devel >= 2.14
- %if %{build_openmpi}
- BuildRequires: openmpi-devel >= 1.3.3
- %endif
- # For %%build and %%check.
- # In case of a software collection, pick the matching gdb and binutils.
- BuildRequires: gdb
- BuildRequires: binutils
- # gdbserver_tests/filter_make_empty uses ps in test
- BuildRequires: procps
- ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
- %ifarch %{ix86}
- %define valarch x86
- %define valsecarch %{nil}
- %endif
- %ifarch x86_64
- %define valarch amd64
- %define valsecarch x86
- %endif
- %ifarch ppc
- %define valarch ppc32
- %define valsecarch %{nil}
- %endif
- %ifarch ppc64
- %define valarch ppc64be
- %if %{build_multilib}
- %define valsecarch ppc32
- %else
- %define valsecarch %{nil}
- %endif
- %endif
- %ifarch ppc64le
- %define valarch ppc64le
- %define valsecarch %{nil}
- %endif
- %ifarch s390x
- %define valarch s390x
- %define valsecarch %{nil}
- %endif
- %ifarch armv7hl
- %define valarch arm
- %define valsecarch %{nil}
- %endif
- %ifarch aarch64
- %define valarch arm64
- %define valsecarch %{nil}
- %endif
- # Don't run dwz or generate minisymtab, valgrind doesn't handle compressed
- # DWARF very well and it might read its own vgpreload libraries. Generating
- # minisymtabs doesn't really work for the staticly linked tools.
- %define _find_debuginfo_dwz_opts %{nil}
- %undefine _include_minidebuginfo
- %description
- Valgrind is a tool to help you find memory-management problems in your
- programs. When a program is run under Valgrind's supervision, all
- reads and writes of memory are checked, and calls to
- malloc/new/free/delete are intercepted. As a result, Valgrind can
- detect a lot of problems that are otherwise very hard to
- find/diagnose.
- %package devel
- Summary: Development files for valgrind
- Summary(ja): Valgrind の開発用ファイル
- Group: programming
- Requires: %{name} = %{version}-%{release}
- Provides: %{name}-static = %{version}-%{release}
- %description devel
- Header files and libraries for development of valgrind aware programs
- or valgrind plugins.
- %package openmpi
- Summary: OpenMPI support for valgrind
- Summary(ja): Valgrind の OpenMPI サポート
- Group: programming
- Requires: %{name} = %{version}-%{release}
- %description openmpi
- A wrapper library for debugging OpenMPI parallel programs with valgrind.
- See the section on Debugging MPI Parallel Programs with Valgrind in the
- Valgrind User Manual for details.
- %debug_package
- %prep
- %setup -q -n %{name}-%{version}
- %autopatch -p1
- # Some patches (might) touch Makefile.am or configure.ac files.
- # Just always autoreconf so we don't need patches to prebuild files.
- ./autogen.sh
- %build
- # LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto
- # configure time option, but that doesn't seem to help.
- # Disable LTO for now.
- %define _lto_cflags %{nil}
- CC=gcc
- %if %{build_multilib}
- # Ugly hack - libgcc 32-bit package might not be installed
- mkdir -p shared/libgcc/32
- ar r shared/libgcc/32/libgcc_s.a
- ar r shared/libgcc/libgcc_s_32.a
- CC="gcc -B `pwd`/shared/libgcc/"
- %endif
- # Old openmpi-devel has version depended paths for mpicc.
- %if %{build_openmpi}
- %if 0%{?fedora} >= 13 || 0%{?rhel} >= 6
- %define mpiccpath %{!?scl:%{_libdir}}%{?scl:%{_root_libdir}}/openmpi/bin/mpicc
- %else
- %define mpiccpath %{!?scl:%{_libdir}}%{?scl:%{_root_libdir}}/openmpi/*/bin/mpicc
- %endif
- %else
- # We explicitly don't want the libmpi wrapper. So make sure that configure
- # doesn't pick some random mpi compiler that happens to be installed.
- %define mpiccpath /bin/false
- %endif
- # Filter out some flags that cause lots of valgrind test failures.
- # Also filter away -O2, valgrind adds it wherever suitable, but
- # not for tests which should be -O0, as they aren't meant to be
- # compiled with -O2 unless explicitely requested. Same for any -mcpu flag.
- # Ideally we will change this to only be done for the non-primary build
- # and the test suite. Also disable strict symbol checks because the
- # vg_preload library will use hidden/undefined symbols from glibc
- # like __libc_freeres.
- %undefine _hardened_build
- %undefine _strict_symbol_defs_build
- CFLAGS="`echo " %{optflags} " | sed 's/ -fstack-protector\([-a-z]*\) / / g;s/ -O2 / /g;'`"
- LDFLAGS="`echo " %{build_ldflags} " | sed 's/ -Wl,-z,now / / g;'`"
- export CFLAGS
- export LDFLAGS
- %configure CC="$CC" CFLAGS="$OPTFLAGS" CXXFLAGS="$OPTFLAGS" \
- --with-mpicc=%{mpiccpath} \
- GDB=%{_bindir}/gdb
- make %{?_smp_mflags}
- %install
- rm -rf $RPM_BUILD_ROOT
- make DESTDIR=$RPM_BUILD_ROOT install
- rm -rf docs/installed
- mkdir docs/installed
- mv $RPM_BUILD_ROOT%{_datadir}/doc/valgrind/* docs/installed/
- rm -f docs/installed/*.ps
- # We want the MPI wrapper installed under the openmpi libdir so the script
- # generating the MPI library requires picks them up and sets up the right
- # openmpi libmpi.so requires. Install symlinks in the original/upstream
- # location for backwards compatibility.
- %if %{build_openmpi}
- pushd $RPM_BUILD_ROOT%{_libdir}
- mkdir -p openmpi/valgrind
- cd valgrind
- mv libmpiwrap-%{valarch}-linux.so ../openmpi/valgrind/
- ln -s ../openmpi/valgrind/libmpiwrap-%{valarch}-linux.so
- popd
- %endif
- %if "%{valsecarch}" != ""
- pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/
- rm -f *-%{valsecarch}-* || :
- for i in *-%{valarch}-*; do
- j=`echo $i | sed 's/-%{valarch}-/-%{valsecarch}-/'`
- ln -sf ../../lib/valgrind/$j $j
- done
- popd
- %endif
- %if %{build_tools_devel}
- %ifarch %{ix86} x86_64
- # To avoid multilib clashes in between i?86 and x86_64,
- # tweak installed <valgrind/config.h> a little bit.
- for i in HAVE_PTHREAD_CREATE_GLIBC_2_0 HAVE_PTRACE_GETREGS HAVE_AS_AMD64_FXSAVE64 \
- ; do
- sed -i -e 's,^\(#define '$i' 1\|/\* #undef '$i' \*/\)$,#ifdef __x86_64__\n# define '$i' 1\n#endif,' \
- $RPM_BUILD_ROOT%{_includedir}/valgrind/config.h
- done
- %endif
- %else
- # Remove files we aren't going to package.
- # See tools-devel files.
- rm $RPM_BUILD_ROOT%{_includedir}/valgrind/config.h
- rm $RPM_BUILD_ROOT%{_includedir}/valgrind/libvex*h
- rm $RPM_BUILD_ROOT%{_includedir}/valgrind/pub_tool_*h
- rm -rf $RPM_BUILD_ROOT%{_includedir}/valgrind/vki
- rm $RPM_BUILD_ROOT%{_libdir}/valgrind/*.a
- %endif
- # We don't want debuginfo generated for the vgpreload libraries.
- # Turn off execute bit so they aren't included in the debuginfo.list.
- # We'll turn the execute bit on again in %%files.
- chmod 644 $RPM_BUILD_ROOT%{_libexecdir}/valgrind/vgpreload*-*-*so
- %if %{with check}
- %check
- # Make sure a basic binary runs. There should be no errors.
- ./vg-in-place --error-exitcode=1 /bin/true --help
- # Build the test files with the software collection compiler if available.
- %{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
- # Make sure no extra CFLAGS, CXXFLAGS or LDFLAGS leak through,
- # the testsuite sets all flags necessary. See also configure above.
- make %{?_smp_mflags} CFLAGS="" CXXFLAGS="" LDFLAGS="" check
- # Workaround https://bugzilla.redhat.com/show_bug.cgi?id=1434601
- # for gdbserver tests.
- export PYTHONCOERCECLOCALE=0
- echo ===============TESTING===================
- %if 0%{?run_full_regtest}
- make regtest || :
- %else
- make nonexp-regtest || :
- %endif
- # Make sure test failures show up in build.log
- # Gather up the diffs (at most the first 20 lines for each one)
- MAX_LINES=20
- diff_files=`find */tests -name '*.diff*' | sort`
- if [ z"$diff_files" = z ] ; then
- echo "Congratulations, all tests passed!" >> diffs
- else
- for i in $diff_files ; do
- echo "=================================================" >> diffs
- echo $i >> diffs
- echo "=================================================" >> diffs
- if [ `wc -l < $i` -le $MAX_LINES ] ; then
- cat $i >> diffs
- else
- head -n $MAX_LINES $i >> diffs
- echo "<truncated beyond $MAX_LINES lines>" >> diffs
- fi
- done
- fi
- cat diffs
- echo ===============END TESTING===============
- %endif
- %clean
- [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
- %files
- %defattr(-,root,root)
- %license COPYING
- %doc NEWS README_*
- %doc docs/installed/html docs/installed/*.pdf
- %{_bindir}/*
- %dir %{_libexecdir}/%{name}
- # Install everything in the libdir except the .so.
- # The vgpreload so files might need file mode adjustment.
- %{_libexecdir}/valgrind/*[^o]
- # Turn on executable bit again for vgpreload libraries.
- # Was disabled in %%install to prevent debuginfo stripping.
- %attr(0755,root,root) %{_libexecdir}/valgrind/vgpreload*-*-*so
- %{_mandir}/man1/*
- %files devel
- %defattr(-,root,root)
- %dir %{_includedir}/valgrind
- %{_includedir}/valgrind/valgrind.h
- %{_includedir}/valgrind/callgrind.h
- %{_includedir}/valgrind/drd.h
- %{_includedir}/valgrind/helgrind.h
- %{_includedir}/valgrind/memcheck.h
- %{_includedir}/valgrind/dhat.h
- %{_libdir}/pkgconfig/valgrind.pc
- %if %{build_tools_devel}
- %files tools-devel
- %{_includedir}/valgrind/config.h
- %{_includedir}/valgrind/libvex*h
- %{_includedir}/valgrind/pub_tool_*h
- %{_includedir}/valgrind/vki
- %dir %{_libdir}/valgrind
- %{_libdir}/valgrind/*.a
- %endif
- %if %{build_openmpi}
- %files openmpi
- %defattr(-,root,root)
- %dir %{_libdir}/valgrind
- %{_libdir}/openmpi/valgrind/libmpiwrap*.so
- %{_libdir}/valgrind/libmpiwrap*.so
- %endif
- %changelog
- * Sat Sep 23 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.21.0-1
- - new upstream release.
- - re-imported all patches from rawhide.
- * Sat Sep 10 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.19.0-1
- - new upstream release.
- - re-imported all patches from rawhide.
- * Thu Aug 05 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.17.0-2
- - rebuilt with current environment.
- * Sat Apr 10 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.17.0-1
- - new upstream release.
- - dropped Patch4, 7-10.
- - renumbered patches.
- * Wed Feb 10 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.16.1-2
- - rebuilt with current environment.
- * Wed Aug 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.16.1-1
- - new upstream release.
- - dropped Patch4-35.
- - import Patch4-10 from rawhide.
- * Tue Jan 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.14.0-1
- - dropped Patch4-19.
- - import Patch4-35 from rawhide.
- * Fri Dec 22 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.13.0-1
- - updated to 3.13.0.
- - replaced all Patches (from rawhide).
- * Mon Mar 16 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.10.1-1
- - updated valgrind to 3.10.1 based on fedora 3.10.1-6
- - replaced all Patches (from fedora)
- * Wed Apr 18 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.7.0-1
- - updated valgrind to 3.7.0
- - replace all Patches (from fedora)
- * Thu Nov 11 2010 Shu KONNO <owa@bg.wakwak.com> 3.6.0-1
- - updated valgrind to 3.6.0
- - updated BR: glibc-devel <= 2.12
- - added BR: gcc <= 4.5
- - added RQ: glibc <= 2.12
- * Tue Oct 05 2010 Shu KONNO <owa@bg.wakwak.com> 3.5.0-1
- - updated valgrind to 3.5.0
- - added BR: glibc-devel >= 2.11
- - split %{name}-devel
- - added patches (from fedora core 12)
- - valgrind-3.5.0-cachegrind-improvements.patch
- - valgrind-3.5.0-openat.patch
- - valgrind-3.5.0-glibc-2.10.1.patch
- - valgrind-3.5.0-ifunc.patch
- - valgrind-3.5.0-inotify-init1.patch
- - valgrind-3.5.0-mmap-mprotect.patch
- - valgrind-3.5.0-dwarf3.patch
- - valgrind-3.5.0-pr40659.patch
- - valgrind-3.5.0-helgrind-race-supp.patch
- - valgrind-3.5.0-ppc-tests.patch
- - valgrind-3.5.0-amd64-loopnel.patch
- - valgrind-3.5.0-ppc-dwarf3.patch
- - valgrind-3.5.0-amd64-adcsbb.patch
- - valgrind-3.5.0-syscalls.patch
- - valgrind-3.5.0-preadv.patch
- - valgrind-3.5.0-glibc-2.11.patch
- * Sun Apr 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.4.1-1vl5
- - new upstream release
- - changed Group to Development/Tools
- * Sun Aug 24 2008 Shu KONNO <owa@bg.wakwak.com> 3.3.1-1vl5
- - packaged new
|